The LabVIEW waveform datatype consists of the following elements:
- t0 - The start time of the waveform.*
- dt - The time interval between data points in the waveform.
- y - The data values of a waveform.
*The t0 property can be stored as a timestamp or a numeric. If t0 was originally stored as a numeric, the behavior described below does not apply.
If you pass a waveform to the TDMS Write VI, the resulting TDMS file will contain one waveform channel that contains all of the information listed above. If you attempt to plot this channel in the View or Report Windows in DIAdem, the x-axis will display relative values for the timestamps in the waveform. These values are computed using the wf_increment channel property, and they start at zero.
In order to display the timestamps as absolute values, e.g. 01.01.07 12:00:00, it is necessary to split the waveform channel into two separate channels, one for the time, and one for the amplitude. This can be accomplished in either DIAdem or LabVIEW.
DIAdem Approach - These steps have been automated in the script "WaveformAbsoluteTimestamp.VBS"
- If you do not already have a TDMS file to work with, generate one using the unmodified shipping example "Cont Acq&Graph Voltage - Write Data with Time to File (TDMS).vi"
- Load the TDMS file into the DIAdem data portal.
- Calculate the difference between 1/1/0000 and the t0 value of the waveform (using the wf_start_time property)
- Split the waveform channel into time and amplitude channels.
- Add the offset computed in step three to the values in the newly created time channel.*
- Display the time and amplitude channels on a report having an x-axis configured with the correct time format.
*By default, converting the waveform channel to a numeric channel will create dates starting at 1/1/0000 in the resulting time channel.
LabVIEW Approach - Refer to the modified shipping example "Cont Acq&Graph Voltage - Write Data with Time to File (TDMS).vi"
- Use the WDT Get Waveform Time Array DBL VI to create an array of timestamps based on the t0, dt, and number of values in the y component of the waveform.
- Explicitly write this array to the TDMS file by itself so that it will be created in a separate channel.*
- Use the Get Waveform Components VI to separate the y values from the waveform.
- Again, write this array by itself to the TDMS file.
- Load the TDMS file into the DIAdem data portal. Notice there are already two channels, one for the time, and another for the amplitude.
*It is not necessary to offset the timestamps in the time channel in LabVIEW - the TDMS Write VI automatically handles this for you.