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

Publish Date: Jul 11, 2012 | 4 Ratings | 4.00 out of 5 |  PDF

Overview

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.

Table of Contents

Process Summary

Note: You can convert models that use only a fixed step-size ordinary differential equation (ODE) solver. Additionally, you must turn off data logging in The MathWorks, Inc. Simulink® software. Refer to the Simulink documentation for information about changing the ODE solver of a model and disabling data logging.

Note: If you do not have a compiler set up to compile the C code, or if you have set up an unsupported compiler, you must run mex -setup in the The MathWorks, Inc. MATLAB® software before compiling your model.

Launch Simulink and load the model that you want to convert. Follow the steps below to build a model dll for use in NI VeriStand.

  1. Select Simulation»Configuration Parameters to launch the Configuration Parameters dialog box.
  2. Click the Real-Time Workshop tab.
  3. Click the Browse button to launch the System Target File Browser dialog box.
  4. Select NIVeriStand.tlc—NI Real-Time Target from the list.
  5. Click the OK button.
  6. Click the Build button in the Category section to begin building the compiled model. The MATLAB command window displays the status of the build process.
  7. 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.
  8. After Real-Time Workshop builds a compiled model, NI VeriStand places the compiled model in a directory named <ModelName>_NIVeriStand_rtw, which is located in the current working directory.

Using the Model DLL

You can now import the Simulink® model into your system definition just as you would any other model. NI VeriStand Help and the NI VeriStand instructional video contain more information about importing models into the system definition. 

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® plugin software installed on your computer.  The NI VeriStand Model Framework installs with NI VeriStand, and it can be used free of charge.  You can activate the NI VeriStand Model Framework by installing the license file from here: NI VeriStand Model Generation Activation Utility

Additional Resources

Learn More About NI VeriStand

Evaluate NI VeriStand

View the NI VeriStand Demonstration Videos

MATLAB®, Simulink®, and Real-Time Workshop® are registered trademarks of The MathWorks, Inc.

 

Back to Top

Bookmark & Share

Ratings

Rate this document

Answered Your Question?
Yes No

Submit