From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-23-2023 12:36 PM
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.
Solved! Go to Solution.
03-23-2023 02:03 PM
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?)
03-23-2023 02:39 PM
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
03-23-2023 07:40 PM
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.
03-23-2023 07:42 PM
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.
03-23-2023 08:30 PM - edited 03-23-2023 08:35 PM
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.
03-23-2023 10:12 PM
Use a while loop to generate an array of increasing timestamps and write it to a different channel.
03-24-2023 01:15 PM - edited 03-24-2023 01:17 PM
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.
03-24-2023 01:23 PM
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?
03-24-2023 01:27 PM