Example Code

Programmatic Discovery, Configuration, and Access of CompactRIO Scan Mode I/O in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.


  • LabVIEW Real-Time Module
  • LabVIEW

Code and Documents




This example demonstrates how to programmatically discover, configure and access NI 9211 module in Compact RIO Scan Mode.



This application is an example of programmatically discovering, configuring, and accessing CompactRIO Scan Mode I/O in LabVIEW.  The LabVIEW Real-Time Module starting at version 2009 and NI-RIO 3.2 increase the flexibility of CompactRIO Scan Mode, giving you the ability to programmatically discover, configure, and access I/O in a deployed system. Using the new programmatic I/O API, applications can be developed to handle the presence of any combination of supported C Series I/O Modules. For example, a single CompactRIO system could be used as simple temperature data logger when thermocouple input modules are present or as a closed-loop motor controller when PWM output and quadrature encoder input capable digital I/O modules are present, without deploying new settings from a development machine.

This example shows how to use programmatic Scan Mode API to discover, configure and access inputs of a NI 9211 thermocouple module. It can easily be modified to support other modules as well (especially other thermocouple modules).

Find more detailed information about NI Scan Engine Advanced I/O Access.



  • LabVIEW Full or Professional Development System 2012 (or compatible)
  • LabVIEW Real-Time Module 2012 (or compatible)


  • Compact RIO (e.g. 9074 or compatible) and NI 9211 thermocouple module (or compatible)


Steps to Implement or Execute Code

  1. Download and extract the attached file "Discover and configure NI 9211 LV2012 NIVerified.zip"
  2. Follow the instructions in Front Panel and Block Diagram of "[Main] Discover and configure NI 9211 LV2012 NIVerified.vi" and run the program


Additional Information or References


Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.