modelica / fmi-standard

Specification of the Functional Mock-up Interface (FMI)

Home Page:https://fmi-standard.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarify allowed call sequence after fmi3Error has been returned

t-sommer opened this issue · comments

The Common State Machine defines that the FMU enters the Terminated state when

a function call for this instance returns fmi3Error

In the Terminated state it is still allowed to retrieve values of variables:

[If Terminated is entered because of an fmi3Error return value, retrieved values should only be used for debugging purposes.]

However the description of fmi3Error suggests that only fmi3SetFMUState, fmi3FreeInstance, or fmi3Reset may be called:

[...] The output argument values are undefined and the simulation must not be continued. [...] If a function returns fmi3Error, it is possible to restore a previously retrieved FMU state by calling fmi3SetFMUState. Otherwise fmi3FreeInstance or fmi3Reset must be called.

It is also not defined what "the simulation must not be continued" means in terms of allowed function calls.

See also #1934.

FMI Design Meeting:
Pierre: I do not think this prohibits the call of the other functions ... the "otherwise ... mus be called ..." is problematic.
Torsten: eventually or immediatley
Pierre: we should spell out that it is allowed to get values. ...
Karl: The FMU might have had several problems ...
Pierre: We did not want to prohibit calls ... you can get errors. One should be able to get values e.g. for debugging ....
Torsten: there are more getXXX functions that should be clarified. What does "continue the simlation" mean?
Karl: Setting values
Pierre: in Terminate state it is well defined. We have to clarify that if you get an fmi3Error, you must go to "Terminated.
Torsten: in case of an error you enter the "Terminated" automatically with some restrictions on the call.
Pierre: we should say, the "output values of the functions are undefined" and the FMU enters the "Terminated state." It is still possible to call fmi3getFmuState
Torsten: in the other case #1934 the importer should call "Terminated" immediately, and remove restrictions.
@t-sommer : I can create a PR