Saving Measurements to TDMS Files With Different Frequencies

Updated Sep 27, 2022

Reported In

Software

  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

I am acquiring two different signal, Voltage and Temperature, with my DAQ device. For example, the measurements have the same sampling rate. However, I don't want to save all the samples from the temperature measurement and prefer to have 1 per 500 samples instead.

Is it possible to write to a TDMS file with different frequencies?

Solution

A potential solution for saving data with different rates is shown in the snippet below:


You can simply eliminate data you don't need to save by calculating average of multiple samples, and save the result only. This helps with managing the memory on the disk. 
The advantage of calculating an average instead of saving 1 in 500 samples is that you don't receive unexpected peaks in the logged data.

Additional Information

There is no need to save all the temperature data to a file, as the changes of it are rather slow. However, best practice is not to save 1 sample out of 500, but calculate the average and save it instead. This can prevent receiving a big jump between two saved temperature measurements.