Main Content

Build and Deploy Real-Time Application to Linux Target Device

R2026b

To verify the support package installation and the Linux target device configuration, use this Simulink® Real-Time™ workflow.

  1. Open example Real-Time Signal Logging and Parameter Tuning (Simulink Real-Time) by using this command in the MATLAB Command Window:

    openExample('slrealtime/SlrtParameterTuningAndDataLoggingExample')
  2. Execute the commands in the example that open, build, and download the model to the Linux target device. Observe the successful download of the real-time application to the virtual machine.

  3. Execute the commands in the example that run the model, sweep the 'Gain' parameter, and plot the logged data from the Linux target device. Observe the successful run of the real-time application on the virtual machine.

  4. If the example commands do not run successfully, use the slrealtime.testSetup (Simulink Real-Time) function to identify any issues. In the MATLAB Command Window, type:

    tg = slrealtime
    slrealtime.testSetup(tg)

You can choose which code generation product generates code for your model when building a real-time application. If you configure the model to use the slrtlinux_x64.tlc system target file (STF), the model build uses Simulink Coder™ to generate code. If you configure the model to use the slrtertlinux.tlc STF, the model build uses Embedded Coder® to generate code.

  1. Configure the Simulink Coder STF for the model. These approaches configure the model to use slrtlinux_x64.tlc. Code is generated by Simulink Coder during model build.

    • If configuring the model programmatically, use the getSTFName (Simulink Real-Time) function to identify system target file (STF) for the connected Linux target device or use the configureModelForTargetPlatform (Simulink Real-Time) function.

    • If configuring the model by using Simulink editor, use the Target Platform button on the Real-Time tab.

    • If configuring the model by using the Configuration Parameters dialog box, in the Code Generation tab of the dialog box, select the slrtlinux_x64.tlc STF for code generation.

  2. Configure the Embedded Coder STF for the model. In the Code Generation tab of the Configuration Parameters dialog box, select the slrtertlinux.tlc STF for code generation.

    Because the Embedded Coder permits data type replacement with C language or customized definitions, in the Data Type Replacement tab of the Configuration Parameters dialog box, select Use coder typedefs for the Data type replacement parameter.

See Also

Topics