LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Non-blocking Open SubVI

Hello,

I'm trying to open a subvi.vi front panel from my Main.vi. If I call my subvi.vi from main.vi, main.vi will wait until the user closes subvi.vi before continuing execution. I don't want main.vi to wait until the user closes subvi.vi. I want both vi's to go on executing at the same time. How do I implement this?

Thanks,
Stephen
0 Kudos
Message 1 of 13
(6,367 Views)
You can use VI Server to launch the subVI.  Search the LabVIEW examples for several using VI Server.
0 Kudos
Message 2 of 13
(6,364 Views)
Use an invoke node to call the sub.vi
0 Kudos
Message 3 of 13
(6,363 Views)
forgot the image
0 Kudos
Message 4 of 13
(6,360 Views)
OK, thanks.

But how can I use the "Invoke Node" if I'm calling a VI that accepts parameters?

thanks,
Stephen
0 Kudos
Message 5 of 13
(6,345 Views)

The example I posted in the Occurence Nugget passed parameters to multiple sub-VI's.

 

Ben



Message Edited by Ben on 12-27-2007 05:11 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 13
(6,326 Views)

OK, I see that you used the Call by Reference VI to launch a VI. When I use Call By Reference (so that I can pass parameters to my subvi), the main VI waits until that subvi is completed before continuing.

How can I launch a subvi (that accepts parameters) and have both my main.vi and subvi.vi execute at the same time (NOT have main.vi waiting for subvi.vi to complete)?

thanks for the help,

Stephen

0 Kudos
Message 7 of 13
(6,292 Views)
Use the invoke nodes for Control Value->Set.  As I stated before, there are several examples that ship with LabVIEW for VI server and show how to do what you are asking.
0 Kudos
Message 8 of 13
(6,289 Views)
Stephen,

you must use the "Run VI" invoke node with "wait until done" set to FALSE. Before running the VI you can set any values to controls of the VI using the "Set control Value" invoke node. See the attached Vi on how to do it (LV7.1.1).
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 9 of 13
(6,285 Views)
All the advice posted so far on this thread is very good, standard LabVIEW advice for launching asynchronous VIs. But there are other ways to creatively take advantage of LabVIEW's inherent parallelism to do the same thing without any property nodes or invoke nodes.

For example, you can use a special blend of the Producer Consumer design pattern to launch your subVI in parallel. In this case, the subVI isn't actually called in the main (Producer) loop, which would block its execution, as you know, but rather it's called in the Consumer loop. When the Producer loop wants to call the subVI, it sends a message over a Queue to the Consumer loop telling it to call the subVI. The data type of the Queue message would be the input data for the subVI.

This achieves a flexible, efficient method for calling subVIs in parallel! Here's an example in LV8.2. Hope this helps!


Message Edited by Jarrod S. on 12-28-2007 10:15 AM
Jarrod S.
National Instruments
0 Kudos
Message 10 of 13
(6,274 Views)