Hopsan / hopsan

Hopsan is a free multi-domain system simulation tool developed at the division of Fluid and mechatronic systems at Linköping university.
Apache License 2.0
146 stars 41 forks source link

Failed to load .dll of generated FMU #2187

Closed till12mann closed 7 months ago

till12mann commented 7 months ago

I created an FMU using pythonfmu, but when I try to import it into Hopsan it says :

image

Any Ideas how I can fix that ?

robbr48 commented 7 months ago

I have never worked with pythonfmu, have you tried to validate the FMU using one of the tools listed here?

https://fmi-standard.org/validation/

If validation passes, can you attach the FMU so we can have a look at it? (or send it privately if it is confidential)

till12mann commented 7 months ago

@robbr48 I created a very simple one. Just two inputs and one output. If i check it with that tool it says :

ModelStructure/InitialUnknowns does not contain the expected set of variables. Expected {intOut} but was {}.

fmu2.zip

robbr48 commented 7 months ago

I tried to check the FMU using FMI Compliance Checker, and it says there is a dependency missing. According to dumpbin, the FMU requires python3.dll. Do you have Python 3 on system path? You could also try to manually copy python3.dll to the hopsan/bin folder.

till12mann commented 7 months ago

Alright, after manually copying the .dll file to the hopsan/bin folder, I can now simulate my model. Unfortunately, it's not doing the multiplication I intend to do. I also switched the multiplication into the do_step() but that didn't change anything. Where do I program the functionality of the FMU?