FMU-proxy (work in progress)
The main goal of the Functional Mock-up Interface (FMI) standard is to allow simulation models to be shared across tools. To accomplish this, FMI relies on a combination of XML-files and compiled C-code packaged in a zip archive. This archive is called a Functional Mock-up Unit (FMU) and uses the extension .fmu. In theory, an FMU can support multiple platforms, however this is not always the case and depends on the type of binaries the exporting tool was able to provide. Furthermore, a library providing FMI support may not be available in a particular language or platform, and/or it may not support the whole standard. Another issue is related to the protection of Intellectual Property (IP). While an FMU is free to only provide the C-code in its binary form, other resources shipped with the FMU may be unprotected.
In order to overcome these challenges, we present an open-source framework for working with FMUs across languages and platforms.
FMU-proxy is different from other frameworks for distributed FMU invocations such as DACCOSIM, FMI GO! and Coral in that it completely separates itself from the master algorithm (logically and physically). FMU-proxy is a completely standalone project, which provides access to FMUs over the wire. And just that.
The idea is that other applications should use FMU-proxy whenever FMUs are required to run distributed, rather than having each application creating their own solution.
fmu-proxify is a CLI that transforms a co-simulation FMU compatible with either version FMI 1.0 or 2.0 into a proxified version of the same FMU. Internally, the proxy FMU wraps the original FMU in a server program. Each new instance of the original FMU runs in a separate process.
This allows you to:
- Import FMI 1.0 models in software that otherwise only supports FMI 2.0.
- Instantiate multiple instances of FMUs that only allows one instance per process.
- The ability to run the FMU on some remote resource
- Which in turn allows FMUs to run on otherwise unsupported platforms.
Usage: fmu-proxify [-h] [-d=<destFile>] [-r=<remoteAddress>] FMU-FILE FMU-FILE Path to the FMU to proxify. -d, --dest=<destFile> Where to save the FMU (defaults to current folder). -h, --help Print this message and quits. -r, --remote=<remoteAddress> Optional host to connect to. e.g. 127.0.0.1:9090
By default, the generated FMU seemingly behaves like a regular FMU. However, internally the FMU is communicating with the original FMU over TCP/IP. When targeting localhost, this all happens automatically.
Running the FMU on another computer
The target computer needs to start fmu-proxy.jar
java -jar fmu-proxy.jar <port>
Generate the FMU with the option
(or modify proxySettings.txt inside an existing FMU)
Load the FMU as usual.
FMU-proxy relies on Java and thus requires a suitable environment to run.
- JAVA_HOME should point to a JDK8+ installation.
- %JAVA_HOME%\jre\bin\server must be added to PATH.
On linux things should just work after installing the JDK.
- Hatledal, Lars Ivar, et al. "FMU-proxy: A Framework for Distributed Access to Functional Mock-up Units." Proceedings of the 13th International Modelica Conference, Regensburg, Germany, March 4–6, 2019. No. 157. Linköping University Electronic Press, 2019.
- Hatledal, Lars Ivar, et al. "A Language and Platform Independent Co-Simulation Framework Based on the Functional Mock-Up Interface." IEEE Access 7 (2019): 109328-109339.