Generating Models from The MathWorks, Inc. Simulink® Software for Deployment on NI Linux Real-Time Systems

Updated Nov 1, 2023

Environment

Hardware

  • CompactRIO Chassis
  • PXI Controller

Software

  • VeriStand
  • MATLAB
  • Simulink

Operating System

  • LabVIEW Real-Time (NI Linux Real-Time)

This article describes how to use the NI VeriStand Model Framework to compile Simulink models for use in VeriStand with NI Linux Real-Time hardware such PXIe and cRIO hardware. 

With the introduction of VeriStand 2021 there are now 2 workflows for compiling Simulink® models for use in VeriStand, the VeriStand Model Generation Support MATLAB Add-On and the VeriStand Model Framework.

This article talks about how to use the Model Framework to compile Simulink models for use in VeriStand.
If you are instead using the VeriStand Model Generation Support MATLAB Add-On then see this article instead: Creating Simulation Models Using VeriStand Model Generation Support Add-On

Some differences between the 2 workflows are described in the VeriStand manual: Using Models from Simulink.
Some key differences are that VeriStand Model Generation Support MATLAB Add-On supports virtual and non-virtual bus datatypes, officially supports Simulink modules such as Simscape® and supports the latest version of MATLAB.

Before following these configuration steps, make sure you have installed versions of MATLAB®, Simulink, and Real-Time Workshop® onto your development machine that are compatible with your NI VeriStand Version.

In order to build a .so file, you will need the appropriate compilation tools. 
 

For VeriStand 2019R3 and later:

  1. Download the compatible VeriStand Version or install it from the NI Package Manager, which is recommended.
  2. Run the VeriStand installation and make sure that the VeriStand Model Framework is selected:
Note: Since VeriStand 2019R3 the C/C++ Development Tools for NI Linux Real-Time is included in the VeriStand Model Framework installer so you do not need to install any additional compiler Toolchain to compile models for Linux-RT Targets. Simply ensure that on the additional items to install that the C/C++ Development Tools box is Checked, and it will be included in the install. 
  1. Now to compile your Simulink® Model make sure to select the appropriate Toolchain for your Linux-RT Target. Refer to Compiling a Model in MathWorks Simulink® Software in VeriStand Manual of the version you are using.
 

For VeriStand 2019R2 and earlier:

  1. Download and install the version of C/C++ Development Tools for NI Linux Real-Time that matches your version of LabVIEW Real-Time.
  2. Download the compatible VeriStand Version or use an installer disc to install NI VeriStand and the NI VeriStand Model Framework.
  3. With the NI VeriStand Model Framework and C/C++ Development Tools for NI Linux Real-Time, Eclipse Edition prepared, you can now build the .so file for your model using The Mathworks, Inc. Real-Time Workshop® software. Refer to Compiling a Model from The MathWorks, Inc. Simulink® Software from VeriStand help.
 

Additional Information

  • LabVIEW 2014 Model Interface Toolkit added support for compiling Simulink® models into shared objects that can run on ARM-based NI Linux Real-Time targets.
  • VeriStand 2015 and LabVIEW 2015 Model Interface Toolkit added support for compiling models for both ARM-based and Intel x64-based NI Linux Real-Time targets. 
  • VeriStand 2019R3 and higher has now the C/C++ Development Tools for NI Linux Real-Time included into the VeriStand Model Framework installer so you do not need to install any additional compiler Toolchain to compile Simulink® models for your Linux-RT Targets.

Simulink® and Real-Time Workshop® are registered trademarks of The MathWorks, Inc. All other trademarks are the property of their respective owners.