After you create a model that contains an FMU block, you can build and download the model to a target computer by using Simulink® Real-Time™. The following limitations apply:
Simulink Real-Time generates a mask dialog box that contains both numerical-valued and string-valued parameters. However, Simulink Real-Time generates code for only numerical- valued parameters.
To convert a Simulink model that contains FMU blocks to a Simulink Real-Time model, set the model Configuration Parameters to values compatible with real-time execution:
In the Code Generation pane, set System target
In the Solver pane:
Set Type to
Set Fixed-step size to a step size compatible with the real-time requirements of your model.
You can then build and download the model to a target computer and run the real-time application. The build and download process downloads the required FMU binary files.
To open an example model that contains FMU blocks running in Simulink Real-Time, type
dslrt_bouncing_cs in the MATLAB® Command Window.
When you build an FMU, dependencies on external DLLs are an important
consideration. For example, if the compiler command line does not provide the MT
flag, the linker links the
.obj file with
MSVCRT.lib. This library depends on many DLLs that are
unavailable on a Simulink
The MT flag on the compiler command line makes the real-time application use the
multithread, static version of the run-time library. With MT, the compiler places
LIBCMT.lib into the
.obj file, so the
LIBCMT.lib to resolve external symbols.
To build a FMU for a Simulink Real-Time real-time application, in the makefile to build a FMU, change from:
cl /wd4090 /nologo %DEF% ..\%1\%1.c /I ..\. /I ..\..\%FMI_DIR%\include
cl /MT /wd4090 /nologo %DEF% ..\%1\%1.c /I ..\. /I ..\..\%FMI_DIR%\include
Note: Simulink Real-Time supports FMU blocks that comply with FMU v1.0. Blocks complying with FMU v2.0 are not supported.