Opened 4 years ago

Closed 3 years ago

#6084 closed discussion (fixed)

Use of function convertMo2Fmu

Reported by: ankit.agarwal092@… Owned by: arun3688
Priority: high Milestone: NeedsInput
Component: OMPython Version: v1.17.0-dev
Keywords: FMU generation Cc:

Description

Dear developers,

I have 2 queries:

  1. I am trying to use convertMo2Fmu function in my python script. On the github file _init_.py, it states that it is not possible to pass any argument to convertMo2Fmu function. The default FMI type is ME, but how can I pass argument to compile FMU as cosimulation. Because convertMo2Fmu function calls translateModelFMU of Openmodelica, where arguments can be passed. Is there any way to pass similar argument somehow via convertMo2Fmu function? I am calling it this way:

import OMPython
from OMPython import ModelicaSystem
fmodelica = 'test.mo'
load_modelica = ModelicaSystem(fmodelica, 'test', Modelica?)
ffmu = load_modelica.convertMo2Fmu()

Is it possible to pass argument here such that it creates co-simulation fmu?

  1. If I have developed a modelica model (A.mo), which uses external library and not standard modelica library (let's say folder B which contains package.mo), then how can I load that? I tried using B as well as package.mo as the third arguments, but does not seem to work.

import OMPython
from OMPython import ModelicaSystem
fmodelica = 'test.mo'
load_modelica = ModelicaSystem(fmodelica, 'test', B?)
ffmu = load_modelica.convertMo2Fmu()

Thanks a lot in advance!

Best regards,
Anki

Change History (2)

comment:1 Changed 3 years ago by adrpo

comment:2 Changed 3 years ago by adrpo

  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from v1.14.1 to v1.17.0-dev

Now you can add all the parameters from OMC API translateModelFMU to the OMPython convertMo2FMU function.

Note: See TracTickets for help on using tickets.