Files, groups and channels
The viewer shows a file the way NI’s Excel add-in does: the file first, then one tab per group.
The File tab
To try this page on the data of its screenshots, download demo-bench.tdms, and demo-unsupported.h5 for the warnings, from the demo files.
|
-
Properties: the properties of the file, with their value and type.
-
Groups: each group with its number of channels. A click on a group opens its tab.
-
Export to Excel… and Export All Groups to CSV…: see Copy and export.
Group tabs
Each group has a tab, named after the group.
The groups of an HDF5 file are named by their path, such as /bench/fast; see How an HDF5 file is shown.
- Group properties
-
The properties of the group.
- Channels
-
The table of the channels: name, type, number of values, then one column per property found on the channels, such as
unit_stringor thewf_*properties of TDMS waveforms, or the attributes of HDF5 datasets. - The grid of values
-
One column per channel, in the order of the file.
Above the grid:
-
Open chart and Open XY chart open a chart of the group: see Time charts and XY charts.
-
Follow the charts makes the grid scroll to the samples the charts point at.
-
The Share menu, at the right edge of the grid, copies the cells selected and exports the group.
The viewer follows the theme of VS Code, light or dark.
The grid of values
- Column headers
-
The name of the channel, its unit, its type and its number of values, as in NI DIAdem.
- Rows
-
Numbered from 1. A channel shorter than the others leaves its cells empty below its last value.
- Timestamps
-
In local time, as NI DIAdem and the Excel add-in show them, or in UTC: choose in the list at the top right of the viewer, or with the setting
measurementDataViewer.timeZone. - Real numbers
-
With 15 significant digits by default; the setting
measurementDataViewer.significantDigitschanges it, and0shows the exact value. - Booleans and text
-
As they are in the file. A text too long for its column ends with "…": widen the column, or show the whole value with Show Value.
- Complex values
-
As
2.1379 - 0.4178i, each part with the significant digits of real numbers.
The grid reads its rows by blocks as it scrolls, at any position of the file. It scrolls through any number of rows: the scroll bar for large moves, the mouse wheel and the keys row by row. The line under the grid gives the number of rows and how long the last block took to read.
Column widths
Each column is as wide as its values, up to about 36 characters. To change it:
-
drag the right edge of its header;
-
double-click that edge to fit the column to its name and its values, at most the width of the grid.
The widths are kept for each group while the file is open.
To try this section and the next one, download demo-scan-settings.tdms from the demo files: settings of a scan stored as JSON, in a channel and in properties.
|
Long values
A right click on a cell of the grid, or on the value of a property, then Show Value, shows the whole value in a read-only editor beside the viewer. There, a long text can be read, searched, and copied in part.
-
JSON is indented, with its colours and folding; its numbers stay as the file writes them (
10.0,5E-7). -
XML has its colours.
-
Real numbers have all their digits, whatever the setting
measurementDataViewer.significantDigits.
The editor shows a copy of the value: the file is never modified. Its tab closes as any other; after a restart of VS Code, show the value again from the viewer.
Linked with the charts
When a chart of the group is open, the grid shows the samples the chart points at:
-
the row under the mouse in the chart;
-
the rows of the measurement cursors C1 and C2, the active one framed.
With Follow the charts ticked, the grid scrolls to them. The other way, the mouse over a cell shows its instant in the charts, and a click on a cell moves the active cursor there.
Decimal separator
Values are shown, copied and exported with the decimal separator of the system, as Excel expects: 2,5 rather than 2.5 in French or German. This applies to the grid, the properties and the charts too, which then group thousands with spaces (20 000), as a comma would make them read as decimals.
The setting measurementDataViewer.decimalSeparator sets it: system (the default), point or comma.
On macOS, system is the separator of the region and of the number format chosen in Language & Region of System Settings, as Excel uses it; a change there applies when VS Code gets the focus back.
Excel workbooks store numbers as numbers, whatever the setting: Excel shows them with its own separator.
Warnings
Problems that do not prevent reading the file are shown as warnings above the tabs. For instance:
-
a file cut by an interrupted write: the complete data is shown;
-
a channel whose scales cannot be applied: its unscaled values are shown, with "(unscaled)" next to its type, in orange.
Each warning closes with its ×, in the viewer as in the charts: those of a chart stay closed while its tab is open.
Files changed on disk
When an open file changes on disk, its viewer and its charts say so, with a Reload button that reads it again. The viewer keeps its tab, the charts their curves. Values appended at the end are announced too. The notice closes with its ×, and comes back at the next change of the file.
Meanwhile, a file that got shorter, was written over or was replaced is no longer read: its values could not match its structure.
A file deleted, moved or renamed outside VS Code offers Close tab instead. If it comes back where it was, the notice goes, or offers to reload it when it is another file.