Skip to content

Commit

Permalink
Merge pull request #74 from modelica/feature/functions-to-implement
Browse files Browse the repository at this point in the history
Add section on which functions to implement
  • Loading branch information
chrbertsch authored Jan 28, 2025
2 parents 50baf5f + 7185184 commit 237a4b9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions fmi-guide/3___packaging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,27 @@ For example, an FMU function must not change the current working directory of th

FMU funtions can, on the other hand, change the floating point control word of the CPU during their execution, since this is directly tied to the thread of execution.
However they must restore the floating point control word before returning, so as to not affect state outside of the current thread of execution.

=== API Function Implementation

The FMI standards specify which functions of the API an FMU has to implement:

FMI 3.0::
The standard since release 3.0.1 clearly specifies that all functions specified in the standard are to be present in an FMU.
In the initial 3.0 release, this specification was ambiguous: While the intent always was for all functions to be present, it could be read as only requiring the functions of those interface types the FMU supports having to be present.
In any case all functions for optional features have to be present.

FMI 2.0::
The standard requires all functions of FMI for Co-Simulation, or all functions of FMI for Model Exchange, or both, to be present.
All functions for optional features have to be present.

FMI 1.0::
The standard does not explicitly state the requirements of function implementation.
However it can be assumed that all functions of FMI for Co-Simulation, or all functions of FMI for Model Exchange, or both, have to be present.
The requirements for optional features are unclear.

Independent of the normative situation, it is recommended that importers refrain from relying on the presence or particular behavior of functions that are not needed for the operation of the FMU.

Similarly it is recommended that exporters always generate all functions specified in the relevant standards.
Unsupported feature and interface type functions should be implemented to return an appropriate error code (e.g. `fmi3Error`) when called, after logging the reason for the error.

0 comments on commit 237a4b9

Please sign in to comment.