LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass data between subVIS using Event structures.

Hi! I am working in a program where each button is handled by an Event
structure (there is a subVI inside every event)
When the program is running, a subVI must be executed when a button is
pressed. The problem is other options are blocked (even if I am using the
unlock option) until the subVI is done.
If I want to pass data from one subVI to another subVI (Just in time) I have
to wait until the actual running aplication is finished.
Do yo know how to solve it?

Thanks
0 Kudos
Message 1 of 3
(2,913 Views)
The event structure has been designed to sequnzialize user events. This is described in the help of the event structure. Locking and unlocking works with the front panel (has the text is). Unlocking allows the user to handle controls before the event is ready but the events will be executed one after each other.

You want to pass data from subVI1 to subVI2. Doing this you always have to wait until subVI1 completes because the data is on its connector pane which is connected to the connetor pane of subVI2.

Or do you send the data over queue, notifier or global variable?

In this case you have to use VI server to load and run a VI. You can use the method RunVI and set Wait until finished to False. If you have to give parameters to the VI you must u
se Set Control Value before you let it run. Look in the examples of LV for VI server and client/server.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 3
(2,913 Views)
You need to have two independent loops. One for catching (or handling) events and one for actually doing the work spawned by the event. This is a pretty common design pattern. Have a look at the Design Patterns presentation from last year's NIWeek; I believe there may be an example.
0 Kudos
Message 3 of 3
(2,913 Views)