Functional Mockup Interface
Notice: the FMI plugin as described here is "work in progress"; more features are being developed and will be made available in a future release.
Inhaltsverzeichnis
Introduction[Bearbeiten]
Functional Mockup Units are modules to simulate physical and non-physical components in an orchestrated setup. Each such module implements a well defined interface ("FMI" for Functional Mockup Interface) and is packaged in a standardized container (actually a zip container). This contains both the executable code (as binary and optional source) and a meta description, which describes the input/output parameters and other simulation details.
The motivation behind is that manufacturers of hard- and software components can provide such simulation components for their real components, and that a project engineer can use those to simulate the system in an early planing phase. This includes both fully simulated systems, but also in-the-loop setups, where simulated parts interact with real components.
FMUs in Expecco[Bearbeiten]
Expecco can load binary FMUs (i.e. ".fmu" files) and execute them within an automation or test scenario. The functionality is provided by the CBridge and an API is provided by the "FMU Interface Library". Currently, the FMI2 API is supported; FMI3 is work in progress.
Low Level Actions[Bearbeiten]
Load FMU[Bearbeiten]
The "FMU [Load]" action takes as input a filename (which can come from an attachment). It extracts th binary and the model description and loads the binary into the CBridge. The CBridge may be running on a remote host.
The action generates an FMU-Identifier at its output which is needed later to instantiate the unit.
See an example in the "FMU [Load]" action's Test/Demo page.
- Possible Errors
- 'Failed to Extract binaries/xxx'
- happens if the FMU container does not contain binaries for your architecture (for example, when executing on a MAC, but the FMU only contains compiled code for a windows machine). Either ask the developer of the FMU to provide such a version, or else execute the CBridge on such a machine (which could be a virtual machine).
Instantiate FMU[Bearbeiten]
The "FMU [Instantiate]" action takes as input an FMU-Identifier as generated by "FMU [Load]" and tells the CBridge to perform the instantiation, eventually leading to the FMU's "fmi2Instantiate()" function to be called.
The action generates a Component-identifier at its output which is needed later to interact with the unit.
In principle, an FMU can be instantiated multiple times.
See an example in the "FMU [Instantiate]" action's Test/Demo page.
Read Value[Bearbeiten]
Low level "FMU [Get XXX Value]" call directly into the FMU's "fmi2GetXXXValue()" functions, to retrieve Booleans, Integers, Reals or Strings by an integer variable-reference index.
Medium level "FMU [Get Value by Name]" use the model description to determine the type and reference index. So variables can be retrieved more conveniently by name.
See an example in the "FMU [Get Value by Name]" action's Test/Demo page.
Write Value[Bearbeiten]
Similar to the above, both setters by index and setters by name are provided.
See an example in the "FMU [Set Value by Name]" action's Test/Demo page.
Simulation[Bearbeiten]
High Level Usage[Bearbeiten]
Generate FMU Actions[Bearbeiten]
This is invoked via the "Extra"- "Generate" menu of the attachment editor's own toolbar (i.e. this is not the main toolbar, but the editor's toolbar at the right).
It reads a modelDescription and generates a separate library containing all required actions to load, instantiate and execute an FMU within any activity diagram.
This is "work in progress".
Future[Bearbeiten]
This is a first version of the FMU support inside expecco, providing mechanisms to execute FMU's and to connect I/O variables inside a single running expecco application.
Orchestration[Bearbeiten]
There exists (currently) no orchestration or interprocess communication mechanisms to distribute FMUs among remote machines. This will be added in a future version. However, by providing a forwarding mechanism, such inter-FMU communication can be implemented even on top of the current system.
Expecco as FMU[Bearbeiten]
In development are mechanisms to allow for an FMU to be implemented as an activity (compound action), and allow for an orchestrator to integrate this transparently into a network of communicating FMUs.