MATLAB Answers

How do I use the "Connect" option under "Monitor & Tune" with Hardware Support Packages?

3 views (last 30 days)
What is the expected workflow of the "Step by Step Commands" under "Monitor & Tune" when working with Simulink Hardware Support Packages?
How can I use the "Connect" button instead of the default "Monitor & Tune" button?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Feb 2021
The general workflow for using External Mode with Hardware Support Packages is as follows:
  1. With the Stop Time set to 'Inf', click "Monitor & Tune". This deploys an executable generated from the model onto the hardware and creates a connection between it and Simulink. This is often the only step needed.
  2. When the model is already deployed and running from step 1, select "Disconnect" from the "Step by Step Commands". This disconnects Simulink from the hardware, but the executable continues running.
  3. Now select "Connect" from the "Step by Step Commands". This reestablishes the connection between Simulink and the already running executable on the hardware. This can save time if you don't need to regenerate, compile, and deploy the code.
  4. The "Stop" option stops the executable from running and breaks the communication link. In order to run the model again, you need to go back to step 1.
Using the "Connect" option when there isn't currently an executable currently running on the target hardware may result in an error message such as this:
Error occurred while executing External Mode MEX-file 'ext_comm':
Failed to connect to the target. A time-out occurred while waiting for the connection response from the target. Possible reasons for the time-out:
a) The target is not switched on.
b) The target is not connected to your host machine.
c) The application for the model is not running on the target. You might have clicked the Stop button. If the Run button is not dimmed, click it. Otherwise, click the Build button, which downloads and runs your application on the target.

More Answers (0)

Categories

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!