Prior to LabVIEW 8.6, CompactRIO I/O could only be accessed by programming the FPGA, then using the LabVIEW FPGA Interface VIs in LabVIEW Real-Time. CompactRIO Scan Mode was introduced in LabVIEW 8.6 to allow users to read/write data without needing to program their FPGA. This reduces development time and complexity for applications that do not require the power and loop rates of the on-board FPGA.
Figure 1. CompactRIO Scan Mode provides access to I/O directly from LabVIEW host VIs and LabVIEW Real-Time VIs without needing to program or compile FPGA code.
CompactRIO Scan Mode automatically detects the I/O modules in your CompactRIO chassis and adds them to the LabVIEW Project. You can then drag and drop the I/O variables onto your LabVIEW Real-Time and host VI block diagrams. These I/O variables allow you to instantly read and write scaled, calibrated I/O data without any FPGA programming or compiling. You can create aliases of I/O variables to provide an additional layer of abstraction from the physical I/O channel. Linear and square root scaling are available on I/O variables and aliases.
Figure 2. Access, I/O directly in LabVIEW Real-Time by dragging and dropping I/O variables to your block diagram.
The NI Scan Engine, a component of LabVIEW Real-Time, updates the I/O variable values at a rate you specify (up to 1 kHz1). All channel scans are hardware-timed with module-to-module synchronization. You can configure the scan engine from the LabVIEW Project or programmatically. The scan engine also provides a timed-loop timing source, so you can synchronize code with I/O updates for low-jitter control applications.
CompactRIO Scan Mode can also add counter, quadrature encoder, and pulse-width modulation (PWM) functionality to any existing eight-channel digital NI C Series Module without requiring any FPGA programming. You configure these specialty digital functions from the LabVIEW Project, but they run on the FPGA for accuracy and speed. Now, without compiling, you can perform up to 1 MHz edge counting, pulse-width and frequency measurements, quadrature decoding, and PWM control.
Counter functionality includes:
- 1 MHz counting on eight channels
- 32-bit register, with programmable terminal count
- Configurable terminal count and terminal count behavior
- Configurable count edge (rising, falling, or both), source, and gate
- Period, PWM, and frequency measurements with configurable timebase
Quadrature encoder functionality includes:
- 1 MHz max quad count rate
- 32-bit count register
- 32-bit velocity measurement register
- Configurable velocity measurement timebase (256 µs, 512 µs, ... 16384 µs, or 32768 µs)
- X4 encoding
- Two quad channels with A+B+Index inputs per module
- Selectable encoder polarity
- Eight output channels
- Per-channel duty-cycle and period configuration
- Configurable frequency period (1 Hz, 50 Hz, 250 Hz, 500 Hz, 1 kHz, 5 kHz, 10 kHz, or 20 kHz)
There are some performance trade-offs when using CompactRIO Scan Mode. For example, the specialty digital functionality supports up to 1 MHz counters versus the 20 MHz counters achievable with LabVIEW FPGA. The scan engine uses system resources, which include FPGA space, two DMA channels, memory, and an amount of CPU time that scales with the scan rate. The space consumed by the RSI, on the FPGA, scales with the number of modules using scan mode.