LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tdms 1d array timestamp

Solved!
Go to solution

Good day. I have problem with TDMS, this is the first time I've used it and I'm a labview novice. I have a 1D array of data ~100 values that each represent a different signal. The data comes off the serial port and labview reads it ~200Hz update rate. Now I download a vi from ni website for writing the 1D array to a tdms file. This works great and can read in Excel, now however I would like to add a timestamp. Each block of 100 values should have the same timestamp as thay are basically read in at the same time. What is the best method to accomplish this. It would be nice to just add another element to the array, but the data is 32bit integer. I would like to have 5ms resolution. Is there another way?

 

Thanks

John 

0 Kudos
Message 1 of 4
(4,700 Views)

You can convert the data to a string and then add the time stamp

 

Message Edited by Rodrigo Cuenca on 05-25-2010 03:54 PM
Rodrigo Cuenca
www.cidesi.com

0 Kudos
Message 2 of 4
(4,689 Views)

I don't have LabVIEW right now, but the following description should help you:

-Store all the data from one sensor in an array (you should have 100 arrays or a n by 100 2D array).

-Store each array in a waveform, and add a dt of 0.005

-Write an array of waveforms (100) into the TDMS file, using the default 'write to TDMS' function

Use a convenient groupname and a string-array with 100 signalnames.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 4
(4,678 Views)
Solution
Accepted by shenlung

Since all channels have the same time stamp, you could add a channel of type time stamp and write the time stamp for each scan to that channel.

 

You could save the loops by storing data interleaved.

 

Since you are storing single values for each channels, your file can get fragmented pretty badly. You might want to use the NI_MinimumBufferSize property in order to prvent that.

 

Hope that helps,

Herbert

0 Kudos
Message 4 of 4
(4,667 Views)