LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

acquire tdms file with timestamp in seconds starting at zero

Hi
 
I'm looking to convert from saving data files in diadem dat format to saving in tdms format. Im using a PC-6143 using continuous acquisition on eight channels, I want to record up to eight channels of data with a single time channel (in seconds - no date etc) that starts at zero at the beginning of acquisition.
 
I can see how to record data to tdms but I'm not sure from looking at the available examples how to record a time channel let alone one that starts at zero seconds.
 
This is for importing into diadem. 
 
Any suggestions appreciated
 
Nick
 
 
0 Kudos
Message 1 of 5
(3,392 Views)
I advice you to save waveforms! In DIADem you can easily import them!

If you don't want to do that you do can just at a channel with the timestamps (as dbls) of the moment of importing.


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!
0 Kudos
Message 2 of 5
(3,390 Views)

Hi Ton

thanks for replying, the trouble with not recording time is that anyone openning the acquired data will not know the sample rate. I could record the sample rate in the data set comments but people would have to know to look for it.

Regards

 nick

0 Kudos
Message 3 of 5
(3,384 Views)

Hi,

  assuming you've read the information here :
http://zone.ni.com/devzone/cda/tut/p/id/3539
then there shouldn't be much of a problem. The initial start time and dt are stored in the tdms along with the channel data as attributes, rather than a separate channel, but if you wanted to create one yourself, then you could generate the data for the channel programatically.

Notice how in figures 2 and 3 of the above link, the write is done from the signal data type, and the read is bringing back waveform data automatically.

Hope that helps

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 4 of 5
(3,375 Views)
If your dT never changes, waveforms are by far your best bet. As people mentioned earlier in this thread, they store both T0 and dT so DIAdem will automatically recognize and use them. There are several examples shipping with LabVIEW that show how to implement this (doesn't require the blue Express type wire).

If your dT changes over time, you can create an additional channel for the time information.
- If your time starts at zero, make it a channel of type double and just store the "time elapsed" in seconds. DIAdem will not recognize that this is your time channel. The time and data channels have to be assigned to each other in DIAdem either manually (drag&drop) or within a report layout or script.
- If you need absolute time, see the example "TDMS - Write Event Data" for how to create a timestamp channel. Note that DIAdem doesn't have a fully qualified time stamp data type. It will round the time values to an accuracy of one second. Again, it's up to you to assign time and date channels to each other.

Hope that helps,
Herbert


0 Kudos
Message 5 of 5
(3,365 Views)