How to Log Data Across Multiple TDMS Files with DAQmx

Updated Feb 15, 2023



  • LabVIEW


  • NI-DAQmx

I want to write a specified number of samples of acquired data to a TDMS file and automatically create new files each time that sample limit has been reached. How can I do this?

You can specify the amount of samples written per TDMS file using the DAQmx Read property Logging:Samples Per File. This property specifies how many samples to be writen to each file. When the file reaches the number of samples specified, a new file is created with the naming convention of <filename>_#.tdms, where # starts at 1 and increments automatically with each new file.

To programmatically set this property, follow these instructions:
  1. Drop a DAQmx Read Property Node onto the block diagram.

  1. After clicking on the property node, select Samples Per File under the Logging category.

  1. Wire the DAQmx Read Property Node to your DAQmx Read function to set the property and specify the number of samples to write per file.