Creating Multiple TDMS Files During the Single Execution of the VI in LabVIEW

Updated Oct 31, 2022

Reported In

Software

  • LabVIEW

Issue Details

I need to log the data into multiple TDMS files, during a single run of the LabVIEW VI. 

Solution

It is possible to create several TDMS files in a single run of the VI. You can use two methods according to your needs.

Logging the Data Simultaneously Into Multiple Files
For example, if you want to log the data acquired from different sensors into multiple files, you can use the parallel writing method. In this way, the TDMS files are created and logged separately and they have no connection between them, so you can use them not only in the same loop but in separate loops as well.
Paralell.png

Creating a New File When the Specified Time Expires
In case you want to log the acquired data into the same TDMS file but you have problems with file sizes, you can create a new file in the specified interval of time. This makes the data post-processing easier, as there will not be a need to deal with large files.
In the below-mentioned example, on the left side, there is the loop for creating the new TDMS file (in this case every 10 seconds). The operation for the "TDMS Open.vi" is specified to "create".
On the right side, there are the loops for the logging process. The operation for the "TDMS Open.vi"-s is set to "open or create". This will open the newly created file by referring to it with the use of its path, thanks to the local variable of the path.
Multiple TDMS Files Every N minutes.png

When using this method, it is possible that the interval between the first and the second files will not be exactly the specified time. But there will not be any data losses due to this issue.

Additional Information

NOTE: When you log the data in a separate loop, out of the acquisition loop, ensure that you do not have a mismatch of the acquiring samples and the logging samples. This can cause duplicated samples or losses of the logged data.