TDMS Open Function

Owning Palette: TDM Streaming VIs and Functions

Requires: Base Development System

Opens a .tdms file for reading or writing. You also can use this function to create a new file or replace an existing file. Use the TDMS Close function to close the reference to the file.

Examples

 Add to the block diagram  Find on the palette
create index file? specifies whether LabVIEW automatically generates a .tdms_index file for the corresponding .tdms file. This index file enables LabVIEW to speed up random access to the .tdms file. If you have limited disk space, wire a FALSE value to this input to prevent LabVIEW from generating the .tdms_index file. The default is TRUE.

LabVIEW ignores this input if you open a .tdms file that already has a .tdms_index file. Wiring a FALSE value to this input does not remove this file. LabVIEW might update this file during the TDMS application to ensure this file is up-to-date. To remove this file, you can manually delete it from the disk or programmatically delete it by using the Delete function.
Note  If you use multiple TDMS Open functions, which have different values for the create index file? input, to open the same .tdms file, LabVIEW uses the create index file? input of the first TDMS Open function to determine whether to generate the .tdms_index file or not. LabVIEW ignores the create index file? input of all subsequent TDMS Open functions.
The .tdms_index file is optional in TDMS applications. When you distribute a TDMS application or .tdms file to another computer, you do not need to include the corresponding .tdms_index file. You can use this function to create a new .tdms_index file for your TDMS application if necessary.
file format version specifies the file format version for the .tdms file. Refer to the following support document at ni.com for more information about the .tdms file format.

01.0
12.0 (default)
file path specifies the absolute path to the file you want to open. If you use this function to create a new file, the file extension of the filename you specify in file path must be .tdms. Otherwise, this function automatically appends .tdms to the filename you specify. If you use this function to open or update an existing file, you do not have to ensure that the file extension is .tdms.
operation specifies the operation to perform.

0open (default)—Opens a .tdms file to write to.
1open or create—Creates a new .tdms file or opens an existing .tdms file to configure.
2create or replace—Creates a new .tdms file or replaces an existing .tdms file.
3create—Creates a new .tdms file.
4open (read-only)—Opens a read-only version of the .tdms file.
byte order specifies the byte order, or endian format, of the data in the .tdms file. Byte order specifies whether LabVIEW represents numeric values in memory from most significant byte to least significant byte or vice versa.

The byte order input is valid only if you use this function to create a new .tdms file. If you use this function to read an existing .tdms file, LabVIEW reads data in the byte order of that file and represents the data in the native byte order of the host computer. If you use this function to update an existing .tdms file, LabVIEW writes data in the byte order of that file.

0big-endian, network order—Specifies that the most significant byte occupies the lowest memory address.
1native, host order—Specifies that this function uses the byte order of the host computer.
2little-endian (default)—Specifies that the least significant byte occupies the lowest memory address.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
disable buffering? (Windows) specifies whether LabVIEW opens, creates, or replaces a .tdms file without system buffering. The default is TRUE, which means this function disables system buffering and enables buffering in the TDMS disk cache. Disabling system buffering can speed up data transfers in certain situations. If you have a small amount of data to transfer, you might not notice a difference if you disable system buffering. To read or write a data file to a Redundant Array of Independent Disks (RAID), consider opening the file without system buffering to speed up data transfers. To read the same set of data repeatedly from the computer, consider enabling system buffering.
tdms file out returns a TDMS file reference to the .tdms file on which you performed the operation.
error out contains error information. This output provides standard error out functionality.

Examples

Refer to the following VIs for examples of using the TDMS Open function: