- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OMPython 'new' vs 'old' frontend code...
OMPython 'new' vs 'old' frontend code generation
OMPython 'new' vs 'old' frontend code generation
Dear all,
When trying to run a modelica model with OMPython, I get the same error messages as I would in OpenModelica with "old frontend for code generation" enabled. Unfortunately I only got this model to work in OpenModelica with this option disables, i.e. in the new frontend.
Is there a workaround to this in OMPython? Or should I debug the model in OpenModelica using the old frontend code generation?
i'm using the latest stable dev (1.15.0).
Many thanks for the help!
Cheers,
/Glenn
PS: I've also tried to generate an FMU (this also only worked in the new frontend, but then failed with e.g. pyfmi and FMU simulator - i.e. the FMU seems corrupted).
Re: OMPython 'new' vs 'old' frontend code generation
You can enable the new frontend by calling `setCommandLineOptions("-d=newInst")` from OMPython.
Adeel.
- adeas
- 454 Posts
Re: OMPython 'new' vs 'old' frontend code generation
Hi Adeel,
Is there also a way of calling `setCommandLineOptions("-d=newInst")` before creating a ModelicaSystem object?
Code:
mod = ModelicaSystem()
mod.sendExpression('setCommandLineOptions("-d=newInst")')
mod.sendExpression("loadFile(cd() + \"/mymodel.mo\")")
mod.buildModel()
Because when calling ModelicaSystem('mymodel.mo', 'mymodel') it automatically creates a new OMCSession.
Kind regards,
/Glenn
Re: OMPython 'new' vs 'old' frontend code generation
- adeas
- 454 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OMPython 'new' vs 'old' frontend code...