This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Tune and Monitor an Executable Running on the Texas Instruments Hercules RM57Lx LaunchPad

External Mode

You can use external mode to receive data from an executable while it runs on the Texas Instruments™ Hercules RM57Lx LaunchPad hardware board. You can also tune model parameters in the executable and evaluate the effects of different parameter values until you find the optimal ones. For more information, see Host-Target Communication with External Mode Simulation (Simulink Coder).

External mode accelerates parameter tuning. You do not have to build, load, 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 it is designed. You cannot achieve this software-hardware interaction solely by simulating a model.

To tune parameters with external mode:

  1. (Optional) Select a signal for logging or visualization using external mode. For example, use the Simulation Data Inspector, Display blocks, or Scope blocks to visualize data, or use a To File block to log signal data.

  2. Configure the model to simulate in external mode.

  3. Build and run the executable on the Texas Instruments Hercules RM57Lx LaunchPad.

  4. Connect the model on your host computer to the executable running on the Texas Instruments Hercules RM57Lx LaunchPad.

  5. (Optional) On your host computer, observe the data that external mode sends from the executable.

  6. On your host computer, change parameter values in the model that external mode applies to the executable.

  7. Find the optimal parameter values by making adjustments and observing the results.

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

Configure Simulink Model for External Mode

  1. Verify that you can run an executable on the Texas Instruments Hercules RM57Lx LaunchPad, as described in Build and Run Executable on the Texas Instruments Hercules RM57Lx LaunchPad.

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

  3. To the left of Simulation mode, set the Simulation stop time. The default value is 10.0 seconds. To run the model for an indefinite period, enter inf.

    Note

    When the model stops simulating in external mode, the binary executable stops running on the hardware.

  4. (Optional) If your model contains sink (Simulink) blocks, use them to observe data that external mode sends from the executable to the model on the host computer. Also review the options under the Simulation Data Inspector.

  5. Click Run.

    External mode:

    • Runs the binary executable on the hardware board.

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

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

    Note

    If your model does not contain a sink block, the MATLAB® Command Window displays a warning message. You can disregard this warning or add a sink block to the model.

  6. Change block parameter values in the model on your host computer. External mode applies the new parameter values to the executable running on the Texas Instruments Hercules RM57Lx LaunchPad hardware board. Observe the effects of those changes and optimize the parameter values.

    Any Simulink® sink blocks in your model receive data from the hardware board and display it on your host computer.

  7. Click Stop to stop the model simulating in external mode.

See Also