LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sampling while other stuff is going on

I have a main VI which is constantly reading analog values from sensors and I would like to write to output files from these readings... one file would be at 2Hz and the other at 10Hz.  My problem is that I have some subVIs in my main VI which take a couple seconnds to run (they contain control loops that take a little bit to reach a steady state) and I'm trying to figure out a way that will interrupt the main VI no matter what and take the sample and then return to the same point the maint VI was at and continue.... I don't know if there is another way to do it... maybe some sampling vi running in parallel with the main one?

 

Could someone point me in the right direction? So far I've tried an Even structure and used the timeout loop to run my sample code at 10Hz... but that didn't work... I'm looking at priority loops now and timed while loops.... but if anyone knows a better route I would appreciate the information....

 

Much Thanks 

0 Kudos
Message 1 of 2
(2,381 Views)
Multiple parallel while loops.  One for DAQ, one for file writing, one or more for your other long term control functions.  Pass data from one loop to another by way of queues.  Look up Producer/Consumer architecture.
Message 2 of 2
(2,368 Views)