OpenModelica


Forgot password? | Forgot username? | Register

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).

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OMPython 'new' vs 'old' frontend code generation

You can enable the new frontend by calling `setCommandLineOptions("-d=newInst")` from OMPython.

Adeel.

Administrator has disabled public posting. Please login or register in order to proceed.

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

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OMPython 'new' vs 'old' frontend code generation

Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests and 0 other users also viewing this topic
You are here: