Creating Simulation Models Using The MathWorks, Inc. Simulink® Software for Use in NI VeriStand

Publish Date: Apr 13, 2020 | 10 Ratings | 4.20 out of 5 | Print | Submit your review


This document describes how to compile a simulation model using The MathWorks, Inc. Simulink® software and The MathWorks, Inc. Real-Time Workshop® software for use in NI VeriStand.

Note: NI will remove support for Phar Lap for cRIO in the NI 2020 Software Release and for PXI in the NI 2022 Software Release. For more information, please see the Phar Lap RT OS EOL Road Map.

Table of Contents

Process Summary

The following instructions outline the steps shown in the video to compile a model for a Phar Lap target.

Creating the Simulink® Model

Launch Simulink® and load the model that you want to convert. Follow the steps below to build a model dll for use with a Windows or Phar Lap system.

  1. Select Simulation»Configuration Parameters to launch the Configuration Parameters dialog box.
  2. Click the Solver Settings tab.
    1. Input inf for Stop Time.
    2. Set Solver Type to Fixed-Step.
    3. Set Solver to Discrete.
    4. Select Apply to save the changes.
  3. Click the Code Generation tab.
    1. Click the Browse button to launch the System Target File Browser dialog box.
    2. Select NIVeriStand.tlc—NI Phar Lap Real-Time & Windows Targets from the list.
    3. Select Apply to save the changes.
    4. Select the OK button.
  4. Click the Apply button to ensure all settings are saved.
  5. Click the Build button in the Code Generation section to begin building the compiled model. The MATLAB® command window displays the status of the build process.
  6. The following message in the MATLAB® command window indicates that The MathWorks, Inc. Real-Time Workshop® software has completed building the compiled model: Successful completion of Real-Time Workshop build procedure for model: Model Name.

Import the Model into VeriStand

  1. Open VeriStand.
  2. Expand Simulation Models under Targets and Controller.
  3. Right click Models to open up the Add Simulation Model menu.
  4. Click the Browse button and then browse to the DLL that was created. Once it is selected select OK.
  5. Check all of the tabs to verify that all of the settings are correct.
  6. Select OK to add the model.

This completes the importing process. 

Required Software

To use Simulink® to build simulation models for NI VeriStand, you must have both The NI VeriStand Model Framework and Simulink® with the Real-Time Workshop® / Simulink Coder® plugin software installed on your computer.  The NI VeriStand Model Framework installs with NI VeriStand, and it can be used free of charge.  

Additional Resources

Learn More About NI VeriStand

Evaluate NI VeriStand

View the NI VeriStand Demonstration Videos

Related Links

NI VeriStand Help

Compiling a Model from The MathWorks, Inc. Simulink® Software

Setting Up The Mathworks, Inc. MATLAB® Software to Create a NI VeriStand or Model Interface Toolkit Compatible DLL

Generating Models from The Mathworks, Inc. Simulink® Simulation Software for Deployment on VxWorks Systems

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

Troubleshooting NI VeriStand Models Built with The MathWorks, Inc. Simulink® Software


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


Back to Top

Bookmark & Share


Rate this document

Answered Your Question?
Yes No