Using MathWorks™ Simulink Coder® to Export a Simulink Model as an FMU

This section describes how to export a Simulink model as an FMU using MathWorks Simulink Coder. Simulink Coder generates the model-based C-code, and the necessary Makefile for Microsoft Visual C++. The generated code is compiled into a DLL supporting FMI 2.0 co-simulation interface (see the FMI Web site https://fmi-standard.org/ for detailed information). Along with the DLL and the model description provided as an XML file, an FMU file is created in the current Simulink working directory.

The generated FMU only supports the FMI 2.0 co-simulation interface. Even though the interface is type co-simulation, the model is self-consistent and does not have any interaction with MATLAB or Simulink during the simulation – it is very similar to Simulink Coder-generated Twin Builder C-Model, except for the interface.

The FMU export is provided through FMU Target by Ansys Twin Builder.

Features and Limitations