-
Notifications
You must be signed in to change notification settings - Fork 119
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
Can not simulate fmu file generated by OpenModelica #51
Comments
In order to If you are using windows, I guess it is just because the FMU is only exported with Disclaimer: I am not a developer of fmpy |
(generally for such general questions on FMI, Stack overflow might be a better place to ask)
The error message looks like you are trying to import an FMU with 64bit binaries only into a 32bit Python/fmpy. In order to support import of source Code FMUs, the tools need to define the files to be compiled, see p 67 of the FMI 2.0 specification https://svn.modelica.org/fmi/branches/public/specifications/v2.0/FMI_for_ModelExchange_and_CoSimulation_v2.0.pdf . This does not seem to be the case in the case of the FMU exported by OpenModelica. fmpy only claims to run source code FMUs exported from Dymola, but might to so also for FMUs by other tools if they provide the necessary information. Disclaimer: I am not a developer of fmpy |
The See FMI 2.0 Spec, 2.3 FMU Distribution:
The easiest way to simulate the FMU is to install a 64-bit Python, e.g. Anaconda. |
Thank you for your replies. My test environment is as follows: As the ticket says. FMU file should be the same-bit as the software that generating it. I have tried all four combinations (32FMU-32Python; 32-64; 64-64; 64-32 ). Every time I got the same error "Exception: The current platform (win32/64) is not supported by the FMU." I think 64-bit FMU generated by 64-bit openmodelica should work in 64-bit Python. Maybe there is some dissonance between openmodelica and FMPy. These are two FMU files, I don't how to share them efficiently. |
The FMUs you uploaded to not contain a "binaries" folder, so the do not contain any binaries for win32 or win64 nor any other binaries. This is a problem of creating FMUs from OpenModelica, not of importing and simulating them with fmpy. |
You claim that
Did you actually test it with the files you provided? |
Sorry for the wrong report bug. I installed too many versions of nigntly build OpenModelica during the test. In a previous version, the FMU export feature works fine. But after a point in time, this feature broke and the files generated are broken too. It's a bug in OM. I reinstall the stable 64-bit version OM and everything works. Thank you again for your precious time. PS: the URL in download_test_file() seems outdated. |
Hi,
I'm trying to control the simulation progress with Python, so I generated a fmu file of StableBouncingBall and import with FMPy. When I run simulate_fmu, I got an error "The current platform (win32) is not supported by the FMU". Then I read some lines of source file and added "use_source_code=True", hoping that FMPy will simulate with source-code. Then I got another error "No source files specified in the model description." But I unziped the fmu file and found .c and .h source file in the model.
The fmu file works fine in Matlab 2018 for both Co-Simulation and Model Exchange. Is there any way to solve this problem?
Best regards,
XY Fan
The text was updated successfully, but these errors were encountered: