Skip to content

About

A Code Generator that creates native C/C++ code to build Functional Mock-Up Units (FMU) with support for FMI version 2.0 (rollback)

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

224 Commits

Folders and files

Repository files navigation

About the FMI Code Generator

What is this FMI/FMU stuff?

FMU stands for Functional Mockup Unit and FMI for Functional Mockup Interface. The latter is an industry standard for simulation model runtime coupling, and basically defines an API and a meta data description file and directory structure: see FMI-Standard webpage for details.

The Motivation - What is the FMI Code Generator

When you want an efficient/fast FMU slave, there's probably no way around a native C/C++ implementation. However, implementing the C interface functions, the data handling, input/output variable handling and advanced features like saving and restoring the FMU state is not so simple and straight-forward.

However, the process of setting up the FMU (core files, modelDescription.xml, directory structure) is pretty similar for most projects and can be automated with a configurable code generator - hence this project.

What FMI Code Generator is not

This is not a Software Development Library/Toolkit for accessing/supporting the FMI interface. Look at the FMU SDK or other projects on fmi-tools if you need something like that.

Actually, the code generated by FMI Code Generator hides most of the messy FMI C function interface (including most of the memory management related to instantiating/deleting slave instances, and the state storage stuff) from the typical (engineering) user. Also, the generated code is pretty small, easy to read and comprehend and works cross-platform without any library setup issues.

About me

I'm working with FMI since 2009, and also authored the co-simulation master tool MasterSim. I'm doing quite a lot of other stuff as well, see my blog page Schneggenport.

FMUs generated with the FMI Code Generator and run with MasterSim allow for very efficient simulation coupling (even real-time applications), so give it a try!

The (anticipated) use of the FMI Code Generator

Variable definitions Generator successfully generated and compiled FMU

See description of Test scenario: Stateless P-controller for a step-by-step tutorial.

A general description of the software, the installation and and how to use it, can be found on the project's webpage.

License

The FMICodeGenerator is provided under a BSD 3-Clause License.

Developer Information

See AGENTS.md for a summary.

About

A Code Generator that creates native C/C++ code to build Functional Mock-Up Units (FMU) with support for FMI version 2.0 (rollback)

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages