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

Anyone simulated an FMU with inputs in openmodelica?

Anyone simulated an FMU with inputs in openmodelica?

Hello,
I have built model of a discrete controller which changes states on the basis of its inputs. It worked fine as a modelica model. I then exported it as an FMU and then re-imported it in openmodelica. Now when I am trying to simulate this re-imported FMU, I am not getting the desired results.
The imported FMU model has some code lines like this
{fmi_input_cmd, fmi_input_windowState} = fmi1Functions.fmi1SetInteger(fmi1me, {2.0, 3.0}, {cmd, windowState});
and it looks that the "fmi_input_cmd" variable should follow the "cmd" variable that is provided to the FMU externally; but it doesn't. In fact, I have two integer inputs and one boolean but none of the internal "fmi_input_variable" follows the connected external inputs.

Can anyone help?

Thanks

Re: Anyone simulated an FMU with inputs in openmodelica?

Can you send me your actual modelica model? adeel.asghar at liu.se

Adeel.

Re: Anyone simulated an FMU with inputs in openmodelica?

Note that fmi_input_* are just dummy variables to make the modelica models valid. They are not supposed to follow the actual input values. You must see the values of cmd & windowState and make sure they are set properly.

Re: Anyone simulated an FMU with inputs in openmodelica?

Then it must've something to do with the when statements.

Adeel, I am sending you a very simple example with a single when condition. I hope you can find out the problem.

Thanks.

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