Can I Save Disk Space by Using I16 Instead of F64 for Data Logging?

Updated Mar 23, 2020

Issue Details

I am programming in C using the DAQmx API, and I am trying to find a more efficient way to read and store acquired data using raw integer, rather than calibrated floating-point. Would I be able to save more disk space with I16 rather than F64, using DAQmxReadBinaryI16 instead of DAQmxReadAnalogF64?

Solution

Using un-scaled data versus floating point data does not always necessarily mean the file will be smaller. For example, if the file is a text file and the floating point numbers have less significant digits than the integer data, the floating point file will actually be smaller. This corresponds to the fact that each character in a text file is an 8 bit integer (ASCII), so the more characters, the larger the file will be.

Integer vs floating point is more worth considering for processing performance than for data size. This DAQmx Help topic  explains it in more detail. In general, it is only recommended to use unscaled data if you see performance issues with floating point.

Whether using I16 vs F64 will actually save disk space will be dependent on the exact file type that will be used. TDMS for example is a file type that does not differentiate between these two formats. However, if the file type you will be using differentiates between the different formats, it would probably make sense to use whichever data format that will optimize size with that file type.

Additional Information

In general, it is recommended to use binary file formats, and use TDMS logging, as it is an efficient file storage method.
Logging data to a text file is not recommended as it takes up a significant amount of space for each ASCII character.