Supported files

Measurement Data Viewer reads NI TDMS files and HDF5 files, and the formats built on HDF5: NetCDF-4 and MATLAB version 7.3. HDF5 support is recent: tell us about a file it does not show as expected, see Report a file.

Which files open in the viewer

Some files open in the viewer as soon as you open them. Others have an extension that other files use too: the viewer opens them only when you ask for it.

Extension Format Opens in the viewer Remarks

.tdms

NI TDMS

By default

.h5, .hdf5, .he5

HDF5, the files of pandas and PyTables included

By default

With another HDF5 viewer installed, VS Code asks which one to use: see Other HDF5 viewers.

.nc4

NetCDF-4

By default

.nc

NetCDF-4

On request

The G-code of machine tools, a text format, uses this extension too. NetCDF-3 files have it as well, and are not read.

.mat

MATLAB version 7.3

On request

The MAT files of versions 5 to 7.2, the most common ones, have the same extension and are not read.

Files with other extensions are not opened by the viewer.

Open a .nc or .mat file

  • In the Explorer, right-click the file, choose Open With…, then Measurement Data Viewer.

  • Or, with the file already open, run View: Reopen Editor With… from the Command Palette, then choose Measurement Data Viewer.

To open these files in the viewer every time, set workbench.editorAssociations in your settings, with the patterns you want:

"workbench.editorAssociations": {
  "*.nc": "measurementDataViewer.viewerOnRequest",
  "*.mat": "measurementDataViewer.viewerOnRequest"
}
The name of the viewer in this setting is measurementDataViewer.viewerOnRequest for .nc and .mat, and measurementDataViewer.viewer for the other extensions.

TDMS files

The parser is checked against reference files written by LabVIEW: it must return what NI’s own TDMS functions read from them.

Versions

TDMS 1.0 and 2.0 files (versions 4712 and 4713), written by LabVIEW or any other tool.

Layout

Multiple segments, incremental metadata, contiguous and interleaved data, little- and big-endian data.

Types

Channels and properties of type I8 to I64, U8 to U64, SGL, DBL, Boolean, String (UTF-8), Timestamp, ComplexSGL and ComplexDBL (I/Q samples, spectra): see Complex values.

Waveforms

Channels with the wf_start_time, wf_increment and wf_xname properties are plotted against their waveform time.

Units

Taken from the unit_string property.

Interrupted writes

Files cut by an interrupted write: the complete data is shown, with a warning.

DAQmx logs

Files logged by DAQmx (DAQmx raw data) are scaled as NI’s own reader scales them:

  • voltage, current, thermocouple, RTD, strain gage, bridge, IEPE, resistance and counter channels;

  • custom linear, polynomial, table and map ranges scales;

  • digital lines.

Other channels with scaling information (NI_Scale properties, NI_Scaling_Status "unscaled") are scaled the same way.

When the scales of a channel cannot be applied, its unscaled values are shown, with a warning and "(unscaled)" next to its type. See Warnings.

Not supported yet

  • Values of extended-precision and fixed-point channels.

HDF5 files

Files with the extension .h5, .hdf5 or .he5 open in the viewer, read by ranges as TDMS files are, without any library to install. The reader is checked against reference files written by h5py: every object, type, layout, attribute and value must match what the HDF5 library itself reads from them.

The File tab of an HDF5 file written by h5py: its attributes

How an HDF5 file is shown

HDF5 is a general container, a tree of groups and datasets. The viewer shows it as measurement channels:

Groups

A group that holds datasets is a group of the viewer, named by its path: /bench/fast, or / for the root group.

Channels

A dataset of one dimension is a channel.

Compounds

The fields of a dataset of compounds, such as LabVIEW clusters or NumPy structured arrays, are the channels of a group of their own. The fields of a field are named by their path (status.code), and each value of a field that is an array is a channel (position[0]), up to 64 per field.

Two dimensions

The rows or the columns of a dataset of two dimensions are the channels of a group of their own; see Tables of two dimensions.

Properties

Attributes are properties.

Tables of two dimensions

A dataset of two dimensions, such as the voltages of 4 channels × 20,000 samples that DAQmx Read returns, is a group whose channels are its rows or its columns. The viewer takes them where the file says, else from the shape of the table:

  1. a dimension scale of strings of the length of a dimension names the channels along it: sensor 1, sensor 2…;

  2. otherwise, a dimension scale of numbers or of times gives the coordinates of the samples, the other dimension gives the channels;

  3. otherwise, a dimension that can grow holds the samples, which are appended along it, as in an acquisition stopped after 5 samples of 8 channels;

  4. only when the file says nothing, the shorter dimension gives the channels (the columns of a square table).

The channels of the rows are named data[0,:], data[1,:]…, those of the columns data[:,0], data[:,1]…

The tab of the group says how many channels of how many values the table gives, and why. Switch Orientation, beside it, takes the channels along the other dimension: 20,000 channels of 4 values instead of 4 channels of 20,000. The file is read again in the background, with its progress in a notification: what was shown stays until it is done, and Cancel keeps it. The choice is kept for the file, also after a restart of VS Code. The charts of the group lose the curves of the other orientation, whose channels have other names.

The other dimension may be too large to give channels, beyond 65,536: the tab then says so, without the button.

A table of 4 × 20

The same applies to the variables of two dimensions of NetCDF-4 files and to the matrices of MATLAB files.

Files and layouts

Versions

Files written by the HDF5 library 1.8 to 2.0, in its earliest and its latest file formats, SWMR files included. A userblock before the HDF5 data is skipped.

Layouts

Compact, contiguous and chunked datasets.

Filters

Chunks with the filters of the HDF5 library (deflate (gzip), shuffle, Fletcher-32, szip, scale-offset, N-bit), with LZF (h5py), or with the filters of hdf5plugin and PyTables: Blosc (codecs BloscLZ, LZ4, LZ4HC, Snappy, Zlib and Zstandard), BZip2, LZ4, Zstandard and Bitshuffle.

Types

Integers, floats (half and extended precision are shown as doubles), complex values (compounds of two floats named r and i, as h5labview2 writes them, or real and imag, as h5py and NumPy do), strings of fixed and variable length, Booleans, enums (as integers) and object references (as paths).

Conventions

HDF5 has no standard convention for time or units. The viewer reads those of the producers of measurement files:

Producer What the viewer reads

LabVIEW, with h5labview2

Waveforms: their WAVEFORM_DT and WAVEFORM_T0 attributes give the time of the samples, as wf_increment and wf_start_time do in TDMS. A dataset of several waveforms has one per row, each with its start time. Timestamps, values with a unit (units: V), Booleans and clusters.

Python, with h5py

Times of the CF conventions: an attribute units such as seconds since 2026-01-01T00:00:00Z makes numbers dates. Units in an attribute units. Dimension scales (make_scale): a scale stored in another group is shown first in the group of the datasets attached to it, so that the charts plot them against it. The dates and durations of NumPy (datetime64 and timedelta64, from days to nanoseconds, written with h5py.opaque_dtype): dates are timestamps, durations have their unit.

Python, with pandas and PyTables

A frame or a series written by to_hdf is a group of channels named after its columns, its index first, dates as timestamps, in the fixed and the table formats. The strings of the fixed format, stored as Python objects, are not read: write them in the table format. The tables and arrays of PyTables are read, its Booleans as Booleans, its indexes left out.

Waveforms written by h5labview2: their WAVEFORM attributes as properties

The charts plot these channels against their time, as for TDMS files:

A chart of two waveforms of h5labview2 against their date and time

A CF time is shown as dates in the grid, and serves as the time of the channels of its group:

A group written by h5py: a CF time shown as dates

The LabVIEW toolkit Live HDF5 will be supported as far as reference files can be written with it.

Not read yet

What the viewer does not read is listed, with the reason, instead of being left out:

  • datasets compressed with other filters, such as Blosc2 or ZFP;

  • datasets of three dimensions or more;

  • links to other files, given as a warning.

A file with a Blosc2 dataset

Reading files of the LabVIEW toolkits written by their own VIs, rather than by imitations, is the next step. Two-dimensional views, such as spectrograms, are being studied.

NetCDF-4 files

NetCDF-4 files are HDF5 files written by the netCDF-C library: netCDF4-python, xarray, and many instruments and models. The viewer shows their values as xarray decodes them, checked against reference files of the netCDF-C library.

Variables

Variables are channels, in their groups. Dimensions without a coordinate variable hold no values and are left out.

Packing and missing values

scale_factor and add_offset are applied; values equal to _FillValue or missing_value are shown as NaN.

Strings

Character arrays are strings.

Time

A variable is plotted against its coordinate variable, a CF time of another group included.

.nc files are opened on request, .nc4 files by default. NetCDF-3 files, the classic format before NetCDF-4, are not read: the viewer says so.

MATLAB files

Measurement Data Viewer reads the MAT files of version 7.3, which MATLAB writes with save -v7.3. They are opened on request.

Vectors and scalars

A channel each.

Matrices

A group of their columns: x(:,1), x(:,2)…; Switch Orientation gives their rows instead, x(1,:)…, see Tables of two dimensions.

Strings and Booleans

A character array is a channel of strings; logical values are Booleans.

Complex values

See Complex values.

Structures

A group of their fields.

Cell arrays, sparse matrices and objects (string, datetime, table…) are listed, with the reason they are not read. The MAT files of versions 5 to 7.2, which are not HDF5 files, are not read.

This support is checked against files written in the layout of MATLAB by a Python library, not yet against files written by MATLAB itself.

Any file

  • Files that are not on a disk, such as a version of a file in the Git history, are read whole: up to 2 GiB.

  • Following a file that is still being written is not supported yet.

  • In charts: saved chart configurations are not supported yet.

Report a file

A file that does not open as expected helps a lot: report it in the issues, with the file if you can share it.