LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I start two Vi at the same time?

 I have two Vi's, each of these Vi has a stop button. I want to start these two Vis at the same time. I also want to be able to stop the two Vis at the same time. What should I do? Thanks.
0 Kudos
Message 1 of 5
(3,367 Views)
One way to start them is with an Invoke Node and the Run method. You can then stop them with the Set Control Value [Variant] method. When you use the Set Control Value [Variant], you just have to specify the name of the front panel control that stops the while loop. Older versions of LabVIEW only had the Set Control Value method in which you had to use the flatten to string function to pass the Type Descriptor and Flattened Data.
 

Message Edited by Dennis Knutson on 03-20-200609:35 AM

Message 2 of 5
(3,356 Views)
Thanks Dennis. Do you mind to send me the file in .Vi format. I have Labview 7.0. Thanks
0 Kudos
Message 3 of 5
(3,330 Views)
I would suggest that you first try to write it yourself. The functions are on the Application Control palette. When you drop an Invoke Node on the block diagram, you first have to right click and do Select Class>VI Server>VI. Then you can browse the methods and select the ones I've shown.
Message 4 of 5
(3,299 Views)
You could simplify this a lot and just put both VIs on the same block diagram, then they run at the same time. Put them together in a frame or case if you have other things that must happen first.

To stop them, you could use a reference to a front panel button or you could simply use a global to have them both end when you press a stop button.

The VI server methods is a great method, but for a simple app and depending on your experience, the globals would be a lot simpler.

Message Edited by Mike King on 03-21-2006 09:12 AM

0 Kudos
Message 5 of 5
(3,290 Views)