- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Error:Operator reinit may only be...
Error:Operator reinit may only be used in the body of a when equation
Error:Operator reinit may only be used in the body of a when equation
I am getting this error when trying to import an FMU and simulate it using OMPython 3.3(OpenModelica 1.17). I have also tried to import the same FMU through OMShell, but got the error "failed to build model". For the same FMU in OMEdit, whenever I click on simulate, I get the same error as OMPython and am prompted to use the old frontend. When I choose that option, the simulation works fine. Please suggest how to use the old frontend to simulate the FMU using OMPython.
Re: Error:Operator reinit may only be used in the body of a when equation
Well, you could use the command setCommandLineOptions("-d=-newInst") through OMPython. But a better solution would be to fix the code since it is not legal Modelica code.
- sjoelund.se
- 1700 Posts
Re: Error:Operator reinit may only be used in the body of a when equation
@sjoelund.se, we are generating the illegal code when we generate a Modelica model as a wrapper for the FMU.
- adrpo
- 885 Posts
Re: Error:Operator reinit may only be used in the body of a when equation
@sjoelund.se, OpenModelica version 1.17 by default has -d=newInst enabled. I need to choose the old frontend or any other work around for the abovementioned error. Both the model and fmu are generated in OpenModelica 1.17.
Re: Error:Operator reinit may only be used in the body of a when equation
What if the reinit is inside an Algorithm part?
OMPython is not allowing me to load a Model I built from scratch having this struct. I can run it perfectly in OpenModelica but not from Python (3.8).
Any ideas why?
Thank you in advance
Re: Error:Operator reinit may only be used in the body of a when equation
rasc5 wrote:
What if the reinit is inside an Algorithm part?
OMPython is not allowing me to load a Model I built from scratch having this struct. I can run it perfectly in OpenModelica but not from Python (3.8).
Any ideas why?
Thank you in advance
reinit is only allowed in equations: https://specification.modelica.org/mast … tml#reinit
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Error:Operator reinit may only be...