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.

Converting an NI-DAQmx VI Into a cRIO-904x LabVIEW Project

Updated Jul 27, 2023

Environment

Software

  • LabVIEW

Driver

  • NI-DAQmx

Other

  • cRIO-904x

This tutorial describes how to convert an existing NI-DAQmx shipping example into a LabVIEW project to be used with a cRIO-904x target. The shipping example we will be using is the Voltage - Continuous Input VI.

Software Installation Order

For this tutorial we have installed LabVIEW FPGA to be able to show the FPGA target in the LabVIEW FPGA project. We have also installed the compatible CompactRIO driver that provides support for the cRIO-904x and have left the default option of installing NI-DAQmx installed. See below for the installation order:

  1. LabVIEW 2017 SP1 or later
  2. LabVIEW Real-Time Module 2017 or later
  3. LabVIEW FPGA Module 2017 SP1 or later
  4. CompactRIO 17.6 or later

 

Finding an NI-DAQmx Shipping Example

Once a compatible version of NI-DAQmx is installed, the NI-DAQmx shipping examples will be installed on your system and you can locate them through the NI Example Finder.

  1. After you have launched LabVIEW click on Help>> Find Examples…  on the LabVIEW Getting Started toolbar. <image>
  2. The NI Example Finder will open in a new window. The Example Finder has hundreds of examples to help you get started with your application.  You can browse the examples by task, or use the search tool to find examples that have been tagged with your keywords.

    Remain on the default Browse tab and browse according to Task. Navigate to Hardware Input and Output>> DAQmx>> Analog Input. Select the "Voltage - Continuous Input.vi" to open the VI and view. Note there are many other NI-DAQmx examples available that can be leveraged to quickly create a new cRIO-904x DAQmx application.

    Note that there are some cRIO-904x shipping examples Hardware Input and Output>> CompactRIO>> Chassis Specific>> cRIO-904x that can be used as a guide.

 

Converting into a CompactRIO LabVIEW Project

Begin by creating a new project in LabVIEW, where you will manage your code and hardware resources.

  1. Create a new project in LabVIEW by selecting File » New Project
  2. To add your CompactRIO system to the project, right-click on the Project item at the top of the tree and select New » Targets and Devices…
  1. This dialog allows you to discover systems on your network or add offline systems. Expand the Real-Time CompactRIO folder, select your cRIO-904x system, and click OK. 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.

 
  1. To add the Voltage - Continuous Input.vi to the LabVIEW project, right-click the cRIO-904x target and select Add>> File... which will open the file explorer.
NI-DAQmx examples will install by default to and can be found here:
C:\Program Files (x86)\National Instruments\LabVIEW <xxxx>\examples\DAQmx
(on x32 OS the default file path will be C:\Program Files\National Instruments\LabVIEW <xxxx>\examples\DAQmx).
 

 
  1. Ensure that the modules configured to be used in the NI-DAQmx task of the Voltage - Continuous Input.vi are in Real-Time (NI-DAQmx) mode by moving them under the Real-Time Resources project item. Also ensure that any changes in programming mode are deployed to the target.
  1. Open the VI and configure your physical channel controls/ constants for the appropriate module and channels.
  2. Configure any other settings and run your VI.