Table Of Contents

Adding and Configuring a Model

Last Modified: June 10, 2021

Connect a model to other parts of the system and run the model on a hardware target.

Before you begin, you must compile the model to use it. To learn more about models, refer to Components of a Model and Primary Control Loop Step Execution in Models.
VeriStand executes each model in its own loop. If a system definition contains multiple models referencing the same compiled model, VeriStand makes a temporary copy of the model so each loop has its own compiled model to execute.
spd-note-note
Note  

Adding more than one instance of the same compiled model causes errors if the model accesses a shared resource, such as a dependency. Contact your model provider for information about whether the model accesses such resources.

  1. Launch the VeriStand Editor.
  2. On the Mapping Diagram on the Palette, click Software»Simulation Model and drop the model node on the diagram.
  3. In the Open dialog box, select a simulation model and click Open. The Mapping Diagram will load the model.
  4. In the Configuration pane, use the Item tab to modify the model.
    1. Set the Initial state of the model to Running or Paused.
      spd-note-note
      Note  

      To change the values of model parameters before the first time step, set the Initial state to Paused.

    2. Set the Decimation of the model rate.
    3. Click Import parameters.
    4. In the Import Parameters dialog box, select the parameters you want to import as channels and click OK. The parameters you selected appears inside the node when you expand it.
      spd-note-note
      Note  

      Importing too many parameters negatively impacts system performance.

    5. Click Import signals.
    6. In the Import Signals dialog box, select the signals you want to import as a channels and click OK. The signals you selected appears inside the node when you expand it.
      spd-note-note
      Note  

      Importing too many signals negatively impacts system performance.

    7. Optional: If your model contains a vector inport or outport, set the Vector port specification as Segment into scalar channels or Maintain as vector channel.
      spd-note-note
      Note  

      Scalar channels provide greater flexibility than vector channels. Vector channels only map to models that contain a vector channel of the same size. You cannot map a vector channel to controls or indicators on your Workspace or use it with calculated channels, alarms, procedures, and others.

  5. Wire the channels to create mappings.
  6. Depending on your goal, complete the following tasks to configure the model further.
    Goal Task
    Set model timing Adjust the step size to have the model run at a different rate.
    Set model parameters Use the VeriStand Editor, Workspace, Model Parameter Manager, and Stimulus Profile Editor to set the values of model parameters.
    Scope global parameters Update the scope of all global parameters in a model to the target-level or model-level.
    Set the default values for inports Change the default value for an inport to prevent your models from using invalid values.
    Configure the execution order of multiple models Define the order that the Primary Control Loop (PCL) executes models.
  7. Save the system definition file.
After adding the model to the system definition, use model execution channels to interact with models.

Recently Viewed Topics