OMPython
OMPython copied to clipboard
ModelicaSystem does not return from call
Running the bouncingBall script on a Docker container with Debian and OMModelica installed appears to set up the OMC server but the ModelicaSystem call isn't returned:
omc = OMCSessionZMQ() 2019-10-02 14:56:49,581 - OMPython - INFO - OMC Server is up and running at file:////tmp/openmodelica.darren.port.b1050fd2bee2410895097c0fdfd303a7 pid=294 mod = ModelicaSystem("BouncingBall.mo", "BouncingBall", ["Modelica"]) 2019-10-02 14:57:03,275 - OMPython - INFO - OMC Server is up and running at file:////tmp/openmodelica.darren.port.9edb9d062daf471dbefac6523603800c pid=315
But there is no return to the prompt. Ctrl-C gives the following traceback:
^CTraceback (most recent call last):
File "
Thanks
@alidaf I think you have not import ModelicaSystem class, OMCSessionZMQ and ModelicaSystem are two different classes
>>> from OMPython import OMCSessionZMQ
>>> omc =OMCSessionZMQ()
>>> omc.sendExpression("getClassNames()")
To use ModelicaSystem you need to import like this
>>> from OMPython import ModelicaSystem
>>> mod = ModelicaSystem("BouncingBall.mo", "BouncingBall", ["Modelica"])
>>> mod.sendExpression("getClassNames()")
HI, That's not it. I have run the script on a host system with no problems.
I've traced the problem to here (line 742):
def buildModel(self):
# buildModelResult=self.getconn.sendExpression("buildModel("+ mName +")")
buildModelResult = self.requestApi("buildModel", self.modelName)
@alidaf But you are not getting any errors when running from normal host systems, with the same line
None. I can give you the dockerfile if you want to create one to try.
yes you can give me the docker file and i see if i can find something