Pass data between subVIS using Event structures. 
Author Message
 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



Mon, 18 Jul 2005 18:37:55 GMT  
 Pass data between subVIS using Event structures.
Dear Mr/Mrs:
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



Mon, 18 Jul 2005 18:16:53 GMT  
 Pass data between subVIS using Event structures.
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 use Set Control Value before you
let it run. Look in the examples of LV for VI server and
client/server.

Waldemar



Mon, 18 Jul 2005 21:04:14 GMT  
 Pass data between subVIS using Event structures.

Quote:
> I have to wait until the actual running aplication is finished.
> Do yo know how to solve it?

This sequential behavior will happen with or without the event structure
if you keep all of your code in one loop.  If you break the tasks that
you want to be in parallel out to be in their own loop, or in their own
top level VI, then you can accomplish this.

I'll cover the parallel loop case.  Take your subVI calls that you make
currently and place them in parallel loops.  In the event structure
where you were calling them, bundle the parameters together and use a
notifier to send the structure.  In the parallel loop, you will have the
matching read notification that takes the structure apart and wires to
the subVI, then loops and waits again.  If you want for multiple
executions to be queues, then use a queue instead of a notifier.  You
will also need a way to abort all of the waiting parallel tasks, so it
would be a good idea to have a standard part of the cluster passed to
them to be an abort/execute parameter.  When you want them to abort,
fire all the notifiers telling them to abort rather than execute.

Greg McKaskle



Mon, 18 Jul 2005 22:34:34 GMT  
 Pass data between subVIS using Event structures.
You have posted this question twice:

Look also here:
<a
href="http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135...">Pass
data between subVIS using Event structures</a>



Mon, 18 Jul 2005 22:47:00 GMT  
 Pass data between subVIS using Event structures.
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.


Wed, 20 Jul 2005 00:36:40 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Event case loses connection to data structure when data structure is modified

2. using multiple event structures polling for panel closing event

3. GOBO data structure library vs other data structure libraries

4. How to pass on values to SubVIs

5. Pass DATA to next step in Sequence Structure

6. passing variables to subVIs /local

7. Passing data structures to/from C

8. Complex C data structures passed to Tcl ?

9. Passing C data structures to tcl scripts

10. Passing data in events

11. Passing Record structure using DDE

12. Using an Event Structure to sense selection of a ring control

 

 
Powered by phpBB® Forum Software