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.
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:
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
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.
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.
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.
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.
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.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.