LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

add timestamp to analog acquisition

Hi
I have an analog acquisition and I am using DAQmxReadAnalogF64 to acquire the values , Id like to know if it is possible to add time stamps to the data acquired with this function.
Actually I am plotting thoose values in a graph and storing it into a text file too, so what I need is the graph to show timestamps values or millisecond or second values on the X axis graph and add a column to my file with the corresponding time value.
the name of the file is NAME-Date-Time and I like the time value corresponding to data value in a third column with a count acoording to the rate of my acquisition , I mean the first data value acquired on the first row must have a 0 time stamp the second one if hte acquisition rate is 1khz must be 0,001 and so on.
Does anybody have an idea to do this the right way?

Thanks
Olivier
0 Kudos
Message 1 of 4
(3,648 Views)

With reference to the graph plotting, you can use PlotWaveform that automatically plots the data adjusting X-axis according to initial value and increment (rate of acquisition) you pass to it.

As per file saving, I'm not aware of a function that automatically adds the time column, but you can easily create the time array using the Ramp function and save it together with your data.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 4
(3,637 Views)
Hi,
Ok thanks roberto
now I have my ramp and as value are stores non interleaved Id like to concatenete my ramp array to the end of the measurement arrayin order to write all data to a file with correct match between values and time .
is ther a function to concatenete arrays, I dont know how to do it
thanks

Olivier
0 Kudos
Message 3 of 4
(3,604 Views)

Well, you could memcpy the ramp array at the end of measurement array, but personally I prefere to use Copy1D; supposing you have acquired 1000 samples from 3 channels and you have created your ramp array, you can append it to the measurements this way:

Copy1D (ramp, 1000, measures + 1000*3);

Of course your measurements array need to be sized accordingly so that the ramp array can be copied to it, otherwise you will receive some fatal error like input past end or so.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(3,601 Views)