Compiling a Model from MathWorks Simulink
- Updated2026-05-07
- 3 minute(s) read
Compiling a Model from MathWorks Simulink
Convert MathWorks Simulink models into compiled models compatible with the Model Interface API.
- Verify that the VeriStand Model Framework is installed. The VeriStand Model Framework adds tools to Simulink that you can use later in this procedure.
- Ensure you have the correct compiler.
Answer the following questions to determine which tools you must use to convert and compile Simulink models:
You can use the following compilers with various operating systems:
| Operating System | Required Tools | Required Output Type |
|---|---|---|
| Microsoft Windows |
Note VeriStand
2015 also supports the older version of the Simulink
Coder, called the Real-Time Workshop.
|
.dll |
| NI Linux Real-Time |
|
.so |
The LabVIEW Model Interface Toolkit shares several components with the VeriStand, such as tools for compiling models designed in third-party modeling environments.
For more information, see the following knowledge base articles at ni.com:
- Creating Simulation Models Using NI VeriStand Model Framework
- Generating Models from The MathWorks, Inc. Simulink Software for Deployment on NI Linux Real-Time Systems
Select the Correct Compiler in MATLAB
Build the Compiled Model in Simulink
After you select and set up the correct compiler, complete the following steps to build the compiled model:
- Launch Simulink.
- Load the model you want to convert.
- Select to launch the Model Configuration Parameters dialog box.
- Click the Solver tab.
- Configure the following options:
- Stop time: inf
- Type: Fixed-step
- Click the Code Generation tab.
- Click the Browse button to launch the System Target File Browser dialog box.
- Select the correct option for your target from the following list:
- ETS, Windows—NIVeriStand.tlc—NI Real-Time Target
- NI Linux Real-Time—
- ARM-based targets—NIVeriStand_Linux_ARM_32.tlc — NI Real-Time Target
- Intel x64-based targets—NIVeriStand_Linux_64.tlc — NI Real-Time Target
- Click the OK button.
- Click the Build button in the Category section to build the compiled model. The MATLAB command window displays the status of the build process. The following message in the MATLAB command window indicates that the Simulink Coder has completed building the compiled model: ### Successful completion of build procedure for model: ModelName.
addpath('X:\VeriStand');
NIVeriStandAddPaths;
Where X is the drive letter on which you installed the VeriStand Model Framework.Including External Source Code in the Compiled Model
If the model you are converting specifies any .c or .h files, you must specify the locations of the files to include them in the compiled model. To specify the source files and include directories in Simulink, go to the Configuration Parameters dialog box on the Code Generation tab.
Related Information
- Considerations for Integrating Models from MathWorks Simulink
The Model Interface API identifies and categorizes elements in MathWorks Simulink models.
- Compiling Models
Compile models compatible with the LabVIEW Model Interface Toolkit.
- Real-Time Controllers and Real-Time Operating System Compatibility
- VeriStand Model Generation Support and MathWorks Simulink Compatibility
- Creating Simulation Models Using NI VeriStand Model Framework
- Generating Models from The MathWorks, Inc. Simulink® Software for Deployment on NI Linux Real-Time Systems