Tune and Monitor an Executable Running on BeagleBone Blue Hardware
With External mode, you can tune model parameters and evaluate the effects of different parameter values on the executable when it is running on the hardware. This process is called parameter tuning.
External mode accelerates parameter tuning. You do not have to generate code, build, and run the executable each time you change the value of a parameter. You can also use External mode to develop and validate your application using the actual data and hardware for which the application is designed. This software-hardware interaction is not available when simulating a model.
External mode:
Runs the binary executable on the BeagleBone® Blue hardware.
Runs the model on your computer in External mode.
Establishes External mode communication between the executable and the model.
Run Your Simulink Model in External Mode
Verify that you can run an executable on the BeagleBone Blue hardware, as described in Build and Run an Executable on BeagleBone Blue Hardware.
On the model toolbar, set Simulation mode to
External
.On the model toolbar, review Simulation stop time, located to the left of Simulation mode. The default value is
10.0
seconds. To run the model for an indefinite period, enterinf
.To observe data that External mode sends from the executable to the model on your computer, place one or more sink blocks in your model.
For example, to visualize data, attach Display or Scope blocks to signals in the model. To log signal data, use a To File block. For additional options, click the Simulation Data Inspector button .
Optionally, to log signal data, enable MAT-file logging. See MAT-file logging.
Click Run .
Change block parameter values in the model on your computer. External mode applies the new parameters values to the executable running on the BeagleBone Blue hardware. Observe the effects of those changes and optimize the parameter values.
Simulink® sink blocks in your model receive data from the BeagleBone Blue hardware and display the data on your computer.
Tip
When you finish tuning and monitoring your application, disable External mode
by setting Simulation mode to Normal
.
Stop External Mode
When a model stops simulating in External mode, the binary executable stops running on the hardware.
To stop the model simulating in External mode, click the Stop button on the model toolbar.
If the simulation stop time parameter is set to a numeric value, External mode stops when the time elapses.
Display Verbose External Mode
To troubleshoot problems with External mode communication, you can configure a model to display verbose External mode messages in the MATLAB® Command Window.
In the Simulink editor, select Simulation > Model Configuration Parameters.
In the Configuration Parameters dialog box, select Hardware Implementation. From the Groups list under Target hardware resources, select
External mode
.Select Verbose and click OK to save your changes.
When the model runs in External mode, review the External mode messages in the MATLAB Command Window. For example:
Got EXT_SETPARAM_RESPONSE from target with status OK. Got EXT_SELECT_SIGNALS_RESPONSE from target for upInfoIdx 0 with status OK. action: EXT_SELECT_TRIGGER Got EXT_CANCEL_LOGGING_RESPONSE from target for upInfoIdx 1 with status OK. Got EXT_MODEL_START_RESPONSE packet from target. Got EXT_SELECT_TRIGGER_RESPONSE from target for upInfoIdx 0 with status OK. action: EXT_ARM_TRIGGER Got EXT_ARM_TRIGGER_RESPONSE from target for upInfoIdx 0 with status OK. action: EXT_MODEL_STOP Got EXT_MODEL_SHUTDOWN packet from target. action: EXT_DISCONNECT_CONFIRMED
See Also
External Mode Simulations for Parameter Tuning, Signal Monitoring, and Code Execution Profiling