NI Linux Real-Time FAQ (2024)

Question: Should I be concerned by the fact that Linux has a different file structure and file path notation when porting my LabVIEW Real-Time application over to a NI Linux Real-Time based target?
Answer: The vast majority of LabVIEW Real-Time code will function as-is between different operating systems despite any differences in file path notation or file system structure. The few differences worth noting are that:

    • NI Linux Real-Time relies on a UNIX style file paths as opposed to Windows style file paths. As a result, any file path datatypes in a NI Linux-Real Time programming context will be coerced to a proper UNIX style file path. For example a file path constant with “C:\” will be coerced to “/C”.
    • NI Linux Real-Time also has a different file structure. As a result, it is recommended that users put their files in the “home” directory for their specific user (by default, this is /home/lvuser). There is a small layer of redirection so that the impact to existing LabVIEW Real-Time code is minimal.
    • This layer of redirection as well as the UNIX still file path differences are documented in the “README_File_Paths.txt” file located under “/” on the target. For more information on this topic, please refer to Working with File Paths on Real-Time Targets

    Question: I used to rely on FTP to transfer files to and from my real-time target. I can’t seem to do that with NI Linux Real-Time based targets. How can I transfer files to and from my system?

    Answer: By default the Recommended Software Set (RSS) installed from MAX will not install an FTP server on NI Linux Real-Time targets. If you want to continue using an open, unsecured FTP server, you will have to install it manually from the custom install list. Refer to How Do I Use FTP with My NI Linux Real-Time Target? for details. This is meant to be a security benefit as it removes the security hole of an open FTP server formerly present on existing cRIO systems. Also note that both WebDAV and SSH are good file transfer alternatives (which can be secured). It’s also possible to do SFTP over SSH. For more details, please refer to Using WebDAV to transfer files to your RT target.

    Question: What distribution of Linux is shipping on NI hardware running NI Linux Real-Time?
    Answer: A Linux distribution is comprised of a unique set number of libraries and utilities shipped with the Linux kernel. As such, NI Linux Real-Time is the distribution is tailored for our user’s needs; it is built using the OpenEmbedded framework, has Real-Time patches applied, and has customizations for better hardware integration with NI real-time hardware targets.

    Question: What is the determinism of the Linux-RT operating system on a CompactRIO controller?
    Answer: The custom distribution of Linux that NI has created includes real-time patches to make the system deterministic. In NI’s testing, the upper bound of jitter with NI Linux Real-Time on CompactRIO targets is on the same order of magnitude as other CompactRIO systems which run a VxWorks RTOS.
    Beyond jitter, note that you will be able to see a substantial performance improvements in loop rates with the NI Linux Real-Time based cRIO-9068 over the cRIO-9024 and cRIO-9074 controllers and with the cRIO-903x controllers over the previous generation cRIO-9025. Additional benchmarking can be found at NI cRIO-9068: Performance and Throughput Benchmarks and NI CompactRIO Performance Controller: Performance and Throughput Benchmarks.

    Question: I’d like to make use of the Linux ecosystem and install additional software to my NI Linux Real-Time target. What support can I expect from NI?
    Answer: There are thousands of community sourced applications available through a variety of means for Linux-based operating systems. If a user is interested in leveraging this ecosystem there is an assumed minimum Linux proficiency required. Below are the guidelines we have in place for what NI will support for those looking to leverage the Linux ecosystem:

      1. NI will Support: Weensure that packages that are included and shipped in the base image on all our NI Linux RT Controllers function correctly.
      2. NI Will Not Support:
        1. User-mode libraries and applications. These are generally available as pre-built applications/libraries through a package manager which is installed on the CompactRIO, similar in concept to the Apple App Store. This package manager, called opkg, will point by default to a certain store, or repository, of pre-built applications/libraries. Since these applications are community sourced we cannot guarantee the quality of application. NI will not support the actual installation, configuration, or use of 3rd party tools from the Linux ecosystem – there are far too many tools to be able to feasibly provide such support. Applications/libraries are also available outside of the package manager, however, these one off packages have to be manually transferred and installed on the target with appropriate dependencies introducing further complexity for our users.Once the applications/libraries are installed on the CompactRIO, they can be accessed from within LabVIEW in various ways. NI can help ensure that the NI software stack (for example, LabVIEW Real-Time) behaves properly – the solution may involve having to use a different tool from the Linux ecosystem if it so happens that a given tool/application/package is ultimately the culprit in compromising the NI software stack.
        2. NI will provide the source code for the NI Linux Real-Time kernel, but does not officially support modifications to the kernel. An example of a kernel modification is the addition of a kernel module. Users are free to make changes to the kernel, but will need to have the requisite skill and will need to self-diagnose and resolve any issues. Note that changes to the kernel configuration or source code risks affecting the jitter and determinism of the system and may also prevent NI drivers, including NI-RIO, from loading properly.

    Question: If, for whatever reason, the NI Linux Real-Time operating system becomes corrupt or otherwise fails, can it be reinstalled?

    Answer: If NI Linux Real-Time fails to boot or becomes corrupt in any other way in the normal operating mode (run mode), the system can be reformatted and reinstalled in about 5 minutes from MAX. In order to do this we have a completely separate Linux image called 'safe mode' that we automatically boot to if run mode is corrupted. We also use safe mode when MAX installs software to the target.

    Question: How doI factory reset my target?

    Answer: To reset all settings to factory default, for example in the case of a lost administrator password, please contact our Applications Engineering department for assistance. You will need physical access to the controller. To change passwords and manage user accounts, read How Do I Manage User Accounts on NI Linux Real-Time Devices?

    Question: What is the file system used as part of Linux-RT? Is it reliable?
    Answer: NI's R&D staff investigated the different options for providing a robust file system and selected the Unsorted Block Image File System (UBIFS). To prove out this file system NI R&D has conducted stress testing, including testing on power loss corruption. UBIFS has undergone and passed the same rigorous testing that the robust filesystems on our VxWorks based targets did. On the CompactRIO-9068, the file system is on a NAND Flash device. Additionally, the Intel x86_x64 architecture-based targets use the ext4 journaling file system.

    Question: Are there different thread priorities available from LabVIEW on NI Linux Real-Time targets compared to VxWorks or Phar Lap targets?
    Answer: The differences in the priority scheme and scheduling on NI Linux Real-Time should have little impact on your existing real-time application. While there are changes to the scheduler between LinuxRT and VxWorks, moving from VxWorks based targets shouldn't cause any noticeable difference in the scheduling/thread prioritization.
    Timed structure priorities and LV priorities work the same as before, except that any "normal" priority tasks (ex: normal priority VIs) are not handled with the real-time scheduler but are instead scheduled with Linux's default Completely Fair Scheduler (which should do a better job of scheduling normal priority work between LV and other non-LV threads).

    Question: Will NI offer a tool for NI Linux Real-Time that is equivalent to the DLL checker for Pharlap?
    Answer: First, it’s important to note that Linux systems do not and cannot use DLLs, and instead rely on “shared objects”, which have a “.so” extension. As Linux is an operating system built with open source principles, there already exist a number of tools such as ‘ldd’ which can help determine whether a given “.so” file will properly work on a Linux based system. NI currently has no plans to provide such a tool for NI Linux Real-Time given the tools that already exist.

    Question: For the Xilinx Zynq SOC based targets, will there be any differences in the experience now that the RT Processor and FPGA share the same fabric?
    Answer: Yes. For Zynq based products, when the real-time processor reboots, it will also reset the FPGA. Unlike previous generations of CompactRIO and Single-Board RIO, customers should be aware the the FPGA I/O will not be controlled on reboots. Additionally, when loading a new FPGA bitfile, a few of the peripherals will be interrupted as they are either instantiated or routed through the FPGA. This applies specifically to the second gigabit Ethernet port and to the serial ports.

    Question: Is it possible to run the NI Linux Real-Time distribution (Operating System) on 3rd party hardware such as Raspberry Pi, BeagleBone Black, etc.? Does NI support this?
    Answer: We created the NI Linux RT distribution to support National Instruments hardware, so while you can run it on other boards, it's probably a lot easier to use a Linux distribution meant for your board/consider applying the -rt patch https://rt.wiki.kernel.org/index.php/Main_Page to Linux yourself in order to run a real-time Linux distribution on 3rd party hardware. If you want to run NI Linux RT anyway, it's not supported through NI technical support but it is indeed possible to port our Linux distirbution to third party hardware, in fact, you can get our source from https://github.com/ni.You'll need to make whatever changes are appropriate for your board's processor architecture, peripheral set, and so on. Note that the LINX toolkit discussed below, does NOT run the NI Linux Real-Time distribution, instead it runs on the recomended, debian-based distributions for the BeagleBone Black and Raspberry Pi platforms.

    Question:Can I run NI software like LabVIEW Real-Time (proprietary, licensed product) on an "original" Raspberry Pi?

    Answer:No, because the Raspberry Pi uses an ARM with a different instruction set architecture than the one used on NI's current ARM boards (armv6 vs. armv7-a). See this document and next Question/Answer.

    Question:Can I run NI software like LabVIEW Real-Time (proprietary, licensed product) on other third-party hardware with a compatible architecture (an armv7-a device like BeagleBone Black, Raspberry Pi 2, x64 desktop PC, VM, etc.)?

    Answer:Through the LINX Toolkit you can deploy LabVIEW VIs to a BeagleBone Black or Raspberry Pi 2/3 for non-commercial use.The LINX toolkit is intended to be used by makers, hobbyists and students.We are not planning to commercially support LabVIEW Real-Time on third-party hardware running NI Linux Real-Time at this time. You must purchase a LabVIEW Real-Time deployment license for every non-NI hardware target. Please contact deborah.burke@ni.com or your local NI field engineer if you decide to move forward porting to such hardware.

    Question: What’s the preferred cross-compile toolchain for building C/C++ applications for NI Linux Real-Time targets?
    Answer: We provide gcc toolchains that are tailored to NI Linux Real-Time targets. See this document for more information: Building C/C++ Applications for NI Linux Real-Time

    Question: How can I add other software from the Linux community to my NI Linux Real-Time target?

    Answer: You can use the opkg package manager to find and install other software to your NI Linux Real-Time target. You will need access to the internet for this to work.

    For targets using the 2013 distribution only: Using opkg first requires enabling one or more Linux repositories. This can be done by editing all of the “.conf” files found at /etc/opkg and eliminating the leading “#” and space preceding the URL found in each of the “.conf” files. This process is documented in the first steps of the Tutorial: PostgreSQL with LabVIEW on the NI Linux Real-Time community.

    You may find that when installing some software that you may get an error about the version of a dependency. Most commonly, you are likely to run into this error with the version of the libc package. There are two ways to address this problem. One is to force the new software package to use the version of libc6 that is available on NI Linux Real-Time. The other is to remove the flag on the libc6 package and allow it to be upgraded with the installation of the new software package. In either case you could end up with software validated against one version of libc6 using a different version. This is normally fine, but NI does not extensively test this configuration.

    Question: How do I get Python installed on the a NI Linux Real-Time target?

    Answer: This is an example of using the opkg package manager referenced above. In this case you would do:

    opkg update

    opkg install python

    Question: How do I get GCC and other components of the GNU toolchain on my target?

    Answer: The following is a compilation of the information within this thread: https://decibel.ni.com/content/message/65378

    Note: you will need internet access for this process to work correctly, as opkg (the package manager within the Linux install on these targets) downloads the packages from an external site.

    1. Enable SSH access to your target within MAX or WIF.
    2. SSH into the target.
    3. Type the following commands one after each other (allowing the previous command to complete):

    [2013 only] opkg flag ok libc6

    [2013 only] opkg upgrade libc6

    opkg install gcc gcc-symlinks

    opkg install cpp cpp-symlinks

    opkg install libc6-dev

    opkg install binutils-symlinks

    opkg install make

    These packages and other common tools like Perl are also part of larger "packagegroups" that you can use as a convenient shortcut instead on recent versions of NI Linux RT, for example:

    opkg install packagegroup-core-buildessential

    Question: Where is the USB drive mounted when I plug it into my NI Linux Real-Time target?

    Answer: The OS automaticly mounts any USB drive that is formatted for FAT32 (usually the default file system type, although not nessisarily) to /media/sda1. If the USB drive has more than one partition they will be mounted in /media/sda1, then /media/sda2, and so on. For compatibility with older NI targets it is also accessible at /u (then /v, etc.).

    Executing umount /media/sda1 will cause all cached data to be written to it and unmount it. If you only want to flush the cache and not unmount the drive, you can execute the sync command.

    Question: What feed URL should I use for `opkg`?

    Answer:The general location is: http://download.ni.com/ni-linux-rt/feeds/, and then you select the version and architecture for your application. For example, on the cRIO-9068 for LabVIEW 2014, you should use:

    As an expert with demonstrable knowledge in the field of LabVIEW Real-Time applications on NI Linux Real-Time targets, I can confidently provide insights into the concepts mentioned in the article.

    Concepts Explained in the Article:

    1. File Path Notation and Structure:

      • NI Linux Real-Time uses UNIX-style file paths, whereas LabVIEW Real-Time on Windows uses Windows-style paths.
      • File path datatypes are coerced to proper UNIX-style paths (e.g., "C:\" becomes "/C").
      • The file structure on NI Linux Real-Time is different, and it's recommended to place files in the "home" directory (/home/lvuser).
    2. FTP and File Transfer:

      • NI Linux Real-Time doesn't install an FTP server by default for security reasons.
      • Users can manually install an open FTP server or use alternatives like WebDAV and SSH for secure file transfers.
      • SFTP over SSH is also a viable option.
    3. Linux Distribution on NI Hardware:

      • NI Linux Real-Time is a customized Linux distribution built using the OpenEmbedded framework.
      • It includes Real-Time patches and customizations for better hardware integration with NI real-time hardware targets.
    4. Determinism of Linux-RT on CompactRIO:

      • The custom Linux distribution includes real-time patches to ensure determinism.
      • Performance improvements are noted in loop rates compared to previous CompactRIO controllers.
    5. Linux Ecosystem and Additional Software:

      • NI supports packages included in the base image on NI Linux RT Controllers.
      • Users can leverage the Linux ecosystem but need Linux proficiency.
      • NI doesn't support user-mode libraries and applications from the Linux ecosystem.
    6. Reinstallation and Resetting:

      • NI Linux Real-Time can be reinstalled if it fails to boot or becomes corrupt.
      • A "safe mode" is automatically booted for reinstallation, taking about 5 minutes.
    7. File System (UBIFS) and Thread Priorities:

      • NI uses the Unsorted Block Image File System (UBIFS) for reliability.
      • Thread priorities in LabVIEW on NI Linux Real-Time have little impact on existing real-time applications.
    8. Third-Party Hardware and Software Support:

      • NI Linux RT is designed for NI hardware, but it's possible to run it on third-party hardware with modifications.
      • NI does not commercially support LabVIEW Real-Time on third-party hardware; LINX Toolkit is for non-commercial use.
    9. Cross-Compile Toolchain and Building Applications:

      • NI provides gcc toolchains tailored to NI Linux Real-Time targets for building C/C++ applications.
    10. Adding Software from the Linux Community:

      • Users can use the opkg package manager to find and install software on NI Linux Real-Time targets.
    11. USB Drive Mounting:

      • USB drives formatted as FAT32 are automatically mounted to /media/sda1 or accessible at /u for compatibility.
    12. Feed URL for opkg:

      • The feed URL for opkg package manager is based on version and architecture.

    These concepts collectively provide a comprehensive understanding of the considerations and procedures involved in porting LabVIEW Real-Time applications to NI Linux Real-Time targets.

    NI Linux Real-Time FAQ (2024)
    Top Articles
    Latest Posts
    Article information

    Author: Pres. Carey Rath

    Last Updated:

    Views: 5907

    Rating: 4 / 5 (61 voted)

    Reviews: 84% of readers found this page helpful

    Author information

    Name: Pres. Carey Rath

    Birthday: 1997-03-06

    Address: 14955 Ledner Trail, East Rodrickfort, NE 85127-8369

    Phone: +18682428114917

    Job: National Technology Representative

    Hobby: Sand art, Drama, Web surfing, Cycling, Brazilian jiu-jitsu, Leather crafting, Creative writing

    Introduction: My name is Pres. Carey Rath, I am a faithful, funny, vast, joyous, lively, brave, glamorous person who loves writing and wants to share my knowledge and understanding with you.