LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Log an arbitrary waveform to TDMS

I'm trying to log an arbitrary waveform (one that is not time-based, e.g. x0 = -180, dx = 0.25) to a TDMS file.  For some reason I can't figure out how to do this.  It appears that I am only able to log time-based waveforms to a TDMS file. I tried to cast my x0 to a timestamp but it coerces negative values to a zero timestamp.  I have all my data being displayed on waveform graphs perfectly fine with a x0, dx, Y cluster.

 

So, is there a way to log my waveform to TDMS without requiring any post-processing?

0 Kudos
Message 1 of 3
(2,169 Views)
  1. If you cast a negative to timestamp, LabVIEW doesn't coerce negative values to a zero timestamp. By default, 0 means timestamp '0:00:00 AM 1/1/1904', so -180 will be casted to timestamp as '11:57:00 PM 12/31/1903'. The number is treated as seconds.
  2. TDMS only accepts time-based waveforms. If you want to give different meanings to the t0 and dt of the waveform, you should need some post-processing. In TDMS files, t0 will be mapped to 'wf_start_time' property, dt will be mapped to 'wf_increment' property. At the same time, TDMS file will add another property 'wf_start_offset'. So, if you treat t0 as 0, then you can set  'wf_start_offset' property as -180 to meat your requirement.

 

0 Kudos
Message 2 of 3
(2,134 Views)
  1. Ok, so I was using the "Type Cast" VI which casts everything to the uninitialized state:  00:00:00.000 PM MM/DD/YYYY.  I see now that there is a special VI for this which works as you have stated (To Time Stamp).
  2. That is unfortunate that a TDMS won't properly log arbitrary waveforms.  I'll look more into what I would like to do with this and probably do some random trials.
0 Kudos
Message 3 of 3
(2,095 Views)