LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS: Best way to store small integers with scaling?

I'd like to log high-speed data in a TDMS file. The data arrives as I16 (non-DAQmx), with some scaling + offset.

 

If I call "TDMS Set Scaling Information" and then write I16 arrays to the TDMS file, they all get converted to DBL behind the scenes (NI_DataType == 10). This seems a bit wasteful and causes file bloat.

 

Is there a way to store scaling information without triggering an implicit conversion to DBL? Or would I have to scale all the data myself and then write smaller types (say, I32 or SGL) into the TDMS file without writing the scaling info?

Certified LabVIEW Developer
0 Kudos
Message 1 of 4
(986 Views)

Hi JKHS,

 

TDMS allows to set properties for each channel/group in the TDMS file.

So you can easily save your data as I16 (as is) and store the scaliing information as property of the channel…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(981 Views)

@GerdW wrote:

TDMS allows to set properties for each channel/group in the TDMS file.

So you can easily save your data as I16 (as is) and store the scaliing information as property of the channel…


Thanks GerdW.

 

To confirm that I've understood your suggestion correctly: I would avoid "TDMS Set Scaling Information" but instead write the scaling info as a custom property. The reader of the TDMS file would then read the raw I16 values back out, get the scale/offset property values, and then perform the scaling themselves as a post-processing step; is that right?

 

I was hoping that there's a way to store the data points as I16, store the scaling info, and then have "TDMS Read" (or an off-the-shelf TDMS viewer) do the conversion automatically. Does such a feature currently exist?

Certified LabVIEW Developer
0 Kudos
Message 3 of 4
(966 Views)

Hi jkhs,

 


@JKSH wrote:

I was hoping that there's a way to store the data points as I16, store the scaling info, and then have "TDMS Read" (or an off-the-shelf TDMS viewer) do the conversion automatically. Does such a feature currently exist?


AFAIK there is no such feature built in. You either get scaled data stored as DBL, or you get unscaled data stored as I16.

 

When you need a feature not provided by NI then you need to implement it on your own...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(925 Views)