Insights · Test & measurement

TDMS vs CSV:
how to log LabVIEW test data

When plain CSV is enough, when NI's TDMS format earns its place, how to open TDMS files without LabVIEW, and how to avoid the fragmented-file trap.

Published 4 Dec 2026 · Live Experts

Every LabVIEW test system has to write its results somewhere, and for most projects the choice comes down to two formats: CSV, the plain text file every tool can open, or TDMS, NI's own binary format built for measurement data. The answer depends on how fast you acquire, how much you need to record about each run, and who opens the files afterwards, with what software.

What each format is

CSV: a plain text table

CSV stores one record per line, with fields separated by commas. There is no formal standard; RFC 4180, an informational RFC, documents the format most implementations follow: the header line is optional, fields that contain commas, line breaks or double quotes are wrapped in double quotes, and a quote inside a quoted field is written twice (RFC 4180). It defines structure only. There is no place for data types, units or a description of the test, so anything beyond the numbers has to go in a header row or a separate file by your own convention.

TDMS: NI's measurement format

TDMS (Technical Data Management Streaming) is a binary format NI designed for saving measurement data. It is organised in three levels, file, group and channel, and you can attach your own properties at every level, such as an operator name on the file, a unit serial number on a group, or a unit and sensor ID on a channel (NI: the TDMS file format). Raw data and metadata live in the same file (NI: TDMS internal structure).

How NI itself compares them

NI's LabVIEW help has a table of file formats with the job each one suits. It lists delimited spreadsheet files for manual reporting and exporting, with no metadata, and TDMS for high-speed logging and streaming with built-in metadata where performance matters most. It also sums up the general trade-off: text files are portable and human-readable but slower, larger and lose precision compared with binary, while binary files are faster, smaller and can stream to disk (NI: determining which file format to use). The same table lists TDMS portability as the "NI ecosystem", which is the main thing to weigh against it.

Where the difference shows on a real rig

Speed and file size

For high-rate acquisition, TDMS is the format NI builds its fastest logging path around. NI reports streaming rates of more than 1.2 GB/s in its tests of the NI-DAQmx logging feature, which writes TDMS directly from the driver (NI: the TDMS file format). A CSV file has to turn every number into text first, which costs time and disk space (NI: determining which file format to use). On a slow rig, reading a few temperatures and pressures once a second, neither speed nor size will matter, and that is where CSV is at its strongest.

Precision

Text only keeps the digits you write. LabVIEW's Write Delimited Spreadsheet VI writes arrays to a text file that spreadsheets can read, and the floating-point version's default format string is %.3f, three digits after the decimal point (NI: Write Delimited Spreadsheet (DBL)). If your signal is in microvolts or microstrain, a default left in place quietly rounds it away. Set the format to match your measurement, for example %.6e. Two more defaults to check: the delimiter is a tab, so you must wire in a comma to get a true CSV, and "append to file?" is false, so each call replaces an existing file unless you change it (NI: Write Delimited Spreadsheet (DBL)). TDMS stores the binary values as they are.

Metadata: the settings behind the numbers

Six months after a test, the numbers alone are rarely enough. You need to know which unit was tested, by whom, on which fixture, with which limits and calibration. In TDMS these go in as properties on the file, group or channel and travel with the data. In CSV you have to invent a convention, such as a block of header lines or a second file per run, and make sure every program that reads the file understands it.

Large files and Excel

Excel opens CSV directly, but a worksheet holds at most 1,048,576 rows by 16,384 columns (Microsoft: Excel specifications and limits). At 1,000 samples per second, one channel passes the row limit in under 18 minutes.

Opening TDMS files without LabVIEW

The usual worry about TDMS is that colleagues without NI software can't open it. In practice there are several routes:

  • Excel. NI's TDM Excel Add-In is a Windows add-in that opens a TDMS file as a workbook, each group as a worksheet and each channel as a column, and lets you choose which properties to load (NI: TDM Excel Add-In download, NI: using the TDM Excel Add-In). NI describes it as free of charge (NI: the TDMS file format); the download page asks for an NI login.
  • Python. The open-source npTDMS package reads TDMS files and can convert a file, group or channel to a pandas DataFrame, and it can read large files in chunks instead of all at once (npTDMS: reading TDMS files). It is licensed LGPL-3.0, its own README calls its writing support rudimentary (npTDMS on GitHub), and it can't read extended-precision floating-point data (npTDMS: limitations). NI's own nidaqmx Python package points to npTDMS for reading the TDMS files it logs (nidaqmx on PyPI).
  • MATLAB. tdmsread, in the Data Acquisition Toolbox since R2022a, reads a TDMS file into one table per group (MathWorks: tdmsread). MathWorks lists Windows, and Debian Linux from R2026a.
  • NI tools. DIAdem reads and writes TDMS directly (NI: the TDMS file format), and FlexLogger, which logs to TDMS, can export a log to CSV by hand or automatically when logging ends, mapping every channel to one common CSV data rate (NI: FlexLogger CSV export, automatic export).

The TDMS catch: fragmented files

TDMS has one habit that catches out new users. Each time you append to a file, TDMS writes a new segment with a lead-in, any metadata that changed and the raw data (NI: TDMS internal structure). Each write call records a block that can hold several channels, so one channel's data ends up spread across the file rather than stored in one piece (NI: introduction to TDM streaming). Write many small chunks, or keep changing the channel list, which forces a full new object list into the segment (NI: TDMS internal structure), and the file can become large and slow to read.

The fixes are well known:

  • Write larger blocks less often instead of one sample per call. TDMS buffers data per channel before writing, and LabVIEW lets you set that buffer size with the NI_MinimumBufferSize property (NI: file buffering with TDMS files).
  • Keep the channel list and properties steady during a run; write run settings once at the start.
  • Run TDMS Defragment after the test. NI's reference describes it as cleaning up a file that has become cluttered, to improve performance (NI: TDMS Defragment), and NI's streaming guide explains that it regroups each channel's data and suggests running it offline after acquisition, so the cost is paid once instead of on every read (NI: introduction to TDM streaming).

Which one to choose

CSV is usually the better fit when:

  • The rig is slow and small: a few channels, low sample rates, short runs.
  • The files go straight to people or systems that expect plain text, such as a customer's quality database or an Excel template.
  • Very little needs recording besides the numbers, or a simple header block covers it.

TDMS is usually the better fit when:

  • You acquire fast, or many channels, or for long runs.
  • Each file must carry the unit serial number, operator, settings, limits and calibration with the data.
  • The data will be analysed later in DIAdem, MATLAB, Python or LabVIEW rather than read by eye.

It doesn't have to be one or the other. One practical split is to log full-rate raw data to TDMS and also write a short CSV summary per unit, one row with the serial number, pass or fail and the key results, which the quality team can open in Excel. If someone later needs the raw data as CSV, it can be exported with the Excel add-in, npTDMS or FlexLogger, as above. Exporting flattens the file, so properties have to go into a header or be dropped.

How we handle logging on test projects

We write the run settings into every file, whichever format the project uses, and we choose the format with you based on who reads the data and with what tools. Our clearest example is a modular LabVIEW data acquisition platform we built for a US engineering client in 2026, which acquires, displays, logs and alarms on their test hardware and led to a follow-on build. More on what we build is on data acquisition and test systems and LabVIEW development. If you are still choosing hardware, see NI DAQ vs USB DAQ, if the language is open, LabVIEW vs Python for test automation, and for how to structure the program, state machine vs queued message handler.

Questions engineers ask

What is the TDMS file format?

TDMS is NI's binary file format for measurement data. It stores channels in a file, group and channel hierarchy, with your own properties at each level, so settings and serial numbers stay with the data (NI: the TDMS file format).

How do I convert a TDMS file to CSV?

Three common ways: open it in Excel with NI's TDM Excel Add-In and save the sheet as CSV; read it in Python with npTDMS, convert the group to a pandas DataFrame and write that out as CSV (npTDMS: reading); or, for FlexLogger logs, use its built-in CSV export (NI: FlexLogger CSV export).

What is the .tdms_index file, and can I delete it?

It is a copy of the file's structure without the raw data, which speeds up reading. NI says it isn't needed for storing or sharing the data and is regenerated automatically (NI: the TDMS file format, NI: TDMS internal structure). Send only the .tdms file.

Why is my TDMS file bigger than the same data in CSV?

A frequent cause is that it was written in many small pieces, or the channel list or properties kept changing, so the file holds many segments, each with its own header and metadata (NI: TDMS internal structure). Write larger blocks and run TDMS Defragment after the test (NI: TDMS Defragment).

Get a fixed price for your project

Describe what you want built and within two working days you get a free written plan with milestones, risks and a fixed price. Clients rate our work 4.9 out of 5 across 354 verified Freelancer reviews.

Tell us what you're building.

Send a short brief. We reply with questions or a fixed-price proposal. If AI isn't the right answer, we'll say so.