LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect TDMS time stamp?

Solved!
Go to solution

Where does the time stamp come from in the TDMS file format? I assumed it was the system time and date, but this doesn't seem to be the case.

 

I have a vi that captures data, does some processing then saves some parameters using the TDMS format. I collected and saved 20 seconds of data (timed using a stop watch), but when I open the TDMS file, the time stamp is from 0 to 41 seconds. I have repeated this with various times and there doesn't appear to be any sensible relationship with the time given in the TDMS file and the actual time. I've also double checked by saving the system clock and it's still out.

 

Do I need to set a timing parameter before using the TDMS format?

 

 

0 Kudos
Message 1 of 21
(6,692 Views)

I have used TDMS rarely until now. What I have been doing right now is wiring a waveform with t0 and dt to the TDMS Write function. The TDMS Viewer then shows the correct timestamps on the x-axis.

0 Kudos
Message 2 of 21
(6,681 Views)

grahamwebb, could you provide a VI file to reproduce your issue so that others could get more details to help you?

0 Kudos
Message 3 of 21
(6,671 Views)

The problem disappeared when I put together the attached vi. I must have occurred when a file is written to more than once. I'll see if this is true in my main code ..

 

 

0 Kudos
Message 4 of 21
(6,657 Views)

I've added the rest of my code and the problem still occurs.

 

To see the problem start a stopwatch and press "stream to file" at the same time. Wait 10 seconds or so then stop, load the TDMS file and see that the length of time elapsed according to the TDMS file time axis isn't the same as your stop watch. Why?

 

The aim of this code is to be able to save to different files while the data are streaming, and avoid disrupting the data capture. It sits in a much bigger loop.

0 Kudos
Message 5 of 21
(6,646 Views)

Anyone?

0 Kudos
Message 6 of 21
(6,633 Views)
I don't see an issue. The timestamps are being written and the elapsed time matches your front panel. If you expect to plot a graph, the x axis dt data is not being saved so you would need to use an xy graph.
0 Kudos
Message 7 of 21
(6,626 Views)

Hello Graham,

 

I am unsure exactly what you are describing. I have added a wait of half a second in your loop so you can see clearer the data. I have attached what I can see.

 

You have recorded a second channel of time data, when you view your data in the TDMS viewer graph it won't be plotting these values against each other. You would need to set each channels settings using the TDMS Set Properties VI.

 

If you open up the TDMS file in excel you will see the two channels in adjacent columns which will make for easy plotting there.

 

Hopefully this is of some help.

Nick
0 Kudos
Message 8 of 21
(6,622 Views)

Hi Both, 

 

The problem I have is that the time values on the x-axis of the graph in the TDMS viewer are meaningless. I assumed they would come from the system clock, hence why I saved the clock to check. I could use my own timestamp, but what do those TDMS time values refer to?

 

Thanks

Graham

 

 

Message 9 of 21
(6,609 Views)
They would not be meaningless if you acquired multiple samples and wrote the correct information. Since you are acquiring a single sample at a time at an unknown rate, the graph is simply defaulting to a dt of 1.
0 Kudos
Message 10 of 21
(6,606 Views)