Main Content

Build Simulink Model and Deploy Application

R2026b

After you connect your development computer to the target computer, you can build a Simulink® model and deploy the standalone application.

You can use the Embedded Coder® Support Package for Service-Oriented Applications on Linux® to deploy:

  • Software component models configured with the Software Component Designer app

  • Software architecture models configured with the Software Component Designer app

  • DDS Blockset models

  • AUTOSAR Adaptive software component models

  • AUTOSAR Adaptive software architecture models

Configure the Model

To build a model and deploy the application, specify the following configuration parameters.

  1. Set Hardware Implementation > Hardware board to:

    • Embedded Coder Linux Docker Container to deploy on x86_64 target types.

    • Embedded Coder Linux Docker Container - ARM64 to deploy on ARM® target types.

  2. Verify that Code Generation > Build Process > Toolchain is set to:

    • AUTOSAR Adaptive Linux Executable for AUTOSAR Adaptive software component models and AUTOSAR Adaptive software architecture models.

    • Embedded Coder Linux Docker Container GCC Toolchain for software component models configured with the Software Component Designer app.

Note

To build and deploy a model that uses the DDS network binding option, you must have Java version 8 or later installed on the host computer. Use the jenv function to configure the Java environment.

DDS Blockset Models Configured with RTI Connext Vendor

Use the following steps to deploy DDS Blockset model configured with RTI Connext vendor:

  1. Set the value NDDSHOME_LINUX environment variable on the host to point to the RTI Connext software folder on the target computer.

    setenv('NDDSHOME_LINUX', 'RTISoftwarePath')
    % For example if the software path is "/home/user/RTIDDS/glnxa64/rti_connext_dds-6.0.1_gcc7.3.0"
    setenv('NDDSHOME_LINUX', '/home/user/RTIDDS/glnxa64/rti_connext_dds-6.0.1_gcc7.3.0')

  2. Open the Linux Runtime Manager app and click Connect. If the target setup is incomplete, the app opens a pop-up to fill the deployment location.

  3. Recreate the Docker container if it already exists using this command.

    restartContainer(tg,recreateContainer=true)

Create and Deploy Application Package

You can create an application package (.mldatx) that includes either source code or an executable.

  1. Open Linux Runtime Manager application.

    linuxRuntimeManager

  2. Click Linux Target > Prepare > Create & Deploy Application Package to create an application with source code.

  3. Click the Linux Target > Prepare > Create & Deploy Application Package > Create Application Package with Executable to create an application with executable and without source code.

  4. Select the model. If you already have an application package (.mldatx), select it. Click Open.

If you selected the model, the Linux Runtime Manager app builds the model, creates the application package, and deploys the package. If you selected the application package, the Linux Runtime Manager deploys it. You can also use linux.createApplicationPackage and deployApplicationPackage functions to create and deploy an application package respectively.

Deploy Existing Application Package

If you already have an application package (.mldatx), you can deploy it from the MATLAB® main window.

  1. In MATLAB, right-click the application package and select Open.

    Dialog box to choose a target computer to deploy the selected application.

  2. Choose a target in the dialog and click OK. The dialog lists all the target computer names that appear in the Targets Tree.

The deployed application appears under the selected target computer.

In the Linux Runtime Manager app, select an application to view the measurable signals and tunable parameters. Or, you can use getMeasurements and getParameters functions to view the signals and parameters on the MATLAB command window.

Manage Deployed Applications

Select an application in the Targets Tree and:

  • To start the application, click Linux Target > Run On Target > Start Application.

    Programmatically:

    startApplication(tg,<applicationName>);

  • To pause a DDS Blockset application, click Linux Target > Run On Target > Pause Application. This option does not apply to software component models.

    Programmatically:

    pauseApplication(tg,<applicationName>);

  • To resume a paused DDS Blockset application, click Linux Target > Run On Target > Resume Application. This option does not apply to software component models.

    Programmatically:

    resumeApplication(tg,<applicationName>);

  • To stop the application, click Linux Target > Run On Target > Stop Application.

    Programmatically:

    stopApplication(tg,<applicationName>);

To delete an application, select it and click the delete button. Programmatically:

removeApplicationPackage(tg,<applicationName>);

You can also right-click an application package (.mldatx) file and select Run to deploy and start the application on a selected target in one step.

See Also

| | | | | |

Topics