LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a timestamp to a TDMS file

Solved!
Go to solution

I need to add a timestamp to my TDMS file.  Currently I am taking an array of doubles, converting them to a dynamic data type, then sending that to tdms_write.  I need to add a timestamp but I can not find a way to do that.  I have also tried taking the timestamp, converting it to a doube, U64, and I64 and adding that to my array before dynamic data type conversion but when I lose precision.  I need to have at least millisecond resolution.  I know I lose precision because the timestamp is two 64bit values.  Upper 64bits are whole seconds since epoch and lower 64bits are fractions of a second.  I would even be happy sending those two numbers split into my tdms file and converting at a later date, but can't seem to even do that.  Any help would be appreciated.

 

0 Kudos
Message 1 of 4
(3,894 Views)
Solution
Accepted by topic author boostinallovryou

The natural way would be using a waveform.

 

You could add your timestamp as two U64 (using typecast to U64 array) as properties of the channels as teh t0 of the data.

 

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!
Message 2 of 4
(3,880 Views)
Typecasting to an array of U64's would be great.  I know about the typecast block, I know what the array constant block, but where is there a U64 constant to shove into the array constant??
0 Kudos
Message 3 of 4
(3,857 Views)
Let me scratch my reply.  I just figured out how to get a U64 constant.  Thanks again for the help.
0 Kudos
Message 4 of 4
(3,852 Views)