Simulink coder for model containing FMU

조회 수: 13 (최근 30일)
Francesco Passigato
Francesco Passigato 2022년 8월 24일
답변: Guru Kumaresan 2022년 9월 6일
Dear matlab support,
I am using a Simulink model containing an FMU which is created with the mutlibody simulation software MBSim.
I would like to export the whole model to an external hardware. I have found the example "Compile Source Code for Functional Mock-up Units" which relies on the example "slrt_ex_vanderpol.slx" in the directory "C:\Program Files\MATLAB\R2022a\toolbox\slrealtime\examples".
If I build C++ code from the Simulink model in this example using the Simulink coder app, everything works fine. If I do the same with my model I get the error: Error during code generation: fl:filesystem:PathNotFound
I assume that the problem is in the generation of the FMU itself, i.e. outside simulink. However, I can not figure out where the problem is. In particular, it is not clear to me how to generate the files in the "sources" directory of the example, which I expect are used to create the FMU.
Do you have any suggestions how I could get rid of this problem?
Thank you very much in advance
Best regards
Francesco

채택된 답변

Guru Kumaresan
Guru Kumaresan 2022년 9월 6일
This issue can be due any of the following:
1) Missing binaries for Simulink Real Time:
The binaries for Simulink real time must exist in the folder 'slrt_x64' inside FMU before generating code.
Refer to the following link for more information on the same:
2) Incorrect binaries present in the FMU file
This occur can occur if the file name of the binary 'binaries/slrt_x64/all.so' is incorrect in the FMU file.
The issue can be resolved by changing the binary name from the 'all.so' to 'model_name.so' in the FMU file.

추가 답변 (0개)

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by