Simulink coder for model containing FMU

7 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Create Standalone FMU 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by