Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Jul 1, 2008


Feedback


Yes No

Related Links - Developer Zone

Capturing NI-DAQmx Configuration into TDM Files

1 ratings | 4.00 out of 5
Print

Overview

LabVIEW offers a wide variety of ways to easily record measurements. The advent of the TDM technology made it easy to add an extremely large amount of meta-information to measurements and keep your data portable to other applications without extra overhead programming. Maybe the most obvious meta-information to be recorded with the data is the NI-DAQmx information. This document offers a simple way to bundle and record the NI-DAQmx information into a TDM file.

Background – Overview of the TDM Data Model

The TDM file format specifies that descriptive information – comments, units, and channel names – is saved in a header file with the extension TDM, while the bulk measurement, simulation, and analysis results are saved in a binary data file with the extension TDX. The TDM and TDX files are linked through internal references automatically generated.

TDM files manage and structure all the descriptive information contained in the TDM header file using XML technology. Each TDM file contains descriptive information on three different levels – root, group, and channel – as shown below.


Figure 1. Each TDM file, written in NI LabVIEW, contains descriptive information on the root, group, and channel levels.


One TDM root object, also referred to as a file, can contain several groups, and each group can contain several channels. You can work with the TDM data model-defined set of properties at each of the three levels or insert your own custom properties.

The descriptive information located in the TDM header file provides an easy way to document the data without having to design your own header structure. As your saved-information requirements increase, you do not have to redesign your application; you simply extend the TDM data model to meet your specific needs.

DAQmx Information – Channel and Task Properties


NI-DAQmx Property Nodes provide access to all of the properties associated with a data acquisition operation. The current values of these properties can be read from the NI-DAQmx Property Nodes. For example, the following LabVIEW NI-DAQmx Timing Property Node sets the source of the sample clock. Then, the source of the sample clock is read. Finally, the active edge of the sample clock is set.


Figure 2. NI-DAQmx Property to Determine If a Device Is Simulated


This application note provides example code that bundles a considerable amount of NI-DAQmx information and makes it available to use.


Figure 3. Query General NI-DAQmx Information of a Task


The example VI queries information of any particular NI-DAQmx Analog Input task. The example code creates a cluster and populates it with information such as Channel name, Description, Unit, Scaling offset, etc. The information present in the cluster is structured accordingly to the relevance of the properties. The properties always present are part of the cluster itself. All other properties are included to a vector.


[+] Enlarge Image
Figure 4. Cluster with NI-DAQmx Information

Storage of NI-DAQmx Information in TDM files

In addition to the general expected functionality of other file I/O functions in LabVIEW (open file, write data, close file) the storage VIs also give the user the ability to add properties to the file itself, to the channel groups and to the channels. This application note combines the advantages of two new technologies. First, NI-DAQmx saves development time and improves the performance of data acquisition applications. Second, the storage VIs simplify the development of data storage and data retrieval as well as improve the flexibility of the data structure.
With the ability to easily add meta-information to data measurements combined with the ability to effortlessly get NI-DAQmx information, even basic users can develop sophisticated data storage systems. As a result with help of VIs present in the downloadable package, you can query general NI-DAQmx information and write it as channel properties of TDM files.
This is how your program could look:


[+] Enlarge Image
Figure 5. Store measurement data and NI-DAQmx configuration data to TDM file.


This example automatically queries specific NI-DAQmx properties based on the type of the task and writes them to the referent channels. Once this data is recorded, it become available to other applications that support TDM files, such as DIAdem, LabWindows CVI, etc.


Figure 6. Measurement data contains NI-DAQmx configuration data.

Summary


NI-DAQmx already saves development time and improves performance of data acquisition applications. The association of NI-DAQmx with TDM technology not only increases the productivity of developers but also gives data users the ability to better understand and manage measurement data.

Download

See Also:
Download application


1 ratings | 4.00 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).