Saving and Restoring Simulation States in VeriStand

Updated Nov 14, 2023

Environment

Software

  • Simulink
  • VeriStand 2023 Q4

Matlab/Simulink model can be executed in VeriStand. When the model is being executed, it can be paused, started, and reset through Model Command. Starting from VeriStand 2023 Q4, if the Simulink model is compiled by VeriStand Model Generation Support 23.8 , the simulation states can be saved and restored in VeriStand. This article will introduce how to save and restore simulation states in VeriStand.

  1. Install VeriStand Model Generation Support 23.8 in the Matlab Add-Ons.
  2. Enable states in Simulink Settings.
Capture.JPG
  1. Use VeriStand -> Logging Specification -> Add channels to select the channels you want to save and restore the values.
Capture.JPG
  1. Save/restore the model.
On Windows Controller:
It is quite easy to save and restore the simulation states on the UI Manager Screen. When the Model Command is changed to Save, a Select Path to XML File dialog will be open to save the simulation state. Then, change the Model Command to Start to re-start the model execution. When the Model Command is changed to Restore, a Select Path to XML File dialog will be open to select a saved XML file.
Capture.JPG
On Linux RT Controller:
We need to use the workspace screen to save/restore the model and provide the path as c:/ni-rt/NIVeristand/Logs/test.xml
Capture.JPG