Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Putting While Loops in Parallel

I am using LabVIEW 7.1.  I have a while loop that both records data from voltage signals, and outputs signals to pumps, compressors, etc.  This is always running at 1 second intervals.  I would like to implement a watchdog timer.  In doing this, I have a sub vi with a timer loop that sends a 0 or 5 volt signal every 5 seconds.  I can get the two programs to run individually, but when i try to combine them, I can't get them to work together.  I have tried putting the watchdog VI both inside my data acquisition loop and outside of it.  When it is outside, the data acquisition works, but my watchdog doesnt.  When it is inside the loop, nothing works.  The odd thing is, when I double click on the watchdog VI when it is outside of my DAQ loop, the front page of that sub VI shows that it is working.  But when I added the indicator to the front page of my main vi, it indicates that it is in fact not working.  How can I get them to run simultaneously, without one slowing down the other? 
0 Kudos
Message 1 of 2
(2,919 Views)
It sounds like your subVI has it's own while loop. If that's the case, then of course it won't work. If you put it outside the main while loop, then the subVI will start but it won't return any data to the main until it stops and it probably can't stop until you press a button on the subVIs front panel. If you don't make it's front panel visible, there is no way to stop it from the main. Putting it inside the main while loop is even worse because the rest of your program won't run until the subVI stops but you don't have any way to stop it. One way around this is to remove the while loop in the subVI, create a second while loop in the main, and put the subVI inside this second while loop.
0 Kudos
Message 2 of 2
(2,911 Views)