LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect TDMS time stamp?

Solved!
Go to solution

But lets say I sample at an unknown rate for 20 seconds, shouldn't I still expect the timebase to say 20 seconds, and not 1/2 an hour, as is sometimes the case?  

 

How do I set the time or sample rate? The TDMS documentation makes no mention of either.

0 Kudos
Message 11 of 21
(2,465 Views)
You really don't understand how a graph works. The time between samples is something YOU have to provide. Where would the graph get that sort of information if you don't write it to the file - telepathy? Study some of the shipping examples and take a LabVIEW tutorial.
0 Kudos
Message 12 of 21
(2,459 Views)
Solution
Accepted by grahamwebb

Hi Graham.

I have already mentioned that I have been using TDMS rarely. But my use cases always were writing continously acquired data to a TDMS file whereas the data acquisition was done at a fix sample rate and writing to the TDMS file was accomplished by writing a waveform.  That way, I got x-axis values with timestamps in the TDMS viewer.

Attached a small example that creates a TDMS with a sine wave.

0 Kudos
Message 13 of 21
(2,458 Views)

Thats a good suggestion - writing a waveform negates the need to write it manually!

Nick
0 Kudos
Message 14 of 21
(2,426 Views)

Thank you GuenterMueller. That works well. I'm still not sure how TDMS decides what value is to be the timestamp, but I'll play around with it.

 

 

Dennis, people come here to ask questions about things they don't know. I'm sure you know LabVIEW very well, but sarcasm isn't helpful.

0 Kudos
Message 15 of 21
(2,417 Views)

can someone resave the "solution" for LabVIEW 2009?

0 Kudos
Message 16 of 21
(1,966 Views)
At the top of the LabVIEW page is a link to the Version Conversion board - http://forums.ni.com/t5/Version-Conversion/bd-p/VersionConversion
0 Kudos
Message 17 of 21
(1,960 Views)

Thanks!

 

Anyway, the solution of that problem is still not very clear. I've a similar problem:

 

I have a to save one measured value each 1 to 3 seconds over a long period in a TDMS file. It depends on an external trigger when the value is captured. So each time when I sample this value, I take also a time stamp, generate a waveform consisting of the time stamp and an array with that one single value. Afterwards I save them as a waveform-type in a tdms file.

 

After finalizing the whole measurement I reload the tdms file in the viewer but unfortunatelly the timestamps are not correct there. Between all saved measurement points is the standard dt of 1 second, starting with the timestamp of the first value. Thus the measurement points are not dispayed at the correct capturing time.

 

So my two questions:

1) Are all timestamps saved?

2) Is it somehow possible to display each timestamp value with the measurement point which was captured at the same time?

3) If I would save the timestamp as data in a separate channel, is there a possibility to display them on the x-axis to the other channel in the TDMS Viewer?

 

Thanks for the answers.

0 Kudos
Message 18 of 21
(1,947 Views)

no idea?

0 Kudos
Message 19 of 21
(1,919 Views)

Older discussion, but I do have what I believe is the answer. As best as I can tell, when saving tdms data at least one shortcut is used to presumably cut down on overhead. When saving begins ONLY the first timestamp seems to be saved and all the rest are based on the waveform time increment. If you pause or use a variable time saving scheme the true timestamp is NOT saved for data after the first one even if you change it through the build waveform function. The timestamps will be based on the time increment value only. To get around this I save another column with actual timestamp information in it. I use this for the x values later during processing of the data. Works well enough for my use anyway.

 

Robert

 

Forgot to note, data ends up being nonperiodic and some math functions will not work with nonperiodic data - just keep that in mind. I talking about something like trying to do an FFT or something Smiley Tongue

0 Kudos
Message 20 of 21
(1,815 Views)