Export Standalone FMU with External C++ Code is not working

조회 수: 3 (최근 30일)
leo troppmann
leo troppmann 2022년 10월 25일
답변: Yash 2025년 1월 20일
I tryed to implement the example: Export Standalone FMU with External C++ Code from the MathWorks page:https://de.mathworks.com/help/slcompiler/gs/export-standalon-fmu-with-external-cplusplus-code.html
even though I got the modell runing in Matlab I can not export it as an FMU. I get the following Massage:
Can anybody help me?
  댓글 수: 1
Yash Sharma
Yash Sharma 2023년 9월 5일
I encountered a similar error while following the provided documentation.

댓글을 달려면 로그인하십시오.

답변 (1개)

Yash
Yash 2025년 1월 20일
The error message indicates that MATLAB is unable to locate FMUExportWithExternalCPP.dll in its path, preventing the creation of the harness model. The current example uses the command:
exportToFMU('FMUExportWithExternalCPP', 'FMIVersion', '2.0', 'FMUType', 'CS', 'CreateModelAfterGeneratingFMU','on');
I would suggest removing the argument CreateModelAfterGeneratingFMU and manually create the harness model instead.
exportToFMU('FMUExportWithExternalCPP', 'FMIVersion', '2.0', 'FMUType', 'CS');
A possible cause for this issue might be that the system's "PATH" environment variable does not include the path to the MATLAB libraries from the specific release used for exporting the FMU, or that another version's path takes precedence. Please ensure that the path "C:\Program Files\MATLAB\<your MATLAB release>\bin\win64" (or its equivalent for your setup) is added to the environment variable and prioritized above paths for other MATLAB versions. This should help in locating the correct libraries.

카테고리

Help CenterFile Exchange에서 Call C++ from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by