Skip navigation links

Package org.ptolemy.fmi

A Java interface to Functional Mock-up Interface (FMI) files.

See: Description

Package org.ptolemy.fmi Description

A Java interface to Functional Mock-up Interface (FMI) files.

A Functional Mock-up Unit (FMU) is a file that contains functionality that may be invoked either via co-simulation or model exchange. Typically, a FMU file has a .fmu extension. A FMU file is a zip file that contains a file named modelDescription.xml and one or more platform-dependent shared libraries.

The org.ptolemy.fmi package and subpackages are a BSD-licensed interface between Java and FMI.

FMI documentation may be found at


Below is a description of the packages

org.ptolemy.fmi - Read .fmu files and provide access to the data contained in the modelDescription.xml file of the .fmu file
Functional Mock-up Interface (FMI) callback functions needed by Java Native Access (JNA) so that a FMU * can perform functions like allocating and freeing memory, printing log messages and handle the end of a step.
Functional Mock-up Interface (FMI) event information.

The C language interface to Functional Mock-up Unit (FMU) files includes an structure that represents event information. This class represents that structure.
A Java Native Acess (JNA) Wrapper for a Functional Mock-up Unit shared library.
An object that represents the fmiModelDescription element of a modelDescription.xml file contained within a Functional Mock-up Unit (FMU) file.
An object that represents the ScalarVariable element of a modelDescription.xml file contained within a Functional Mock-up Interface .fmu XML file.
Parse a Functional Mock-up Interface (FMI) 1.0 Functional Mock-up Unit (FMU) file and create a FMIModelDescription for later use. The parseFMUFile() method in this class is the primary entry point into this package.
An interface that is used by Java Native Access (JNA) to handle callbacks.

This class contains implementations of methods that are registered with the FMI and then called back from by the FMI. The callback methods allocate and free memory, handle logging and are sometimes called when the step ends. For each callback we define an inner class that implements the appropriate interface and has one method that provides the body of the callback.
A Functional Mock-up Interface (FMI) log method implementation.
A Java representation for a C type size_t, which is 32 or 64 bits.

org.ptolemy.fmi.type - Data types that are passed to and from a FMU.
An Functional Mock-up Interface type that represents a Boolean.
An Functional Mock-up Interface type that represents an Integer.
An Functional Mock-up Interface type that represents a Real.
An Functional Mock-up Interface type that represents a String.
The base type of all of the other FMI types.

org.ptolemy.fmi.driver - Simple drivers for co-simulation and model exchange

The org.ptolemy.fmi.drivers package is based on FMUSDK 1.0.2 from, which has has a BSD-style license.

The code in org.ptolemy.fmi does not depend on the org.ptolemy.fmi.drivers package and thus the code in org.ptolemy.fmi is not encumbered by this license.

In FMI-1.0, co-simulation fmu files contain a modelDescription.xml file that has an <Implementation> element. Model exchange fmu files do not have this element.
A simple example that reads a co-simulation .fmu file and performs co-simulation.
The base clase for the co-simulation and model exchange drivers.
A simple example that reads a model exchagen .fmu file and performs model exchange.
Given a fmu component, output the current state.

These drivers are based on code found in FMUSDK 1.0.2. These drivers are simple examples that do not read inputs and contain other common functionality that would be used by a real system.

JUnit tests - tests

To run the tests, do:

        cd org/ptolemy/fmu
        ant test

Sample .fmu files may be found in fmu/cs and fmu/me. for the following architectures: darwin64, linux32, linux64, win32 and win64. These files were generated using a port of the FMUSDK which may be found at


This package was developed under a Department of Energy Contract for the Building Controls Virtual Test Bed (BCVTB) see

Additional support was provided by Ptolemy II, which is supported by the following organizations: The Center for Hybrid and Embedded Software Systems (CHESS) at UC Berkeley, which receives support from the National Science Foundation (NSF awards #0720882 (CSR-EHS: PRET), #1035672 (CPS: PTIDES), and #0931843 (ActionWebs)), the U. S. Army Research Laboratory (ARL #W911NF-11-2-0038), the Air Force Research Lab (AFRL), the Multiscale Systems Center (MuSyC), one of six research centers funded under the Focus Center Research Program, a Semiconductor Research Corporation program, and the following companies: Bosch, National Instruments, Thales, and Toyota.


The org.ptolemy.fmi package has the following authors.
David Broman (UC Berkeley)
Christopher Brooks (UC Berkeley)
Edward A. Lee (UC Berkeley)
Thierry Stephane Nouidui (Lawrence Berkeley National Laboratory)
Michael Wetter (Lawrence Berkeley National Laboratory)

The org.ptolemy.fmi.drivers package is based on FMUSDK 1.0.2 from


This package is delivered without support. However, the BCVTB mailing list at maybe be used for questions.

Ptolemy II 8.1
Skip navigation links