Building a Real-Time System With NI Hardware and Software




To build an NI real-time system, you must choose both your development software and hardware platform. Detailed information on the options for each is provided in the following sections. Before reading this paper, it is useful to have a basic understanding of real-time systems and how building one can benefit your projects. Review this information by reading Do I Need a Real-Time System?

When building a real-time system, you must select a real-time-capable OS. NI real-time development tools come packaged with all necessary real-time OS (RTOS) software, meaning that you do not need to choose this component separately. Depending on the hardware platform, NI  uses the NI Linux Real-Time OS or Phar Lap ETS OSs. 

Choose a Development Environment

To develop real-time programs, you can use either LabVIEW graphical programming, the LabWindows™/CVI ANSI C environment (for Phar Lap), or a Linux-Compatible C/C++ Development environment of your choice (for NI Linux Real-Time).

Development Option: LabVIEW Real-Time Graphical Programming

Figure 1. Graphical Programming using LabVIEW.

To program NI-supported real-time hardware graphically, you must use LabVIEW along with the LabVIEW Real-Time Module. LabVIEW Real-Time gives you the ability to create reliable, hard real-time applications, download them to hardware, and debug and run them using one tool.

You can use most of the built-in math and signal processing algorithms that come with LabVIEW in your real-time applications, including several proportional integral derivative (PID) control functions. In addition, you can run textual math scripts on your real-time system with the optional LabVIEW MathScript RT Module, or integrate models that you create in The MathWorks, Inc. Simulink ® software or other modeling environments using the optional LabVIEW Model Interface Toolkit.

LabVIEW Real-Time: Developing, Downloading, and Running Applications

When developing real-time applications in LabVIEW, you use the LabVIEW Project Explorer to organize your programs (VIs) and assign the hardware that they will run on. You will develop your code on a general-purpose Windows host computer, and then deploy to your real-time hardware over Ethernet or USB connection.


Figure 2. Manage LabVIEW programs (VIs) and assign them to real-time targets using the LabVIEW Project Explorer.

Developing real-time programs in LabVIEW is nearly identical to developing standard LabVIEW applications for your PC. Several additional functions specific to real-time systems are included in the Real-Time VIs palette, including:

  • Utilities to configure load balancing on systems with multiple CPU cores

To test your LabVIEW Real-Time code on your hardware, simply click the run arrow and your application will deploy to your real-time hardware and begin running. You can use standard NI debugging tools such as highlight execution, single stepping, and breakpoints from your development computer, even though your real-time program is actually running on the real-time target.



The dataflow programming model of LabVIEW frees you from the sequential architecture of text-based programming languages. Because the execution order is determined by the flow of data between nodes, you can easily create applications that execute multiple operations in parallel. Additionally, LabVIEW makes it easy to assign thread priorities with the Timed Loop structure. As shown below, each loop has a configurable timing source, period, priority, and more.

Figure 3. Specify the priority and processor assignment of different code sections using the LabVIEW Timed Loop structure. 



Troubleshooting Option: Debugging With the Real-Time Trace Viewer


Development Options for C and C++

If your organization standardizes on C or C++, you can use the LabWindows/CVI development environment, Eclipse, or other development environments. Note that LabWindows/CVI Real-Time supports only the real-time PXI controllers, while targets that use NI Linux Real-time, such as CompactRIO Controllers, are open source, so you can use the development tools of your choice. C/C++ Development Tools for Linux-Real Time in Eclipse are available for download from the NI website.

Select an NI Hardware Platform and I/O Modules

All NI real-time hardware platforms are based on a common architecture, which means that programs that you write with LabVIEW Real-Time will work across different NI hardware with only minor modifications, or without modifications. Specifically, each hardware platform features off-the-shelf computing components including a processor, RAM, nonvolatile storage, and an I/O bus interface. Some hardware platforms feature a user-programmable FPGA that you can program using the LabVIEW FPGA Module.

PXI (PCI Extensions for Instrumentation)


If you have an existing PXI controller running Windows that you would like to change to a real-time controller, you can purchase a LabVIEW Real-Time Deployment License to convert your controller, or even set up a dual-boot system.


Figure 4. PXI hardware provides a rugged, high-performance option for your real-time projects.



CompactRIO combines a real-time processor, an FPGA, and C Series I/O modules, and comes in both packed and board-level form factors. In addition, serial, USB, and Ethernet ports are built into the controller.

You can assemble your own CompactRIO system including controller, I/O modules, and software using the online CompactRIO Advisor.


Figure 5. Packaged CompactRIO controllers provide a flexible, rugged, and portable option for real-time applications.

You can program the processor on CompactRIO controllers using LabVIEW Real-Time or your C/C++ development tool of choice. You can also develop FPGA code using LabVIEW FPGA. To access IO data on the processor, you can use the NI-DAQmx API, NI's best-in-class programming API for measurements, or NI Scan Engine. Alternative, you can access data directly from the FPGA with LabVIEW FPGA. 


Figure 6. CompactRIO's heterogeneous architecture features a real-time processor, reconfigurable FPGA, and I/O.

CompactRIO hardware is often used for industrial applications including condition monitoring, hardware-in-the-loop test, physical systems test, and machine control.

CompactRIO board-level controllers, such as CompactRIO Single-Board Controllers (sbRIO) and NI System on Module (SOM), have the same architecture as packaged CompactRIO controllers, but come without rugged packaging, and have a smaller form factor.

Figure 7. CompactRIO board-level controllers feature the same architecture as packaged CompactRIO controllers, but in a smaller form factor.

High-volume applications that require flexibility, reliability, and high performance can benefit from CompactRIO Single-Board Controllers or System On Modules.


Industrial Controller

NI Industrial Controllers are high-performance, fanless industrial computers that offer the highest level of processing power and connectivity for automated image processing, data acquisition, and control applications in extreme environments. These controllers feature up to a 2.2 GHz Intel Core i7 dual-core processor, 8 GB DDR3 RAM, 64 GB storage in a rugged design with no moving parts, and an IP rating up to IP67. A Kintex-7 FPGA improves system performance by providing custom I/O timing, synchronization, control, and image co-processing.

Figure 8. Industrial controllers feature high processing power and connectivity ideal for vision systems.

NI Industrial Controllers give you the ideal connectivity for communication and synchronization to Time Sensitive Networking (TSN)-enabled CompactDAQ chassis, EtherCAT and Ethernet CompactRIO chassis, EtherCAT motion drives, GigE Vision and USB3 Vision cameras, and other automation equipment. In addition, this controller has onboard ISO, TTL, and differential digital I/O, so it can perform synchronization and control tasks without additional tethered I/O.


Discussion and Feedback

Please direct support questions to NI Technical Support.

See contact us for additional resources.
