LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call vi by reference

Hi,

 

I have a sub vi I need to execute, but I don't want the VI where it is in to wait until it is done. The only way I know to realize it, is opening a reference to this VI and use the 'run VI' invoke node and set 'wait until done' to false.

 

Now I generally never do it this way so I have 3 questions:

 

-Any other way to set 'dont wait until done' ?

-Normally I wire in and outputs to the sub-vi, how does this work with the invoke node

-Can the VI be reentrant without problems?

 

Thank you!

0 Kudos
Message 1 of 6
(3,170 Views)
  1. There's no other way.
  2. You can use the VI's Set Control Value method before running it (and yes, this is a terrible way of doing it).
  3. The VI can be reentrant, but make sure you use the reentrant flag when opening the reference to the VI (I believe it's 8. Should be in the help for the Open primitive).

I suggest you vote for this idea, so at some point we can have a better way of doing this:

 

Adding a "(don't) wait until done" option to the Call By Reference node.


___________________
Try to take over the world!
Message 2 of 6
(3,154 Views)

I have to add an information to point 2:

There are several other ways to pass data to that subvi. You don't necessarily have to depend on Ctrl.Set Val.

Mechanics which come to mind are:

- Functional Global Variables (FGV, aka Action Engine)

- Queues/Notifiers

 

There are some other, but either they don't pop up in my mind or i consider them to be "not suggestible".

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 6
(3,146 Views)

Thanks for the help. I'll be using a 1 element queue with a cluster of data in this case, as I need to pass several datatypes.

 

0 Kudos
Message 4 of 6
(3,139 Views)

Here's a trick, but it's kind of clunky, and it only works in LV 7.1

0 Kudos
Message 5 of 6
(3,124 Views)

 


_Faust wrote:

I have a sub vi I need to execute, but I don't want the VI where it is in to wait until it is done.


Please provide more details. If a subVI needs to run in parallel to the toplevel VI, all you need to do is place the icon on the toplevel diagram and avoid data dependencies to the main code.

 

0 Kudos
Message 6 of 6
(3,107 Views)