OMSimulator icon indicating copy to clipboard operation
OMSimulator copied to clipboard

Error when instantiating DualMassOscillator FMU on Windows

Open cofri opened this issue 4 months ago • 4 comments

Description

Hello OMSimulator team,

Thanks for your software! It's an enjoyable work. I'm trying to run the Dual Mass Oscillator example available in testsuite/resources/. It runs as expected on Linux but it fails on Windows 11 with the following error:

Failed to load DLL C:\Users\myname\AppData\Local\Temp\fmi4c_490C.tmp\binaries\win64\DualMassOscillator_System1.dll

I also tried with other Python tools like FMPy and I got the same behaviour:

# Error with FMPy
FileNotFoundError: Could not find module 'C:\Users\myname\AppData\Local\Temp\tmp57q2vgz9\binaries\win64\DualMassOscillator_System1.dll' (or one of its dependencies).

Steps to reproduce the behavior

from OMSimulator import OMSimulator

oms = OMSimulator()
oms.setTempDirectory("./temp/")
oms.newModel("model")
oms.addSystem("model.root", oms.system_sc)

oms.addSubModel("model.root.system1", "./DualMassOscillator.System1.fmu")

oms.instantiate("model")  # <-- fail here
oms.initialize("model")

oms.terminate("model")
oms.delete("model")

Version and OS

  • Version: v2.1.3
  • OS: Win11, 64bit

cofri avatar Aug 11 '25 15:08 cofri