TDMS Close Function
- Updated2025-01-28
- 3 minute(s) read
TDMS Close Function
Closes the .tdms file you opened with the TDMS Open function.

Inputs/Outputs
![]() tdms file specifies a reference number to the .tdms file on which to perform the operation. Use the TDMS Open function to open the refnum. ![]() error in describes error conditions that occur before this node runs. With the following exception, this input provides standard error in functionality. This node runs normally even if an error occurred before this node runs. ![]() file path out returns the path of the .tdms file on which you performed the operation. ![]() error out contains error information. This output provides standard error out functionality. |
(VxWorks) LabVIEW loads the shared TDMS component into memory when you open a TDMS file. LabVIEW unloads this component from memory when you close all TDMS files. On the VxWorks operating system, unloading the TDMS component from memory will leak approximately 1.8 kilobytes of memory due to a known issue of VxWorks. You can follow the guidelines below to avoid memory leak in your application.
- Avoid opening and closing TDMS files unnecessarily on VxWorks.
- Open an additional TDMS file at the beginning of the application and keep it open until the application completes all TDMS reading and writing. This workaround will keep the TDMS component in memory while you frequently open and close other TDMS files.
- Set the TDMS component as a startup component on your RT target. To do this, add tdms.out; to the StartupDLLs section of ni-rt.ini, which is located in the root directory of your target (c:\ni-rt.ini), then restart the target. This will prevent the TDMS component from being unloaded from memory when you close TDMS files.
For information on how to access files such as ni-rt.ini on your RT target, refer to the KnowledgeBase on ni.com.
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\File IO\TDMS\Standard Read and Write\TDMS Read Events Data.vi
- labview\examples\File IO\TDMS\Concurrent Access to TDMS File.vi