LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data acquisition 20Ks with time stamp

Solved!
Go to solution

Hi, Please I need help! I need to do data acquisition with 20 KHz and I would like to save these data with time stamp for each sample. I have used the myRio 1900 do it.  In my code below I have tried to read only one analog channel but after the fix my issue I will need to read two analog channel. According diagram below for each exectuion I received array with 1000 data but when I save the data in TDMS format I have only one time stamp for each exectuion.

For example the lenght date & time is 120 and the voltage is 120000.

 

LVelozo_1-1679592504843.png

 

 

LVelozo_0-1679592449451.png

 

0 Kudos
Message 1 of 13
(1,913 Views)
Solution
Accepted by topic author LVelozo

Hi LVelozo,

 


@LVelozo wrote:

when I save the data in TDMS format I have only one time stamp for each exectuion.


Convert your signals to waveforms, which contain t0 and dt. Then save those waveforms to TDMS.

Then you can easily recover a timestamp for each sample…

 

(Does myRIO allow to read waveforms directly in the same way as DAQmx?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(1,898 Views)
Solution
Accepted by topic author LVelozo

I don't think that myRIO has a DAQmx timing engine to store the t0. You can implement your own t0 engine. 

The inspiration is from NI CompactRIO Waveform Reference Library

ZYOng_0-1679600285461.png

 

 

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 3 of 13
(1,887 Views)

Hi GerdW, first I appreciated a lot your help. Please could you share with me the example how can I recover a timestamp for each sample ? I would like to have a file with two columns one time stamp and second column with data. 

0 Kudos
Message 4 of 13
(1,859 Views)

Hi ZYOng, first I appreciated a lot your help. In the example I have one column with the data, is it possible to have two collumns in the file ? I would like to have a file with two columns one time stamp and second column with data for each sample.

0 Kudos
Message 5 of 13
(1,858 Views)
Solution
Accepted by topic author LVelozo

On the waveform manipulation pallet you will find a vi that takes in a waveform and returns an array of timestamps calculated from t0, dt and size of y[].  Of course, it is trivial to write yourself.  Just auto index a for loop over y, and output t0 + i * dt to an indexing output tunnel.  If you really can't find it in your heart to use a wfm instance of DAQmx read, use timestamp + i / sample rate.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 13
(1,844 Views)
Solution
Accepted by topic author LVelozo

Use a while loop to generate an array of increasing timestamps and write it to a different channel.

ZYOng_0-1679627485343.png

 

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 7 of 13
(1,830 Views)

Hi team, please I would like your help. I am not familiar with myRIO 1900 and I need to do data acquisition from two analog input with 20KHz and 10.000 samples with time stamp. The code below working good for one analog input I have the data record in file with time stamp, but I don`t know how to insert the second analog input. If I insert two analog input in the array connected to Smart Open.vi I had a error. 

 

LVelozo_0-1679681846714.png

 

   

 

 

LVelozo_2-1679681573913.png

LVelozo_3-1679681697928.png

 

 

 

0 Kudos
Message 8 of 13
(1,799 Views)

Hi L,

 


@LVelozo wrote:

I don`t know how to insert the second analog input. If I insert two analog input in the array connected to Smart Open.vi I had a error. 


Which error did you encounter?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 13
(1,790 Views)

LVelozo_0-1679682436778.png

LVelozo_1-1679682467684.png

 

0 Kudos
Message 10 of 13
(1,783 Views)