FMU2Jar

FMU2Jar is a command line utility for converting Functional Mock-up Units (FMUs) into regular Java libraries.

This allows the FMU to be loaded into an application using maven artifacts rather that referring to the location of the FMU in your app.

Furthermore, typesafe getters and setters for each variable is generated and accessiable though the API.

E.g. an FMU named “Car” containing a ScalarVariable named “speed” of type Real and causality == OUTPUT can be accessed like so:


Motor motorInstance = Motor.newInstance();
RealVariable speed = motorInstance.getOutputs().getSpeed();

FmuRead<Double> read = speed.read();
if (read.getStatus() == Status.OK) {
  System.out.println(speed.name + "=" + read.getValue());
}

FMU2Jar is available here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.