LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to run VIs by launching a main VI?

Hello,
Firstly, sorry for my English..
I just want to think if it is possible to launch some VIs at the same time by launching a main VI, rather than running each VI separately?
And whether it's possible, how can I do it?
Thanks
Julien M
0 Kudos
Message 1 of 9
(3,227 Views)

Sequentially or in parallel?

You can place all vi in a toplevel vi and control their order through data flow (or sequence structure if all else fails).  You can also launch the vi by reference and let them run in their own thread (see examles finder). 

If you plan to run multiple programs(Vis) in parallel make sure any shared Vi are reentrany and that you dont access the same resources from multiple locations.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 9
(3,212 Views)

Presumably these VIs are meant to be running at the same time as the main VI? Then you can just use the VI Server to launch the VIs. This is referred to as running VIs dynamically. There are examples that ship with LabVIEW that show you how to load and run a VI dynamically.

EDIT: Sorry for the double answer. Posted at the same time, causing a cross-post.

Message Edited by smercurio_fc on 05-24-2007 09:16 AM

0 Kudos
Message 3 of 9
(3,210 Views)

All the VIs  must run in parallel. I have a main VI which need the launch of other VI added to my project to run correctly. So they must start at the same time (when I launch the main).

Thanks

julien M 

0 Kudos
Message 4 of 9
(3,177 Views)

Just Place all the VI including MAIN on a new top level ("Launcher").  There are a couple things to be warned about. 

1.  No parallel vi share critical resources without considering effects.

2. All subvis shares in paralles are reentrant.

3. All race conditions and deadlocks are evaluated and handled (Assuming shared resources)

4. How so signal a shutdown (I hate seing an exit labview for a lazy escape).  Consider having an input signal/message to all parallel vi to know when to safely terminate the subvis.

 

There are a few other things to consider but these are the main gotchas in concurrent LV programming.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 9
(3,160 Views)

Ok. I try to do that.

Thank you very much Paul.

Julien

0 Kudos
Message 6 of 9
(3,154 Views)

Excuse me again paul, If you have a simple application running with LabVIEW 8.2, and using a top level to lauch  VIs, that would help me much. I'm a beginner with LabVIEW, and I do not understand how to use the top levels.

thanks for your attention.

julien

0 Kudos
Message 7 of 9
(3,148 Views)

Its as simple as placing all vi on the block diagram including the main vi. then run this VI.  all subvi will now run and this new toplevel vi will not terminate until all subvi end.  If the order of launce is important or the ability to stop all vis when one stops then a more complex approach is needed. Such as dynamic vi or message passing/ synchronization techniques.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 9
(3,134 Views)

Are there any tricks to showing all 3 VIs panels at the same time?  How do you recommend doing this - by invoke nodes or by simply configuraing show panel on execute?

0 Kudos
Message 9 of 9
(2,628 Views)