09-21-2021 03:13 AM
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?
09-21-2021 03:21 AM
09-21-2021 03:39 AM
@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?
09-21-2021 05:09 AM
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...