LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time stamp refreshing issue

I am new in using labview so I would need your help.
As you can see from the attached code I have 3 different while loops:
-the first one to acquire data from a serial port
-the second to acquire data from different sensors (DAQmx)
-the third to create a timestamp to use as x-axis in all charts
I need to use time stamp because it is the only way that, as far as I know labview until now, allows me to synchronize serial and sensor data.
However every 500s the charts refresh, losing all the data acquired up to that moment, and starting to acquire new data.
My questions are:
-Is it, as I believe, a timestamp problem? What is the reason? How can I solve it?
-Are there alternatives to synchronize the data of a serial with that of a DAQmx?

--What mistakes am I making in writing the code?
I hope to be clear in the explanation, I attach the main for clarity

 

Thank you very much for answers

0 Kudos
Message 1 of 4
(829 Views)

@SpaceCowboy90 wrote:

However every 500s the charts refresh, losing all the data acquired up to that moment, and starting to acquire new data.
My questions are:
-Is it, as I believe, a timestamp problem? What is the reason? How can I solve it?


That is the expected behavior when you put the charts in scope mode.

 

It behaves like a scope. If history length is filled, it clears the chart and start over.

 

(See Properties>Appearance>Update mode

0 Kudos
Message 2 of 4
(821 Views)

@SpaceCowboy90 wrote:

-Are there alternatives to synchronize the data of a serial with that of a DAQmx?


You could make each device\loop publish it's data, and then have a loop consuming the latest value from each device\loop. E.g. you can put each value in a single element queue (or a channel wire),and dequeue it to get the most recent value.

 

The DAQ loops do not need to be concerned about timing at all.

0 Kudos
Message 3 of 4
(818 Views)

@SpaceCowboy90 wrote:

--What mistakes am I making in writing the code?


You could straighten things a bit. Well, a lot.

 

There's not really a need to use waveforms. I know they are almost pushed in your face, but often simple scalar doubles are a lot easier to work with.

 

Getting a waveform from your DAQ, then using waveform functions to get the latest sample, then use more waveform functions to... Etc. If you'd get an array of data, you could simply use delete from array to get the last sample. And that would be it.

0 Kudos
Message 4 of 4
(816 Views)