Tune and Monitor Executable Running on Intel SoC Platform

Using External Mode

You can use external mode to tune parameter values in, and receive data from, the executable while it is running on your hardware.

With external mode, you can tune model parameters and evaluate the effects of different parameter values on the executable while it is running on the hardware. This process is called parameter tuning.

External mode accelerates parameter tuning because 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 by simulating a model.

This work flow lists the tasks to tune parameters with external mode.

  1. In the model on your host computer, enable external mode.

  2. (Optional) Place one or more sink (Simulink) blocks in your model. For example, use Display or Scope blocks to visualize data, or use a To File block to log signal data.

  3. Click the Run button in the model. Embedded Coder:

    • Builds, loads, and runs an executable on the Intel® SoC platform.

    • Runs the model on the host computer in external mode.

    • Creates an external mode connection between the executable on Intel SoC platform and the model on the host computer.

  4. (Optional) Observe the data external mode sends from the Intel SoC platform to sink blocks in the model on the host computer.

  5. (Optional) Change parameter values in the model on your host computer. External mode changes those values in the executable running on the hardware.

  6. Find the optimal parameter values by adjusting parameters and observing the results.

  7. Save the new parameter values, disable external mode, and save the model.

Run Your Simulink Model in External Mode

  1. Verify that you can run an executable on the Intel SoC platform, as described in Build and Run Executable on Intel SoC Platform.

  2. In the model, set Simulation mode to External.

  3. On the model toolbar, 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 inf.

  4. Optional: To observe data that external mode sends from the executable to the model on the host computer, place one or more sink (Simulink) blocks in your model. To visualize data, attach Display or Scope blocks to signals in the model.

  5. Optional: To log signal data, use a To File block, and review options under the Simulation Data Inspector button.

  6. Click the Run button.

    External mode:

    • Runs the binary executable on the Intel SoC platform.

    • Runs the model on the host computer in external mode.

    • Establishes external mode communication between the executable and the model.

  7. Change block parameter values in the model on your host computer. External mode applies the new parameters values to the executable running on the Intel SoC platform. Observe the effects of those changes and optimize the parameter values.

    Any Simulink® Sink blocks in your model receive data from the Intel SoC platform and display the data on your host 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.

If the Simulation stop time parameter is set to a numeric value such as 10 seconds, external mode stops when that time elapses.

Display Verbose External Mode

To help troubleshoot problems with external mode communications, you can configure a model to display verbose external mode messages in the Command Window.

  1. Select Simulation > Model Configuration Parameters.

  2. In the Configuration Parameter dialog box, select the Hardware Implementation. Then, select the External mode pane.

  3. Select the check box for the Verbose parameter. Click OK or Apply.

  4. When the model runs in external mode, you can review the external mode messages in the 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