Main Content

Simulate FMU with Linux Binary on Windows

This topic shows how to use Simulink® to import and simulate a cosimulation Functional Mockup Unit (FMU) containing a Linux® binary on the Windows® platform.

You must have an FMU that contains a Linux binary. For information on generating an FMU with a Linux binary from a Simulink model on Windows, see Export Model as FMU with Linux Binary on Windows.

Configure System for Cross-Platform Simulation

To import and simulate an FMU containing a Linux binary on Windows, you must install:

  • MATLAB® R2024a Update 1 or later. To update your MATLAB installation to the latest version, see Update an Existing Installation.

  • Windows Subsystem for Linux (WSL) Version 2.0.9.0 or later. To install WSL, see Install Linux on Windows with WSL.

  • Simulink Compiler™.

  • FMU Builder for Simulink support package version 24.1.1 or later. To install the latest version of the support package, see FMU Builder for Simulink. You can also download the latest version of the support package or update your existing installation to the latest version using the Add-On Explorer. For more information, see Get and Manage Add-Ons.

Import and Simulate FMU with Linux Binary

After configuring your system, open the Simulink model into which you want to import the FMU. Use the FMU block to import the FMU with a Linux binary into Simulink.

Set the model solver to fixed-step.

set_param(gcs,'SolverType','Fixed-step');

Set the FMU block to use Linux binary for simulation.

set_param(gcb,'FMUSelectedBinary','linux64');

Alternatively, select the binary on the block dialog box. Open the FMU block dialog box. On the Simulation tab, set the Simulate FMU using parameter to linux64 to simulate FMU using the Linux binary.

FMU import block dialog with Linux64 selected as simulation target

Limitations

The following limitations apply for this workflow:

  • Standalone cosimulation FMUs exported with variable-step solver are not supported.

  • FMUs compatible with FMI 3.0 standards are not supported.

  • Simulation in rapid accelerator mode is not supported.

  • Code generation is not supported for this FMU block.

  • A model with this FMU block cannot be exported as a protected model.

  • FMU debugging using an external debugger is not supported.

Related Topics