Understanding How NI VeriStand Imports Models from The MathWorks, Inc. Simulink® Software

NI VeriStand 2017 Help

Edition Date: May 2017

Part Number: 372846L-01

»View Product Info
Download Help (Windows Only)

NI VeriStand identifies inports, outports, parameters, and signals in models you created in The MathWorks, Inc. Simulink® application software according to their configuration in Simulink.

Case Study: Simple Models

Consider the following model from the Simulink software environment.

When you add this model to a system definition file in NI VeriStand, its components appear as described in the following table.

Component in model Type of component in NI VeriStand
Raw_Sine Signal
Sine_Gain Parameter
In1 Inport
Out1 Outport

Importing Inports and Outports

Simulink inports and outports located on the top-level of the simulation hierarchy in Simulink are available as inports and outports in NI VeriStand. Simulink inports and outports in submodels are available only if you place NI VeriStand inport and outport blocks in the submodel in Simulink.

If you want to run a Simulink model on a desktop computer without compiling it, you must use the NI VeriStand inport and outport block to make the inports and outports available in NI VeriStand.

Importing Parameters

Compiled models contain one of two types of parameters in NI VeriStand:

  • A global parameter, similar to a workspace variable in The MathWorks, Inc. MATLAB® software, by default applies to the current model and to any global parameters with the same name in other models on the target. If you specify to inline parameters in the Simulink software, The MathWorks, Inc. Real-Time Workshop® software converts MATLAB workspace variables to global parameters in the compiled model.
  • Local parameters apply only to the specific model and block or subsystem to which they belong. If you do not specify to inline parameters in Real-Time Workshop, block parameters remain block parameters in the compiled model.

A Simulink model can contain only one type of parameter. However, a system definition file can contain a model with global parameters and a model with block parameters.

Related Link

Differences Between Local and Global Parameters

Conditions Where Parameters are Unavailable in NI VeriStand

NI VeriStand supports model references to submodels, but you cannot access parameters or signals in submodels. In other words, submodels execute in an NI VeriStand system, but their parameters and signals are not available for mapping.

In Simulink, you can inline parameters. In NI VeriStand, inlined parameters are not available for configuration. However, even if you inline a parameter in Simulink, you still can allow users to influence the parameter by configuring a variable that affects the parameter to be tuneable. For example, consider a model with the following characteristics:

  • Contains a constant configured with the expression x + 3.
  • Contains a sine wave block whose amplitude and frequency parameters are inlined, and therefore unavailable in NI VeriStand.
  • Adds the result of the x + 3 constant to the output from the sine wave block.

Although the parameters of the sine wave block are unavailable, you can influence the operation by specifying that the x variable is tunable in Simulink. When x is tunable, it will appear in the Parameters list of the System Explorer configuration tree after you add the model to NI VeriStand, so you can change the value of x like a parameter as the model executes.

Importing Signals

Model signals are usually excluded when you convert a model into a compiled model unless you define a signal as a test point in the application you use to compile the model.

Conditions Where Signals are Unavailable in NI VeriStand

NI VeriStand supports model references to submodels, but you cannot access parameters or signals in submodels. In other words, submodels execute in an NI VeriStand system, but their parameters and signals are not available for mapping.

Certain optimizations you enable in Simulink can make a signal unavailable in NI VeriStand. You can disable these options for the entire model to make all signals available for probing, but the memory footprint of the model increases as a result. Alternatively, you can mark individual signals as test points in Simulink to maintain a reduced memory footprint while keeping the test-point signals available for probing.

Note  If you previously converted your model to a compiled model, you must convert the model again after marking signals as test points.

Bus Objects

In models compiled in the Simulink R2010b software or a later supported version, NI VeriStand organizes named components of bus objects, such as signals, into folders that match the hierarchy of the bus. For models compiled in versions of the Simulink software earlier than R2010b, NI VeriStand represents bus objects as a single vector of components.

WAS THIS ARTICLE HELPFUL?

Not Helpful