LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling two independant VIs from a main VI.

I have a main VI running a main program. Acquiring Temperature Data from a DAQ system and writing values to Digital Output Card are the two sub tasks that the main program has to perform.

I want to create two seperate VIs, One VI that acquires temperature and writes it to a text file at its own speed and one writing values to the Digital output card at its own speed. These VIs should run independant of the main VI but the vaules should be accessible by the main VI.  How do I accomplish this?

How to control two autonomous VIs from a main VI? I also want to stop all the VIs if there is error in any of the VIs.

0 Kudos
Message 1 of 4
(2,468 Views)
What you are doing is not an unusual thing to do.  Though calling them two "autonomous VIs" implies a more complicated architecture then you really need.
 
Your main program should have 2 parallel loops.  In one loop you do the temperature acquisition and data logging.  The other loop does the digital output control.  If you want, you can wrap the code in each loop into a subVI.
0 Kudos
Message 2 of 4
(2,465 Views)
wire the refnum of the controls or indicators to a global variable and you can access the data from the main vi.
0 Kudos
Message 3 of 4
(2,453 Views)

"I also want to stop all the VIs if there is error in any of the VIs"

Wire the error output of all of your vis to a global variable (write).

Use this global (read) to stop all gour vis

0 Kudos
Message 4 of 4
(2,452 Views)