Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call ExternalMedia from OMPython #104

Open
freddyUC opened this issue Feb 19, 2024 · 1 comment
Open

Call ExternalMedia from OMPython #104

freddyUC opened this issue Feb 19, 2024 · 1 comment

Comments

@freddyUC
Copy link

I've tried to call ExternalMedia library from OMPython with the next commands

`
_from OMPython import OMCSessionZMQ
from OMPython import ModelicaSystem

omc = OMCSessionZMQ()

lib1 = "~LocalPath/ExternalMedia/package.mo"
model_sim = 'ExternalMedia.Test.CoolProp.CO2.TestStatesSupercritical'
mod=ModelicaSystem(lib1,model_sim, [])

mod.simulate()_
`
And I get the next message

The code execution cannot proceed because ExternalMediaLib.dll was not found. Reinstalling the program may fix this problem

I found the .dll files located in ~\ExternalMedia\Resources\Library\win64 , so I'm not sure what is the problem when loading the library.

My softwares:
Windows 11
Python 3.11
OMPython 3.4.0
OpenModelica v1.22.1

I've loaded other external libraries without any problem.

Hope you can help me!

@ibeyers
Copy link

ibeyers commented May 14, 2024

What worked for me is to copy the ExternalMediaLib.dll into the directory where my python scripts are located (which is then also my working directory).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants