This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Log TDMS Measurements in a Real-Time Application

Updated Oct 25, 2022

Reported In

Software

  • LabVIEW Real-Time Module
  • LabVIEW

Operating System

  • NI Linux Real-Time
  • VxWorks
  • PharLap

Issue Details

I am using an NI Real-Time platform (CompactRIO, sbRIO, PXI RT, myRIO, etc) and I want to log the data that I acquire from it. My datalogging application should create and log to a TDMS file in the device's hard drive.

Solution

Datalogging applications differ from each other depending on the channels and speed at which they log data. Nevertheless, there are some common starting points from which you can start your application. Find below a list of resources you can refer to:

 

NameModule InterfaceDescriptionUseful Links
DAQmx DataloggingDAQmx*

DAQmx is supported in certain models of CompactRIO*, cDAQ, and PXI. Using DAQmx you can take advantage of the built-in DAQmx logging functions or create your own file handling loops.

 

*Please note that not all CompactRIO controllers support DAQmx. For more information consult: NI-DAQmx on the CompactRIO

Producer-Consumer applicationScan Interface

You can use a producer-consumer architecture to acquire the samples from the Scan Engine's Shared Variables and log them into your application. Your producer loop takes data out of the Scan Engine's Shared Variables and sends them to your consumer loop, which dequeues the data and logs them into the file. You can use a Queue, RT FIFO , or RT FIFO Shared Variable to do this.

DCAFScan Interface  

Using DCAF (Distributed Control and Automation Framework) you can have Shared Variables sending data to a TDMS file. This option also allows you to control the rotation of the measurement file, so you make sure the size of the files is adequate to your application.

FPGA Waveform TemplateFPGA

LabVIEW comes with a built-in template for FPGA Waveform Acquisition and Logging in a CompactRIO. Use this template as a starting architecture for your application.

FPGA Waveform LibraryFPGA

You can use the FPGA waveform Library to obtain the data out of the FPGA in a similar way to a DAQmx acquisition. You can take advantage of this library to combine an FPGA acquisition with a DAQmx style of data logging.

 

Additional Information

While there is not a single method to perform a data acquisition, the complexity of your architecture will depend on the size of your application and requirements you have for it. NI recommends starting from the templates and examples that ship with the software, which follow the best practices for application development, maintenance, and performance.