Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous save of a fast loop and a slow loop with multiple mx inputs.

I am attaching my app in hopes that someone might help me. In the app I have two loops. One takes in data from 2 inputs (temp and voltage and I would like to add one more voltage on another channel), the other runs very slowly through the comm port to a mass spectrometer. I can not find a way to graph all the data in one simple file and just as annoyingly is the lame attempt to read temperature in both loops. This method ensures that my Mass spec slow loop data will have its own temperature readings but it errors sometimes do to the way I have the MX input. I tried doing all the saving using queues but the slower mass spec loop was not offering up data quickly enough causing the dequeue loop to wait for data and then the upper quick loop queue to pile up. So i have two issues/options -#1 figure out how to save data from both loops to a single file, and fix the temp inputs so they wont crash each other. Or #2 use the queue method but not have to wait for data from the lower slow loop. Any ideas? Really what I am trying to do is not complicated, the slow acq rate of the ms kinda ruins things. It spits out data whenever it feels.
THanks
0 Kudos
Message 1 of 3
(2,955 Views)
Hello Tim,

A producer-Consumer solution using queues should solve your problem. I have attached below a starter for what I am refering to. There are two producer loops, each of wich will enqueue the data and a tag for the data. The data and tag are clusterred so that you can check the tag whenever you dequeue the data.
In the consumer loop, you can check the tag every time that you dequeue an element and act according to the tag. You can even dequeue directly to file and save both the data and the tag, that way when you read the file, you can check the tag and act accordingly.
Hope it helps.
0 Kudos
Message 2 of 3
(2,946 Views)
I did not whether you have LabVIEW 7.1 or LabVIEW 7.0. So I created two versions of the program. You will find the programs in the zip file attached above.
0 Kudos
Message 3 of 3
(2,944 Views)