Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

How should be used FMUs for Co-Simulation with Boolean Inputs?

How should be used FMUs for Co-Simulation with Boolean Inputs?

Hello,
I tried to use a FMU CS with a Boolean input. I was able to set the input value only once. The second call of fmu2SetBoolean() failed. I reduced the original model to the trivial case:

model ErrCSBooleanInput
  input Boolean MODE;
  parameter Real a = -1.0;
  parameter Real b = 1.0;
  output Real y;
equation
  y = if MODE then a else b;
end ErrCSBooleanInput;

I generated FMU 2.0 for Co-Simulation using OMEdit v1.12.0-dev-85-g1ca860b (32-bit). When it is runned in the last version of FMU checker on Windows by

fmuCheck.win32.exe -i input.txt ErrCSBooleanInput.fmu

the following error is reported (the complete list is longer):
    [FMU][logStatusError][FMU status:Error] fmi2SetBoolean: Illegal call sequence. fmi2SetBoolean is not allowed in Continuous-Time Mode state.
[FATAL][FMUCHK] Simulation loop terminated  at time 0.002 since FMU returned status: Error
    [FMU][logStatusError][FMU status:Error] fmi2Terminate: Illegal call sequence. fmi2Terminate is not allowed in Error state.
[ERROR][FMUCHK] fmiTerminateSlave returned status: Error

The contents of the input.txt file was:

time,MODE
0.1,0
0.2,0
0.3,1
0.4,1

I would appreciate any explanation of this error. I expected that Continuous-Time Mode is available only in FMI for Model Exchange (see the FMI 2.0 specification).
Thank you in advance.

Best Regards
Pavel Balda

There are 0 guests and 0 other users also viewing this topic
You are here: