Table Of Contents

Logging Across Multiple Files

Last Modified: January 31, 2020

You can split TDMS logs across multiple files by using either the DAQmx Start New File function/VI or the Logging.SampsPerFile attribute/property.

Start New File

The DAQmx Start New File function/VI starts a new TDMS file with the specified file name the next time data is written to disk. If the logging mode is set to Log, data is written to disk on multiples of the Logging.FileWriteSize attribute/property. For example, if Logging.FileWriteSize is set to 150 when you use this function/VI, a new TDMS file is created at the next 150 sample interval. If the logging mode is set to Log and Read, data is written to disk when you call the DAQmx Read function/VI.

Samples Per File

The Logging.SampsPerFile attribute/property specifies the number of samples to log to a TDMS file before creating a new file. New files are named with the convention of <filename>_####.tdms, where #### starts at 0001 and increments automatically with each new file.

You can set the Logging.FilePath attribute/property while the task is running to change the file path. The change takes place with the next file created. If you change the log name, the numbering of the files resets to 0001. You can also change the directory to save log files to by specifying a name ending in a back slash (for example, D:\). If you specify a directory, the log file name remains the same and file numbering continues off of the old directory. For example, if you change the directory from C:\ to D:\ while logging to testlog_0003.tdms, testlog_0003.tdms is written to C:\, and testlog_0004.tdms is written to D:\.


If the Logging.LoggingMode attribute/property is set to Log Only, Logging.SampsPerFile must be divisible by the Logging.FileWriteSize attribute/property, which is based, by default, on the buffer size.

To change a file immediately, you can also use the DAQmx Start New File function/VI while the Logging.SampsPerFile attribute/property is active.

Recently Viewed Topics