TDMS
- Updated2023-11-02
- 6 minute(s) read
TDMS
This topic describes how NI-XNET frame data is stored within National Instruments Technical Data Management Streaming (.TDMS ) files. The National Instruments TDMS file format provides efficient and flexible storage on NI platforms. The TDMS file format enables storage of a wide variety of measurement types in a single binary file, including CAN, FlexRay, LIN, analog, digital, and so on.
This topic specifies the method used to store NI-XNET raw frame data within TDMS. Although you also can store NI-XNET signal waveforms within TDMS, raw frame data is the most efficient and complete way to store NI-XNET data. Raw frame data can be easily converted to/from protocol-specific frames or signal waveforms for display and analysis.
TDMS is recommended for new applications that access NI-XNET data within files. For examples that demonstrate use of TDMS with NI-XNET, refer to the NI-XNET Logging and Replay category in the NI Example Finder (for example, Hardware Input and Output : CAN : NI-XNET : Logging and Replay ).
Previous versions of NI-XNET and NI-CAN used a file format called NCL to store raw frame data. If you have an existing application that uses NCL, you can continue to use that file format. Examples for NCL continue to be installed with NI-XNET ( examples\nixnet folder in your LabVIEW directory), but they no longer appear in the NI Example Finder. If you need to store multiple sources of data in a single file (for example, multiple CAN interfaces, or CAN with analog input), you should consider transitioning your application from NCL to TDMS. Because both file formats use the same raw frame data, the changes required for this transition are relatively small.
Within the TDMS file, a sequence of raw frames is stored in a distinct TDMS channel for each NI-XNET interface (for example, CAN port). From the TDMS perspective, the frame data is an array of U8 values. The U8 array represents one or more raw frames.
The version of TDMS used with this specification must be 2.0 or higher.
Channel Name and Group
Name
The name of the TDMS channel can use any conventions that you desire, but it should be sufficient to identify the network that is stored. For example, if you log data from two CAN interfaces, you might name the first TDMS channel Powertrain network and the second TDMS channel Body network . If you have an NI-XNET database that contains distinct clusters for each network, the Name (Short) property often provides a useful description of the network, and can be used directly as the TDMS channel name.
The name of the TDMS group can use any conventions that you desire. The group name is required for NI-XNET frame data, but if you do not use multiple groups in the TDMS file, you can select a simple group name (for example, My Group ).
Channel Data
The data you read and write to the TDMS channel must be an array of U8 values. No other TDMS data types are supported.
The channel data contains one or more frames encoded using the Raw Frame Format. The raw frame format encodes all information received on the network, along with precise timestamps. The protocols supported include CAN, FlexRay, and LIN.
The TDMS Channel Properties specify additional requirements for encoding of the raw frame data. The property NI_network_frame_byte_order is particularly important, as this specifies the byte order used for the Timestamp and Identifier elements within each raw frame.
Channel Properties
Special properties are used on each TDMS channel to distinguish the data from a plain array of U8 samples. Properties are also provided to assist in interpreting the data, such as conversion to signals (physical units).
All properties for NI-XNET frame data use the prefix NI_network_ . This prefix ensures that the properties do not conflict with names used by your application. The following table lists the channel properties.
Name | Data Type | Permissions | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
NI_network_protocol |
![]() |
Required |
Specifies the network protocol used for all frames in this channel. The property value is an enumeration:
If this property does not exist, the data shall not be interpreted as raw frames, but as plain U8 samples. |
||||||
NI_network_frame_version |
![]() |
Required |
Specifies the raw frame encoding version. The encoding of this number is specific to each protocol listed in NI_network_protocol. For CAN, FlexRay, and LIN, the version encoding is the Upgrade Version in lowest order byte, and Major Version in next order byte. The two upper order bytes are 0. The Major Version indicates a change that breaks compatibility with the previous version. The value for this specification is 2. The Upgrade Version indicates a change that retains compatibility with Upgrade Version 0. The value for this specification is 0. If this property does not exist, the data is not interpreted as raw frames, but as plain U8 samples. |
||||||
NI_network_frame_byte_order |
![]() |
Required |
Specifies the byte order for multibyte elements within each frame's data. For example, the frame's Identifier is a 32-bit value, and Timestamp is a 64-bit value. Refer to the Raw Frame Format for details. This property does not specify byte order for TDMS properties or other TDMS channels. This property does not specify byte order for signals within the frame's Payload (that is, covered by specifications such as CANdb, LDF, AUTOSAR, and FIBEX). The property value is an enumeration:
|
||||||
NI_network_content |
![]() |
Optional |
Provides information that describes the content of the payload of frames on this network. This typically is information to map and scale physical-unit values from each frame's payload. The encoding of this string is specific to each protocol listed in NI_network_protocol. For CAN, FlexRay, and LIN, the string encoding is: <alias>.<cluster> The <alias> specifies an alias to a network database file (content specification). This alias provides a short name, used to refer to a database file across multiple systems. When you register an alias with tools, you typically use the database filename on the local system, without the preceding path or file extension. For example, the path c:\MyDatabases\CANdb\Powertrain.dbc would use an alias of Powertrain. The <cluster> refers to a specific cluster (network) within the database. A database file can specify multiple networks within a vehicle. This portion of the string is optional (you can use <alias> without "." or <cluster>). If the cluster does not exist, it is assumed that only one network is specified within the database. When you use NI-XNET, this string uses the same syntax as the XNET Cluster I/O Name. The registered alias refers to a file on Windows (DBC, LDF, AUTOSAR, or FIBEX text file), or on LabVIEW Real-Time (compressed binary file). When you use tools that do not explicitly contain NI-XNET (for example, NI DIAdem), support for this property may have limitations. For example, DBC files may be supported, but not LDF or FIBEX. This property is optional. For applications that read the log file, if this property does not exist, the effect will depend on the goal: Display of frame values: no effect—the network content is not needed. Display of signal values: application opens a dialog to ask the customer to browse to the file. |