LabVIEW

cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

dynamic event case for dummys

Hi everyone...

Today, I tried to use Dynamic Event Case to create a new Excel Workbook using ActiveX. I've seen a lot of VI's and my program doesn't work.

I want push a button in a VI (Top-Level)... but my Sub-VI has an Event Structure Case inside.
I don't know what is wrong with my program. Please I need help (step by step) to understand how dynamic event case will work correctly.

P.D. I had a terrible headache because of that šŸ˜›

I know my english is too bad... sorry about that.

Best regards to all of you

Download All
0 Kudos
Message 1 of 7
(3,079 Views)

Hi Ziccozzis,

your example can“t work. Before you can wait for a user event you have to register it, but this happens first in your sub vi. If you change your code in this way that both vis run in parallel, then it as well don“t work, because in your first event structure (Top Level.vi) the event has already processed so that the sub vi don“t get the event.

Why don“t you use a Queue to transfer your data?? I think a user event is more for one main vi with an event structure reacts on controls from many other front panels.

Mike

0 Kudos
Message 2 of 7
(3,064 Views)
Mike said:
" If you change your code in this way that both vis run in parallel, then it as well don“t work, because in your first event structure (Top Level.vi) the event has already processed so that the sub vi don“t get the event."
 
I don't think this correct. As long as you have register to an event, all events in parallel will be executed, even if they are the same.
If one event executes, this does not prevent other same events to be executed in other event structures.
 
The problem of Ziccozzis, is the first thing you said.
0 Kudos
Message 3 of 7
(3,051 Views)
By the way, the event registration in the sub vi has no meaning.
I don't know exactly what you want to do, so i can be wrong, but the sub vi is only being executed if the first event has occur.
So a simple sub vi , without event registration for the same thing, will do the job.
0 Kudos
Message 4 of 7
(3,048 Views)
Well, I have some VI's to specific work... then, I would like to create a Top Level VI with some boolean controls and indicators.

If Button 1 (top level) is pressed: only Sub-VI #1 will work.
If Button 2 (top level) is pressed: only Sub-VI #2 Will work

And my problem is: how can I connect (reference) Button 1 [top level] to "button 1" in Sub-VI #1?... but the "button 1 " of the Sub-VI is inside of an event case structure.
My Sub-VI doesn't detect the "value change" of my control in "TOP LEVEL VI"

I need a picture!!! hahahaha.
Sorry... but I never tried to do this before.
0 Kudos
Message 5 of 7
(3,025 Views)
Hi Ziccozzis
if you only want to initiate the event of a button in a subvi (button is in an event structure) you can use the reference of this button in your Main vi and take the property node "value (signaling)". If you do that the event will occur in the subvi.
Mike
0 Kudos
Message 6 of 7
(3,015 Views)
Hi MikeS81

That's great... that was the idea, initiate the event structure in the subVI... I could make it without a reference, much better...

Thank you so much
0 Kudos
Message 7 of 7
(2,999 Views)