LabVIEW Data Logging and Storage (V)—TDMS Files

Publisher:CrystalSparkleLatest update time:2015-08-04 Source: vihomeKeywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
TDMS (Technical Data Management Streaming) files are a type of binary record file that NI mainly promotes. They combine multiple advantages such as high speed, easy access, and convenience. They can interact seamlessly between various data analysis or mining software of NI, and can also provide a series of API functions for other applications to call.
The logical structure of TDMS is divided into three layers: file, channel group, and channel, as shown in Figure 25. Specific properties can be attached to each layer. Programmers can use these three logical layers to define test data very conveniently, and can also retrieve data at any logical layer, which makes data retrieval orderly and convenient to access. http://zone.ni.com/devzone/cda/tut/p/id/5696 .

LabVIEW Data Logging and Storage (V)—TDMS Files - statemice - Change, We Need!

  • ToC Bitmask: This is a 32-bit integer data segment, which indicates whether the segment contains meta data or raw data.
  • Version number: Indicates the version of the segment, which ensures compatibility with some older TDMS file versions.
  • Next segment offset: indicates the offset byte of the next segment.
  • Raw data offset: indicates the offset byte of Raw data.
  • Meta Data: Three levels of attribute storage fields.
  • Raw data: The actual raw data storage field.
This physical structure determines the random access characteristics of the TDMS file. When the programmer only wants to read the raw data and does not care about the attributes, the raw data offset can be used to directly obtain the raw data information without paying attention to the Meta Data information. As mentioned earlier, when adding information to TDMS, a new segment is actually added. Therefore, there is no need to care about the content before the segment, which ensures that the speed of writing the TDMS file has nothing to do with the size of the TDMS file, ensuring high-speed access. It is worth noting that the segments in the TDMS physical structure have nothing to do with its three-level logical structure. It is possible that a channel corresponds to multiple segments, or that a segment contains multiple channels. When data is written to the hard disk, a segment is generated, and when data is read from the hard disk, the content of each segment is read out. Figure 25 Physical structure of TDMS file The TDMS file format can be used in LabVIEW, LabWindows/CVI, Signal Express, and DIAdem, and can also be called in Excel or Matlab. In LabVIEW, the TDMS file operation functions are in Programming>>File I/O>>TDM Streaming palette, as shown in Figure 25. Its usage is relatively simple, and only a brief explanation is given here. For specific examples, please refer to the Examples that come with LabVIEW.

LabVIEW Data Logging and Storage (V)—TDMS Files - statemice - Change, We Need!


  • TDMS Open/Write/Read/Close: Similar to the functions of text files and binary files, programmers only need to remember the three-level logical structure of TDMS files.
  • TDMS List Contents: Lists the names of the Groups and Channels in the TDMS file, or lists the names of the Channels contained in the specified Group.
  • TDMS Set Properties: Set the properties of a TDMS file, channel group, or channel.
  • TDMS Get Properties: Gets the properties of a TDMS file, channel group, or channel.
  • TDMS Flush: Refreshes the data of all TDMS files in memory, that is, immediately writes all TDMS data to the hard disk (creates new segments).
  • TDMS Defragment: Defragments the storage in the TDMS file. When the TDMS file is large, this function can improve the performance of data access.
  • TDMS Create Scaling Information: Creates scaling information for data in TDMS. When the collected raw data needs to use linear, polynomial, or various sensor conversion relationships such as y=ax+b, this function can be used to directly change the data values ​​of certain channels in the TDMS file (the change is irreversible and the scaling information cannot be deleted).
  • TDMS File Viewer: This VI can list the properties and data in a TDMS file in a tree format, making it easy for users to view.

LabVIEW Data Logging and Storage (V)—TDMS Files - statemice - Change, We Need!
Figure 25 TDMS function palette
After writing the TDMS file, LabVIEW will automatically generate two files: *.tdms file and *.tdms_index file. The former is the data file (or master file), and the latter is the index file (or header file). The biggest difference between the two is that the index file does not contain raw data information, but only contains information such as properties, which can increase the speed of data retrieval and facilitate the search of TDMS files. This file is automatically generated and does not require programmer intervention.
LabVIEW 2009 further improves the support for the TDMS format, upgrading from version 1.0 to version 2.0, and improves the support for high-speed streaming applications and DAQmx application support, which is at least 4 times faster than the previous version of TDMS files. Of course, TDMS also has some disadvantages. For example, the speed is not as fast as the win32 streaming API, it does not support deleting a channel or channel group, and it only supports Windows operating system and real-time platforms such as VxWorks and Phar Lap. In general, the TDMS file format takes into account multiple factors such as speed, logical organization, and ease of use, and is a very good choice for data storage.
Keywords:LabVIEW Reference address:LabVIEW Data Logging and Storage (V)—TDMS Files

Previous article:Reading and Writing UTF-8 Encoded Text Files in LabVIEW
Next article:LabVIEW Data Logging and Storage (IV)—XML Files

Recommended ReadingLatest update time:2024-11-15 10:16

Design and implementation of wireless automatic measurement and control system based on LabVIEW
In order to solve the problem of difficult explosion pressure measurement at the ammunition explosion site, a wireless automatic measurement and control system was designed using LabVIEW as a tool. It mainly consists of three parts: sensor network nodes, wireless relay station AP and host computer. The measurement and
[Test Measurement]
Design and implementation of wireless automatic measurement and control system based on LabVIEW
CNC machine tool network measurement and control system based on LabVIEW--Research on key network communication technologies 2
4.2.3 Shared variable method Shared variables are another big step taken by LabVIEW to simplify network programming. Through shared variables, users can easily share data between different computers without programming. Users can easily exchange data without understanding any underlying complex network communications.
[Test Measurement]
CNC machine tool network measurement and control system based on LabVIEW--Research on key network communication technologies 2
Common Errors in LabVIEW Code
When you find a problem with a program and then go back to debug, it will inevitably take a lot of time to find the program error. To improve development efficiency, it is best to avoid some common low-level errors when writing code, which can save a lot of debugging time. Some programming errors are almost encounter
[Test Measurement]
Common shortcut keys in LabVIEW
Ctrl+N: Open VI Ctrl+E: Switch between front panel and block diagram Ctrl+/: Maximize the window Ctrl+T: Distribute the front panel and block diagram up and down/left and right Ctrl+H: Show context help Ctrl+B: Clear broken lines Ctrl+I: Open VI properties Ctrl+R: Run VI Ctrl+>: Stop running VI Ctrl+Shift+Spac
[Test Measurement]
Interactive Application of Arduino and LabVIEW
This article will introduce how to use the proteus simulation environment to realize serial communication between Arduino UNO and LabVIEW. LabVIEW controls the LED light of Arduino UNO through the RS-232 serial port to turn the LED light on and off. 1. Arduino UNO In the proteus simulation environment, the ATmega328
[Test Measurement]
How should I start learning LabVIEW?
   Step 1: First read NI's introductory materials to understand the concept of virtual instruments, the application areas of LabVIEW, programming features, etc.    Step 2: Follow the instructions in LabVIEW Getting Started. (Click New to LabVIEW Getting Started with LabVIEW on the right side of the LabVIEW start scree
[Test Measurement]
Labview implements pulse wave modulation (PAM)
Pulse Amplitude Modulation Generate a sine signal and get its amplitude input to the amplitude of a square wave signal This is equivalent to multiplying a square wave signal and a sine signal By observing its frequency, the resulting PAM signal can be found to have many more peaks than the original cosine signal Us
[Test Measurement]
Labview implements pulse wave modulation (PAM)
Design of Temperature Relay Test System Based on LabVIEW
The temperature relay is a temperature-sensitive component, and its output state is completely determined by the required control temperature. The key process of the temperature relay is the detection of temperature characteristics (operating temperature when heating and recovery temperature when cooling). At present,
[Test Measurement]
Design of Temperature Relay Test System Based on LabVIEW
Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号