CVT Data Logger (CDL) Reference Library
The Current Value Table (CVT) is a set of LabVIEW VIs that developers use to store and retrieve data asynchronously from different parts of an application. Often, it is desirable to log a subset of these CVT values to a file. The CVT Data Logger (CDL) reference library was created to fulfill this purpose.
Table of Contents
- Purpose and Overview
- CVT Data Logger (CDL) Basic Example
- CVT Data Logger (CDL) Advanced Example
- Where to Go From Here
- Download the reference library installer and unzip it into an empty directory.
- Run the setup.exe located in the Volume folder.
- Restart LabVIEW if it is already running. A new palette will have been added to the Functions»User Libraries palette called CDL.
- Open the example named CDL Example_Basic VI located at
The CVT Data Logger reference library requires the following support software:
- LabVIEW 8.6 or later
- Current Value Table (CVT) reference library
Additional information on features, installation and licensing are available in the ReadMe file.
Purpose and Overview
The CVT Data Logger (CDL) reference library was created to provide easy logging of Current Value Table (CVT) values to disk and includes a basic API for configuring, monitoring and controlling this logging. Examples showing how to integrate the CDL reference library into larger applications are also provided.
The purpose of the CDL reference library is accomplished by the CDL CVT Data Logger VI. This VI reads a list of CVT tags at a specified rate and logs the resulting tag values to a TDMS file.
The TDMS file's internal structure contains one group for each of the four major CVT data types (Boolean, String, Integer, Double) to aid in data organization and data viewing. The CVT tag name is then used for the TDMS channel name. Therefore, logging a CVT tag named Sine that is a double data type results in an internal structure of Double»Sine. Please refer to TDMS File Format Internal Structure for more information on the internal structure of TDMS files.
As writing to disk can be time consuming and non-deterministic, the CDL CVT Data Logger VI allows the user to minimize the number of times the disk is accessed by caching scanned CVT values in memory until a certain number of scans are preformed. Once this number of scans is reached, the data is logged to disk.
The CDL CVT Data Logger has been set up as a re-entrant VI that is spawned through VI Server as an asynchronous background process to help meet a higher number of use cases. Multiple instantiations can be spawned at the same time while being independently configured and controlled. This provides multiple benefits, some of which are multi-rate logging and separate log files for different tag lists. The API discussed below configures, monitors and stops specific instantiations of the CDL CVT Data Logger.
CVT Data Logger (CDL) Core API
The CDL Start Data Logger VI is used to configure and start an instantiation of the CDL CVT Data Logger VI. It takes in multiple parameters such as File Path, Tag List, Loop Rate and Scans per Write and passed them to the new instantiation of the CDL CVT Data Logger VI. The CDL Start Data Logger VI outputs the VI Reference to the new instantiation of the CDL CVT Data Logger VI.
CDL Start Data Logger
The CDL Stop Data Logger VI stops an instantiation of the CDL CVT Data Logger. The instantiation stopped is determined by the CDL VI Reference parameter.
CDL Stop Data Logger
Note: If you want to create a new file without stopping your application, you can call the CDL Stop Data Logger VI to stop the current data logging session, change the file path and start a new logging sessions by calling the CDL Start Data Logger VI. The CDL Example_Advanced VI in the
labview\user.lib\cdl\examples folder illustrates this.
Rather than specifying the CVT Tag List as a constant or control, it is generally desirable to load a configuration from a file, such as the XML tag configuration file created when using the Tag Configuration Editor (TCE). The TCE allows the user to specify which tags are to be logged to disk and saves that information in the configuration file. The CDL Load Tag List VI parses the XML file produced by the TCE and returns the list of CVT tags to be logged.
CDL Load Tag List
Note: cRIO IO Engine (CIE) and CVT Client Communication (CCC) tags are included in the CVT Tag List returned by this VI.
CVT Data Logger (CDL) API Advanced Subpallete
The CDL Check Data Logger Status VI was created for reporting status information on a specific instantiation of the CDL CVT Data Logger VI. It gives error status, logging state, and buffer status. The instantiation checked is determined by the CDL VI Reference parameter.
CDL Check Data Logger Status
CVT Data Logger (CDL) Basic Example
The example named CDL Example_Basic VI is located at
labview\user.lib\cdl\examples and is designed to show the basic use of all the CDL API functions. The block diagram is pictured below.
[+] Enlarge Image
CDL Example_Basic VI Block Diagram
The configuration information for the Current Value Table (CVT) and CVT Data Logger (CDL) is loaded from the XML configuration file previously created by the Tag Configuration Editor (TCE). Once the file has been parsed, the CVT is initialized and a new instantiation of the CDL CVT Data Logger VI is configured and started. In the top while loop, the status of this new instantiation is being displayed to the user. In the bottom while loop, three CVT tags are continually updated with new data. These three CVT tags are the same tags that the CDL CVT Data Logger is configured to log. Once the user selects the stop button, the instantiation of the CDL CVT Data Logger VI is stopped and the TDMS file is opened for viewing. For more information, please review the documentation on the block diagram of this example.
CVT Data Logger (CDL) Advanced Example
The example named CDL Example_Advanced VI is located at
labview\user.lib\cdl\examples and is designed to show a more application level use of the CDL API functions. The block diagram is pictured below.
[+] Enlarge Image
CDL Example_Advanced VI Block Diagram
This example operates in much the same way as the example above but adds the key feature of file spanning. File spanning is simply closing the current log file and creating a new one after a certain condition is met. The condition used in this example is the elapsing of a set amount of time. In addition to file spanning, this example also implements some disc management features such as transferring previous log files to a new folder and deleting old files if the disk starts to fill up. For more information, please review the documentation on the block diagram of this example and its subVIs.
Where to Go From Here
The following is a map of other documents that describe the machine control reference architecture. You can click on the image to navigate directly to each document.
This reference application was created by the NI Systems Engineering group.
We do not regularly monitor Reader Comments posted on this page.
Please post your feedback in the CVT Data Logger (CDL) forum so that we can improve this reference library for future applications.
Please direct product support questions to NI Technical Support .
Application Software: LabVIEW Professional Development System 8.6.1
Reader Comments | Submit a comment »