09-25-2014 11:06 AM
Hi!
This is probably an easy problem to fix but I can't figure it out. I have 2 loop that runs in parallel and write to measurement file is working for the analog waveforms. But when I trying to save the temperature array only one value is written to the file. The analog waveforms collect values much faster than the temperature so I want to just save the latest array value from each channel when 1 value from the analog waveforms is saved.
Thanks
09-25-2014 11:37 AM
I would recommend making another loop for saving your data. You can use a queue to pass the data to that loop. Just store the latest value of your analog signals in a shift register. When you get a temperature reading, you append those readings to the array of analog signals and write the data to the file.
09-25-2014 12:06 PM
Thanks for a quick reply. Sorry but I don't understand you completely and I have been told that the write to measurement file should be in that loop. What I read from your suggestion is that the analog signals that are aquired at 20kHz wait for a 14hz temperature data to be aquired in the queue. In your suggestion if I can get it to work will I then get the same amount of temperature data as analog data saved to the file?
09-25-2014 12:25 PM
@PeterSB3000 wrote:
What I read from your suggestion is that the analog signals that are aquired at 20kHz wait for a 14hz temperature data to be aquired in the queue. In your suggestion if I can get it to work will I then get the same amount of temperature data as analog data saved to the file?
Isn't that what you asked for? If not, the clarify what it is you want to do.
@PeterSB3000 wrote:
Thanks for a quick reply. Sorry but I don't understand you completely and I have been told that the write to measurement file should be in that loop.
You can use another loop quite easily. Just look at the Producer/Consumer.