This tutorial provides a walkthrough with steps to log data to disk with CompactRIO.
Begin by creating a new project in LabVIEW, where you will manage your code and hardware resources.
Note If your system is not listed, LabVIEW could not detect it on the network. Ensure that your system is properly configured with a valid IP address in Measurement & Automation Explorer. If your system is on a remote subnet, you can also select to manually enter the IP address.
Figure 2. Select a new CompactRIO system
CompactRIO systems have at least two user-selectable modes. Some models of the CompactRIO have an additional user-selectable mode to program in Real-Time NI-DAQmx. Please refer to this article to determine if your CompactRIO is capable of using Real-Time NI-DAQmx. After adding your target to the project, you will be prompted to select which programming mode you would like to use. Note: You can change the programming mode later if needed using the CompactRIO Chassis Properties dialog box. Real-Time (NI-DAQmx) Mode – CompactRIO with NI-DAQmx is the latest addition to the CompactRIO Controller family. It brings two software experiences into one by combining the ease of use of NI-DAQmx and the low-level functionality of LabVIEW FPGA. It also simplifies system architectures by bringing the latest in synchronization and control technologies to the CompactRIO platform. To program a C Series Module in this mode, place it under the Real-Time Resources folder in the LabVIEW project.Real-Time Scan (I/O Variable) Mode – this option allows you to program the real-time processor of your CompactRIO System, but not the FPGA. In this mode, NI provides a pre-defined personality for the FPGA that periodically scans the I/O and places it in a memory map, making it available to LabVIEW Real-Time. CompactRIO Real-Time Scan Mode is sufficient for applications that require single-point access to I/O at rates of a few hundred hertz. To program a C Series Module in this mode, place it under the Real-Time Scan Resources folder in the LabVIEW project. To learn more about scan mode, read the Understanding NI CompactRIO Scan Mode white paper and view the benchmarks.Note: NI recommends Real-Time (NI-DAQmx) Mode over Real-Time Scan (I/O Variable) Mode.LabVIEW FPGA Interface Mode – This option allows you to unlock the real power of CompactRIO by customizing the FPGA personality in addition to programming the real-time processor, achieving performance that would typically require custom hardware. Using LabVIEW FPGA, you can implement custom timing and triggering, off-load signal processing and analysis, create custom protocols, and access I/O at its maximum rate. To program a C Series Module in this mode, place it under the FPGA target in the LabVIEW project. LabVIEW will now attempt to detect the chassis and C Series I/O Modules present in your system and automatically add them to the LabVIEW Project. Note: If your system was not discovered and you choose to add it offline, you will need to add the chassis and C Series I/O manually. This document discusses this process for scan mode and FPGA mode.The figure below shows how each mode sends the I/O data through a unique path. For Real-Time (NI-DAQmx) mode, the data is read through the processor via NI-DAQmx VI’s. For Real-Time Scan (IO Variable) mode, the data is sent through the FPGA but is ultimately accessed on the processor by dragging and dropping IO Nodes to the Real-Time VI. For LabVIEW FPGA mode, the I/O is read directly from within the FPGA by dragging and dropping IO Nodes to the FPGA VI.
If you have LabVIEW Real-Time, LabVIEW FPGA, and NI-DAQmx on your development computer, you can select which programming model to use on a per-module basis by placing the module under the appropriate heading in the project. The programming mode is indicated by the text next to the module in the LabVIEW project. You can also select which programming model to use by selecting from the drop-down menu in Measurement and Automation Explorer (MAX).
This section is broken into three subsections that show you how to create a basic temperature logging application. Please select a section based on your desired programming mode and your CompactRIO controller. Please refer to the Select the Appropriate Programming Mode section if you are unsure which programming mode you desire. The sections are listed in the following order
I. Using NI-DAQmx API
The NI-DAQmx driver comes with a variety of example VIs to help users gain familiarity with the NI-DAQmx API. This section will instruct you on how to import a NI-DAQmx Example onto a CompactRIO target. We will be importing the Thermocouple - Continuous Input VI.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.