For control-only operators, 'slrealtime loadParamSet' is available to support some degree of configurability for Simulink Real-Time (SLRT) simulations. It allows starting the real-time model with a specific set of parameters. However, these parameter set files must have been pre-defined by a developer or test engineer with at least a MATLAB and SLRT license. Changing individual parameter values within these binary parameter set files is not possible for the control-only operator.
Here are details on two possible parameter set workflows for control-only operators without MATLAB. Workflow 1 stores the parameter set files locally on the target, while Workflow 2 packages the parameter set files into the MLDATX file to allow portability:
Workflow 1: Store parameter sets on the Speedgoat target
The Developer / Test Engineer with MATLAB (target connection required):
- Connects their computer to the Speedgoat target.
- Loads the real-time application onto the Speedgoat target.
- Saves an unlimited number of different parameter sets to target by using any of the following options:
Connecting to the same target, the SSH Control-Only Operator:
- Loads the pre-installed application with 'slrealtime load'.
- Loads any stored parameter set before starting the simulation with 'slrealtime loadParamSet'. Loading parameter sets during simulation is not possible from the SSH console.
- Starts simulation with 'slrealtime start'.
- Re-loading the application with 'slrealtime load' reverts the parameters to the default/startup parameter set values.
Note that when the application is reinstalled, the stored parameter sets are deleted from the target for this workflow. So, for every model design iteration, the process of connecting the Speedgoat to the other computer with MATLAB and saving the parameter sets to the target must be repeated. This process can be scripted.
Workflow 2: Store parameter sets in real-time application MLDATX file
The Developer / Test Engineer with MATLAB (no target connection required in R2026a and later):
- Extracts the parameter set from the real-time application MLDATX file using app.getParamSet (R2026a+). Note: Before R2026a, connect to a target, load the application, and use tg.importParamSet as shown in Workflow 1.
- Edits individual parameters in the parameter set using Parameter Explorer or the set function.
- Adds an unlimited number of different parameter sets to the MLDATX file using app.addParamSet.
Using any target with matching software, the SSH Control-Only Operator:
- Transfers and installs the MLDATX file with 'slrealtime install' (see this MATLAB answer). The packaged parameter sets are extracted to the target.
- Loads application, loads parameter sets, etc. (see above in Workflow 1).
In this workflow, when the application is reinstalled, the parameter sets are reinstalled as well. On the developer side, for every model design iteration or new build, the process of saving the parameter sets to the MLDATX file must be repeated. This process can be scripted.
Alternative Approaches:
If you require full parameter tuning flexibility that allows modifying individual parameters at any point during simulation without MATLAB, consider deploying a standalone SLRT app created with MATLAB Compiler. For more details and a full overview of alternative options, see: