In one sentence
TDMS is a binary format that keeps measured values and their descriptions (names, units, sampling intervals and so on) in one file, and lets software append data while recording. NI software such as LabVIEW, NI-DAQmx, DIAdem and FlexLogger reads and writes it.
It is not text, so Notepad and Excel cannot read it directly. In return, the file is smaller than the same data in CSV, and both writing and reading are faster.
Three levels: file, group, channel
| Level | Role | Examples |
|---|---|---|
| File | One test or recording as a whole | Title, author, date and time of the recording |
| Group | A set of channels | Categories such as "Vibration" and "Temperature", or one group per device |
| Channel | One sequence of values | Acceleration X, inlet temperature |
Every level can carry any number of name and value pairs called properties. Only channels hold data. Each channel can have its own data type, number of values and sampling interval.
How the file is laid out: segments
A TDMS file is a sequence of segments. Each segment has three parts.
- Lead-in (28 bytes): a four-character tag (TDSm), a table-of-contents mask that says what the segment contains, a version number, the length to the next segment and the offset to the raw data.
- Metadata: the channels that have data in this segment, with their data types, value counts and properties. It can be omitted when nothing changed from the previous segment.
- Raw data: the values themselves, stored either channel after channel or interleaved (one value per channel in turn).
While recording, software only has to append new segments, so long measurements can be written without stopping. A file written in many small pieces ends up with many segments and can be slower to read (NI software offers a defragment function that rewrites it).
Data types and timestamps
- Numbers: 8, 16, 32 and 64-bit integers (signed and unsigned), single and double precision floating point.
- Strings: UTF-8.
- Booleans: one byte.
- Timestamps: whole seconds since 1 January 1904, 00:00 UTC, as an integer, plus the fraction of a second as another integer. No time zone is stored, so a reader converts to local time for display.
Files logged by NI-DAQmx during acquisition store the raw integers from the device (the DAQmx raw data format), with the scaling to volts, temperature and other units attached as properties.
Waveform properties
Evenly sampled data (a waveform) has no time column; the time axis is described by channel properties.
| Property | Meaning |
|---|---|
| wf_increment | Time between samples in seconds; the sampling rate is 1 divided by this value |
| wf_start_time | Start time of the waveform |
| wf_start_offset | Offset from the start time |
| wf_samples | Number of samples per acquisition |
| unit_string | Unit of the values |
| wf_xname, wf_xunit_string | Name and unit of X |
.tdms_index and TDM
- .tdms_index: an index file created next to the .tdms file with the same name. It copies only the lead-ins and metadata and holds no values. The .tdms file can be read without it.
- TDM (.tdm and .tdx): an older format that keeps the descriptions in an XML .tdm file and the values in a binary .tdx file. TDMS is the better fit for appending while recording.
TDMS compared with CSV
| TDMS | CSV | |
|---|---|---|
| Content | Binary | Text |
| File size | Small (values kept in their own type) | Large (numbers written as text) |
| Units, sampling interval and other descriptions | Stored alongside as properties | No standard place |
| Data with different sampling intervals | Each channel keeps its own | Hard to fit in one table |
| Software that opens it | Needs software that supports TDMS | Almost anything |
To hand data to someone else or use it in software without TDMS support, exporting the TDMS file to CSV is the easy route.
Look inside a TDMS file
LOGADEC opens TDMS files with no installation. Start it from Try it in your browser and choose a .tdms file: each channel appears as a "group/channel" column, and you can select channels by group. After loading, you can list the file, group and channel properties, and export to CSV or Excel with [Export data].
No file at hand? Try the sample TDMS file (pump_test.tdms, 160 KB). The steps are in How to open and plot TDMS files.