LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Start 4 programs at once

Hi, 

I am attempting to run four individual VI's at the same time. Each VI has its own input and they do not rely on the other VI's for any information. I just need all four  VI's to start at the same time. What would be the easiest way to do this? I tried to make each VI a sub VI and put them all on the same VI but this did not work. 

Thanks 

0 Kudos
Message 1 of 5
(2,809 Views)

They need to be parallel (i.e. loosely the same time) or they need to be synchronised (i.e. exactly the same start time)?

 

For parallel, 4 subVIs should be ok. If you post your code, we could check what the problem might have been.

For synchronised, you'll probably need to be a bit more clever. One option might be to add a notifier input to each VI, start them running asynchronously, and have them wait for a notifier before starting. Then, fire the notifier in the main VI once you've waited long enough for all of the VIs to be running and waiting nicely.


GCentral
0 Kudos
Message 2 of 5
(2,801 Views)

What should the calling VI do after running the 4 VIs?  If it is to continue doing other tasks or simply close and do nothing else, then you'll want to look at asynchronous call and forget.  Calling the subVI by dropping it on the block diagram causes the main VI to remain in memory and wait for the execution of the subVI to complete. 

aputman
0 Kudos
Message 3 of 5
(2,781 Views)

For the timing, the best case scenario would be under 250 microseconds. Would programs in parallel be able to work with this timing constraint? 

0 Kudos
Message 4 of 5
(2,780 Views)

Also, if you are placing all 4 on the same VI and then running it, you say this is not working.  Is it not actually running the 4 VIs, or is it just not popping up their user interfaces?  If you want the user interfaces to pop up when you start the calling VI then modify the properties of each of the subVIs to display when run.  Easy way to do this is pop up the properties window by pressing CTRL+I.  Then go to "Window Appearance" in the drop down.  Click "Customize", check the box that says "Show front panel when called".  

 

These other posts also bring up a good point though, your calling VI will remain in memory until all 4 VIs are closed.  If you don't like that you may want to look into asynchronous launch as proposed already.

0 Kudos
Message 5 of 5
(2,764 Views)