Creating Simulation Models Using SimulationX by ITI for Use in NI VeriStand

Publish Date: Nov 18, 2019 | 3 Ratings | 5.00 out of 5 | Print | Submit your review

Overview

This document describes how to use SimulationX application software to compile a simulation model for use in NI VeriStand software.

Table of Contents

Process Summary

Note: You must have a C code compiler installed to compile SimulationX models for use in NI VeriStand.

Launch the SimulationX application software and load the model that you want to convert.

  1. Select Simulation»Transient Settings to launch the Simulation Control dialog box.
  2. Click the General tab. This is where you determine the model loop rate when the compiled model is imported into NI VeriStand.
    1. Set the Minimum Protocol Step Size (dtProtMin) to the desired time step. This value is the reciprocal of the model loop frequency. For example, setting this value to 0.001 seconds results in a model loop rate of 1 kHz when the model is imported into NI VeriStand.
    2. Set the Minimum Calculation Step Size (dtMin).  This value determines the mathematical integration step size.  This value should be tested in simulation before compilation to determine if it will function properly when it is compiled.  The model in this video should have a dtmin of 0.001, which means that the model will take one step each time the model loop iterates.
  3. Click the Solver tab. There are multiple ODE solvers from which to choose.  However, SimulationX will automatically use a fixed-step ODE solver when compiling the model, regardless of which ODE solver is selected.  A fixed step ODE solver is required to ensure determinism when the model is run on a real-time operating system.    
  4. Click the OK button to close the Simulation Control dialog box.
  5. Select Export»C-Code to launch the Code Export Wizard.
    1. Select NI VeriStand/LabVIEW Simulation Interface for the project type and choose the name and file path of your build project.
    2. Click the Next button.
    3. Select the inputs that you want to include in your compiled model. These inputs populate as Inports in NI VeriStand.
    4. Click the Next button.
    5. Select the outputs that you want to include in your compiled model. These outputs populate as Outports in NI VeriStand.
    6. Click the Next button.
    7. Select the parameters that you want to include in your compiled model. These parameters populate as parameters in NI VeriStand.
    8. Click the Next button.
    9. SimulationX then generates all of the necessary C code for the model and displays any errors or warnings that occurred during code generation.
    10. Click the Next button.
    11. Select the compiler to use for dll compilation. Click the Build Button. SimulationX then compiles the C code into a model dll for use in NI VeriStand. The output window again displays any errors or warnings that occurred during compilation.
    12. Click the Finish button.
  6. After SimulationX builds a compiled model, it places the compiled model in a specified directory.

Using the Model DLL

You can now import the SimulationX 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 build and export simulation models SimulationX and a Microsoft C compiler are needed.  NI VeriStand is required to run the compiled model after it is built. 

Back to Top

Bookmark & Share



Ratings

Rate this document

Answered Your Question?
Yes No

Submit