You are on page 1of 2

Document Type: Tutorial NI Supported: Yes Publish Date: Aug 1, 2011

Creating Simulation Models Using The MathWorks, Inc. Simulink Software for Use in NI VeriStand
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. 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. 2. 3. 4. 5. 6. 7. Select SimulationConfiguration Parameters to launch the Configuration Parameters dialog box. Click the Real-Time Workshop tab. Click the Browse button to launch the System Target File Browser dialog box. Select NIVeriStand.tlcNI Real-Time Target from the list. Click the OK button. 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. 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 NI VeriStand and Simulink with the Real-Time Workshop plugin software installed on your computer. 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.

1/2

www.ni.com

Legal This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE ( http://ni.com/legal/termsofuse/unitedstates/us/).

2/2

www.ni.com