Why do I get an error regarding a missing DLL when importing an FMU in Simulink?
32 views (last 30 days)
Show older comments
MathWorks Support Team
on 19 Apr 2018
Edited: MathWorks Support Team
on 20 Feb 2024
When opening the FMU Block parameters and choosing an .fmu file I get an error when I try to apply the change in R2018a:
Error parsing FMU 'myFMU.fmu'
Caused by:
Error in supplied FMU: Dynamic library file ('myFMU.dll') does not
exist in FMU 'myFMU.fmu'. For more information, see the FMU troubleshooting documentation.
In older releases, I can update the FMU Block parameters, but get an error when trying to simulate:
Failed to load FMU for FMU block myModel/myFMUImportBlock.
Warning: Could not find binary file for this platform.
Make sure that the FMU is supported for this platform.
However, the file 'myFMU.dll' exists.
Accepted Answer
MathWorks Support Team
on 20 Feb 2024
Edited: MathWorks Support Team
on 20 Feb 2024
In the troubleshooting section of the FMU documentation, the first suggestion is: "Check the compliance of the FMU with the FMI standard. Use the FMU compliance checker."
Here's how to perform the compliance check:
1) Access the compliance checker by clicking on the link provided in the documentation, or visit directly at: https://github.com/modelica-tools/FMUComplianceChecker/releases
2) Download the appropriate ZIP file for your operating system. For instance, if you're using a 64-bit Windows system, you might download: FMUChecker-x.x.x-win64.zip
3) Extract the contents of the zip file into the directory containing your FMU.
4) Open the Windows Command Prompt and run the checker with your FMU by typing
fmuCheck.win64.exe myFMU.fmu
Alternatively, if you're working within MATLAB, you can execute the same command using the ! operator:
>> !fmuCheck.win64.exe myFMU.fmu
5) Inspect the FMU Compliance Checker log for error messages.
In this particular case, the relevant error message could be:
[FATAL][FMILIB] The FMU contains no binary for this platform.
The error stems from a compatibility mismatch: the FMU contains a 32-bit DLL, which isn't supported by 64-bit MATLAB, or the other way around.
To resolve this, you'll need to obtain an FMU with the corresponding 64-bit DLL from the supplier (or a 32-bit one if you're using 32-bit MATLAB).
While you could use a 32-bit MATLAB version if you have R2015b or earlier, keep in mind that MATLAB has only offered 64-bit versions since R2016a. However, this is a temporary fix, and we suggest transitioning to 64-bit for a more permanent solution.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!