A hardware-in-the-loop rig often combines models from different tools: vehicle dynamics from one supplier, a powertrain from another, a controller from a third. The Functional Mock-up Interface, FMI, is the standard that lets them meet. In its own words it is a free standard that defines a container and an interface to exchange dynamic simulation models. FMI is a project of the Modelica Association and is supported by more than 290 tools.
Daimler AG initiated the development, to make it easier for suppliers and carmakers to exchange simulation models. FMI 1.0 for Model Exchange was published in January 2010, followed by FMI 1.0 for Co-Simulation in October 2010. FMI 2.0 merged the two in July 2014, and FMI 3.0 was released in May 2022. The current maintenance releases, 3.0.2 and 2.0.5, are from November 2024.
What is in an FMU
A model is exchanged as a Functional Mock-up Unit, an FMU, which is a single ZIP file. Inside are modelDescription.xml, which describes the model’s variables and capabilities, the compiled binaries in folders named after their platform, such as x86_64-linux or x86_64-windows, and optionally the C sources, documentation and other data the FMU needs. The tool that loads and runs an FMU is called the importer.
Three ways to run a model
- Model Exchange: the FMU provides the model, and the importer performs the numerical integration with its own solver.
- Co-Simulation: the FMU typically contains its own solver, and the importer only advances it from one communication point to the next.
- Scheduled Execution, new in FMI 3.0: the FMU exposes its model partitions, and a scheduler in the importer activates each of them separately, for example on a real-time platform.
Co-simulation, step by step
In co-simulation, time advances in steps negotiated between the importer’s co-simulation algorithm and the FMU, and only the call fmi3DoStep moves an FMU’s time forward. At each communication point the importer reads the FMUs’ outputs and sets their inputs. Then it calls fmi3DoStep with the current communication point and the step size, and each FMU integrates internally, with its own solver and its own internal steps, up to the next communication point. Between communication points the FMUs exchange nothing, so each FMU has to make assumptions about how its inputs change in between.
How the FMUs are stepped is up to the importer. It can step them in parallel, each working with the inputs from the last communication point, or one after another, so that later FMUs already see the outputs that earlier ones have just computed. The communication step size is a trade-off between the accuracy of the coupled simulation and its speed.
What FMI 3.0 added
FMI 3.0 was shaped by the need to export virtual ECUs as FMUs. It adds clocks to control the timing of events and model partitions across FMUs, more integer types and a 32-bit float to match controller data types, a binary type for data such as complex sensor interfaces, arrays, and terminals and icons that group variables and show how FMUs connect. For co-simulation it adds early return from fmi3DoStep, Event Mode and Intermediate Update Mode, so that an importer can handle events at the time they occur instead of only at the next communication point.
FMI and the network
For networked ECUs there is now the FMI Layered Standard for Network Communication, FMI-LS-BUS, released as version 1.0.0 in July 2025. It defines how FMUs exchange bus traffic, either as physical signal values or at the network level, using FMI 3.0 clocks to mark when data is sent and received; a dedicated bus simulation FMU or the importer itself can model the network between them. The first release specifies the network level for CAN, CAN FD and CAN XL, and later versions, still in pre-release, extend it to further bus types. It connects naturally to the protocols in our earlier posts.
FMI on a test rig
On a real-time rig, co-simulation meets a hard deadline: every communication step has to finish within its time slot, every time. The real-time systems we work with run FMUs alongside Simulink, Simpack and Adams models and hand-written code, and connect them to the rig’s buses and I/O. We help teams choose step sizes, check that FMUs from different tools work together, and bring them up in real time. If you have FMUs to run on a rig, get in touch.
Sources
- Modelica Association Project FMI, fmi-standard.org
- Functional Mock-up Interface Specification 3.0.2, 27 November 2024
- Functional Mock-up Interface 2.0.5, history and road map
- FMI Layered Standard for Network Communication 1.0.0
- Release history: modelica/fmi-standard, modelica/fmi-ls-bus