LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

adding timestamp to tdms

Good morning,

   You would  think this would be well documented by now, but I'm having a hard time finding the answer.  For the time being we do our data analysis outside of Labview, and I am needing to add a time channel to my TDMS data file.  It needs to be in its own column just like the measured data when its imported into Excel.  I have played with the TDMS Write Example but the problem is, while the measured waveform has 6000 samples, the time channel only has 11.

 

   In the final VI, I will be taking data at 2700 samples/sec/channel.  Any help would be appreciated.

 

 

Thanks.

0 Kudos
Message 1 of 6
(14,053 Views)

Check what kind of Data your writing into TDMS.

As per your VI, Every time you’re writing Waveform data (i.e. t0, dt,Y). here, Y-have 1-D Array. So, your no. of samples = Loop count * size of 1-d Array.

 

 

TDMS.png

Munna
0 Kudos
Message 2 of 6
(14,008 Views)

Use the Get Waveform Time Array VI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 6
(13,980 Views)

Yes if you are writing the waveform data type, the start time and DT will be already in the TDMS file as a property of the channel.  This shows up on the first workbook of Excel.  But often people want to see the actual time, not have to calculate it them selves for each sample.  The solution I've seen several people do is they make their own Time channel.  They use the waveform information about start time, DT and number of samples, and when they write their waveform, they then also write their Times.

 

Attached is a quick example that simulates taking data, then writing the times and data to two separate channels.  If you are going to do this it might be a good idea to freeze the first column and row in Excel so that the times and channel names are always visible.  Lucky for you there already exists a tool that takes a TDMS file and creates an excel file just like this.

 

https://decibel.ni.com/content/docs/DOC-36555

Message 4 of 6
(13,970 Views)

Dear All,

 

I have find a VI on the web(http://www.ni.com/example/30230/en/) that writes timestamp of the t0 component by "WDT Get Waveform Time Array DBL" as you have stated. However, I want to write relative data. How can I do this?

 

I've tried "Get date and time" and after build array, but this array returns only one value. Thus result mean nothing meaningful.

 

Also I find an example VI "TDMS Write Events Data" in this VI time data added implicitly. This property might come from Simulate Signal, but I couldn't find any other clue on how to write "Time*" column on measured data.

 

Thanks and best regards.

0 Kudos
Message 5 of 6
(10,600 Views)

Hi Norian,

 

However, I want to write relative data. How can I do this?

To get relative time you subtract the start time of your measurement from current time…

 

I've tried "Get date and time" and after build array, but this array returns only one value.

When you build an array from a scalar value you will get an array with just one element - THINK DATAFLOW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(10,596 Views)