Main Content

External Mode Simulation of Deployed Applications

You can use the Linux Runtime Manager app to deploy the models that you configure for external mode. The app supports external mode simulation by establishing a communication channel between Simulink® model on your development computer (host) and the application running in a docker container on the Linux target.

To understand more about external mode simulation, see External Mode Simulations for Parameter Tuning, Signal Monitoring, and Code Execution Profiling. To know more about deploying a model on target computer, see Build Simulink Model and Deploy Application.

To perform external mode simulation of the deployed application follow these steps.

  1. Open an AUTOSAR adaptive model.

  2. Set the Hardware board configuration parameter in the Hardware Implementation to Embedded Coder Linux Docker Container.

  3. Set the Transport layer parameter in the XCP Server Configuration pane of the Code Generation > AUTOSAR Code Generation to XCP On TCP/IP.

  4. Specify the IP address of the target machine and port number for XCP communication in the Code Generation > AUTOSAR Code Generation > XCP Server Configuration section.

  5. Enable the External mode option in the Interface pane of Code Generation section.

  6. To log signals, select the signals you want to log and click the Log Signals in the Prepare pane of the Simulation section.

  7. Open the Linux Runtime Manager from the Simulink apps gallery. Alternatively, enter this command at the MATLAB Command Window.

    linuxRuntimeManager

  8. Deploy the model on the Linux target machine. See Build Simulink Model and Deploy Application for more information.

  9. Select the model in the Linux Runtime Manager and click Monitor & Tune button to start the application and an external mode simulation.

  10. Tune the parameters using the Simulink model. You can use Dashboard blocks like Slider, Knob, Radio Button, Push Button etc. or directly changing block parameters. You can view the signals directly in Simulink model using Dashboard blocks like Gauge, Scope etc. You can also view the signal in Signal Data Inspector.

Select the application and click Stop Monitor & Tune to stop the external mode simulation. Or select the application and click Stop Application button to stop application.

You can also deploy a DDS Blockset model configured for external mode. For a DDS Blockset model, you can enter the target details in the MEX-file arguments section of the External mode configuration tab in the Interface section of Code Generation tab. For more information, see MEX-file arguments.

External Mode Simulation Using Hardware Tab

Simulink Coder™ enables you to perform external mode simulation for an AUTOSAR adaptive model and DDS model using the Hardware tab in the toolstrip.

To perform external mode simulation using Hardware tab, follow these steps.

  1. Open an AUTOSAR adaptive or DDS model.

  2. Enable the External mode option in the Code Generation > Interface section in the configuration settings of the model.

    This enables the Hardware tab of the model.

  3. Set the Board option in Hardware section under Hardware tab to Embedded Coder Linux Docker Container.

  4. Select Open Linux Runtime Manager for the Connection option.

    This opens the Linux Runtime Manager application.

  5. On the Linux Runtime Manager application, specify the fields in Target Configuration section.

  6. On the Hardware tab, click Monitor and Tune button in Run on Hardware section.

This will deploy the application on specified target and start external mode simulation.

Video - Deploy AUTOSAR Adaptive Application in External Mode

This video walks you through how to build and deploy an AUTOSAR Adaptive application configured for external mode simulation.

See Also

Related Topics