Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
com 1
ni.com
Brian Hoover
TDMS File Format Usage In LabVIEW
Samsung SDI
Test Software Architect
LabVIEW Champion, CLA
(aka Hooovahh)
http://www.linkedin.com/in/hooovahh
https://twitter.com/hooovahh
ni.com
TDMS Overview
• Format on disk - Mostly binary data blobs
with some human readable sections
• Three Levels of data storage
• Similar to Excel spreadsheets
• Each level can contain properties, while
Channels can contain properties and
data
• Two files on disk, TDMS and the Index
• Index isn’t required but improves
performance
How data is organized is ultimately up to the developer. Knowing
what parts of the data are important may change the layout, or what
is stored to make looking up data easier.
ni.com 4
TDMS Usage
• Introduced on the Palette in LabVIEW 8.20 (earlier support for 7.1)
• Stability, performance improvements, and new functions with
each version
• Polymorphic Read/Write accept most common data types
ni.com 6
TDMS Properties
• Properties contain a single data point for a File, Group, or Channel
• Useful for storing data that doesn’t change over the life of the test
ni.com 8
Reading TDMS Data
• Reading from a TDMS file is done
using named Groups and Channels
• Column index doesn’t matter
• Less error prone then a text file
• Read subset of channel data
with Length, and Offset control
• Only read part of a file by
reading a single channel. Or a
subset of a single channel
ni.com 9
TDMS Excel Conversion
Demo TDMS to
XLSX conversion
ni.com 1
0
DataFinder Toolkit
• Toolkit included with Developer Suite for
indexing and searching for files (not just
TDMS)
– Deployment license cost
– Indexes directories caching the file,
group, and channel properties
– Queries can be made on the properties
of the data only, not the sampled
values
– Several useful demos in the Example
Finder
Demo DataFinder
• DIAdem uses this indexing technology for
data finding and report generation
ni.com 1
1
Other TDMS Tricks
• Combine TDMS Files (command line)
• copy /b File1.tdms + File2.tdms
Output.tdms
• This can be used to
reorder channels and groups
• DAQmx Logging
• DMA streaming from DAQ to hard disk
• Not much control but very fast NI has
claimed over 1.2 GB/s
• Signal.X Scout TDMS Viewer and Editor
• Freeware
• Heavily modified version of the
TDMS viewer found on the
ni.compalette. 1
2
More TDMS Tricks
• Write multiple channels, and/or multiple samples at once, to avoid calling the
Write TDMS function too often
• This can cause fragmented data, and takes up unnecessary space
• If you have an index file that is more than 10% of the TDMS file, then your
data is likely fragmented. Index files should be small, generally less than 1MB.
• Check for Fragmentation in the Example Finder can be used
Rearranging order in
TDMS files
ni.com 1
4
Reasons to Not Use TDMS
• TDMS should not be used to replace a database
• TDMS does not have advanced query options, and the DataFinder Toolkit
only queries properties not channel values.
• Queries like “Find all passing channels, where the data is between two
values” is something that can be done but is custom and likely less
efficient than a database.
• The best approach is to write properties for query results you expect you
may want.
• TDMS should not be used to replace a configuration file (.INI)
• Quick manipulation cannot be done using a simple text editor like notepad.
• TDMS is not human readable.
• Does the file need to be able to be edited by someone?
• Editing TDMS files can be done, with deleted added in 2015 but is
generally difficult.
ni.com 1
5
Before you go,
take the
survey.
Also checkout
Xnodes: Room 15
Wednesday 3:30
ni.com 1
6
ni.com 1
7