You can use External mode to tune parameters and monitor a model running on your target hardware.
You can tune model parameters and evaluate the effects of different parameter values on model results in real time. Doing so helps you find the optimal values for performance. This process is called parameter tuning.
External mode accelerates parameter tuning because you do not have to rerun the model each time you change parameters. You can also use External mode to develop and validate your model using the actual data and hardware for which it is designed.
This workflow lists the tasks usually required to tune parameters with External mode:
In the model on your host computer, enable External mode.
Run the model on the target hardware in External mode.
(Optional) Observe signals from target hardware using Display or Scope blocks on your host computer.
Change and apply parameter values in the model on your host computer.
Find the optimal parameter values by making adjustments and observing the results.
Save the new parameter values, disable External mode, and save the model.
Configure and run your Simulink® model on the target hardware.
This step verifies that the model is configured correctly and that the connection to the target hardware works.
On the Simulink model toolbar, set Simulation
Set the Simulation stop time parameter, located to the left of Simulation mode.
The default value is
10.0 seconds. To run
the model for an indefinite period, enter
(Optional) To log data from the model while it is running on the target hardware:
Click the Run button.
If your model does not contain a sink block, the Message Viewer displays a warning that “No data has been selected for uploading.” You can disregard this warning or add a sink block to the model.
After several minutes, Simulink starts running your model on the board.
In the model on your host computer, change parameter values.
Observe the corresponding changes in the model running on the hardware.
Any Simulink sink blocks in your model receive data from the hardware and display it on your host computer.
External mode increases the processing burden of the model running on the board. If the software reports an overrun, disable External mode.
To stop the model that is running in External mode, click the Stop button located on the model toolbar.
If the Simulation stop time parameter is set to a specific number of seconds, External mode stops when that time elapses.
When you are finished using External mode, set Simulation
mode back to