Comments (8)
In order to run
the FMU in a certain platform, it must be exported with the corresponding platform binary or with source code (optional). Details could be found here in the FMI standard: https://fmi-standard.org/docs/2.0.1-develop/#_fmu_distribution
If you are using windows, I guess it is just because the FMU is only exported with 64 bit
binary without source code, however, your python environment is in 32 bit
. See a solved issue #49
Disclaimer: I am not a developer of fmpy
from fmpy.
(generally for such general questions on FMI, Stack overflow might be a better place to ask)
Please provide more information:
- Which versions of tools are you using (32bit/64bit)?
- Could you please attach the FMU?
- Do you use a ME/CS FMU? FMI 1.0 or 2.0?
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
from fmpy.
Thank you for your reply. The FMU is exported with source code. In the dump(fmu), it said the platform is c-code and I can see all the .c and .h file within the fmu file. If the FMU is exported with binary I think there should be a dll file but there isn't.
from fmpy.
The dump()
function determines the supported platforms based on the contents of the FMU. If the source files are not specified in the modelDescription.xml it's not a valid C-code FMU.
See FMI 2.0 Spec, 2.3 FMU Distribution:
All C source file names that need to be defined in a compiler directive have to be defined in the xml-file under structure and
The easiest way to simulate the FMU is to install a 64-bit Python, e.g. Anaconda.
from fmpy.
Thank you for your replies.
I followed your instructions but still failed.
My test environment is as follows:
Lenevo laptop;
Windows 10 1809 64-bit;
Python 3.6.5 32-bit (Anaconda) and Python 3.6.5 64-bit(Miniconda) installed in different folders;
FMU file generated from the same model by openmodelica 32-bit and 64-bit.
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.
FMU files google drive
from fmpy.
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.
from fmpy.
You claim that
The fmu file works fine in Matlab 2018
Did you actually test it with the files you provided?
from fmpy.
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.
from fmpy.
Related Issues (20)
- Allow other plot libraries than Kaleido for use in Docker containers HOT 9
- Compilation error HOT 6
- fmi[2/3]CompletedIntegratorStep called regardless of needsCompletedIntegratorStep=false HOT 1
- Unable to output variables from instantiated objects in FMI 3 HOT 6
- create_fmu_container(configuration, fmufile) is working with old verion and not working with new version HOT 3
- Issues with non-integer --output-interval in ModelExchange simulation of a Buildings FMU HOT 8
- Best way to interact with a FMU HOT 1
- Display icons for Clock variables in GUI
- Add FMI 3.0 support for remoting
- No API documentation
- fmpy.sundials not importable on MacOS Apple Silicon in version 0.3.20 HOT 11
- Help!! Could anyone give me example to connect and run multi FMUs :(( HOT 1
- FMI 3 co-simulation timestepping offset by one timestep HOT 5
- Please consider using DefaultExperiment.stepSize attribute in modelDescription.xml to set output_interval in ModelExchange mode
- cant load the fmu with fmi3.0 that is exported by dymola HOT 3
- Set structural parameters in Configuration Mode
- [Question] Could I build fmpy into exe to debug my fmu? HOT 4
- Missing shared library for FMU 3.0 HOT 4
- dump function does not correctly format output for long variable names
- Example to create a simple FMU in MAC HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmpy.