NTNU-IHB / PythonFMU

A lightweight framework that enables the packaging of Python3.x code as co-simulation FMUs
MIT License
133 stars 38 forks source link

generated .fmu file is not runnable in Matlab/Simulink #222

Open hongbiaozhu opened 5 days ago

hongbiaozhu commented 5 days ago

Hi, I generated a .fmu file according to the tutorial then imported to the Matlab/simulink, but matlab will crash after running it.

Nils12345678901234567 commented 5 days ago

We experienced the same. The FMU ran once, then MATLAB would crash on the second run.

Have a look at this setting: https://se.mathworks.com/help/simulink/gui/fmuimportblocks.html;jsessionid=8d5c9ea364961b4142a101596f3b

I MATLAB use the command: set_param(gcs, 'DebugExecutionForFMUViaOutOfProcess','on')

This fixed the problem for us.

hongbiaozhu commented 4 days ago

Thanks for replying. Yeah, it did fix the crash issue. Unfortunately, there is still an error after running it:

image

(and i actually selected the "Enable FMU Debug Logging" box, but i didn't see any useful FMU log, thus didn't know how to debug this .fmu further)