From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving the last array value at the same time as analog waveform values

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

0 Kudos
Message 1 of 4
(2,446 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(2,432 Views)

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?

 

 

0 Kudos
Message 3 of 4
(2,423 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,418 Views)