05-25-2010 02:42 PM
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
Solved! Go to Solution.
05-25-2010 03:53 PM - edited 05-25-2010 03:54 PM
You can convert the data to a string and then add the time stamp

05-25-2010 05:01 PM
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
05-25-2010 09:27 PM
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