How can I generate code using embedded coder for a model that I have as FMU (FMU import block or otherwise) ?
Show older comments
Hello! I have a model delivered as an FMU from our supplier. Thanks to the recently new FMU import block, I have been able to use this on my desktop simulations using Simulink. However, I would like to generate code for this using embedded coder for a specific target. I noticed that code generation support field was left blank in one of the help/documentation files from Matlab. Link here
How could I generate code for this FMU? Is there any other way such as using an S-function, instead of FMU import block? Any insight here would be helpful.
Thanks for your help! Regards, Kallur
2 Comments
Chris Williams
on 25 Mar 2020
Hi Kallur. Did you ever solve this problem? I am in a similar situation: 3rd party delivers a model as FMU, now I'd like to compile it but the Diagnostic Viewer says that the FMU does not support code generation...
Kind regards, Chris
Mutlu Senturk
on 6 Jul 2021
Has anybody had that issue resolved yet? I'm having the same problem with the FMU model provived by te Supplier, I could not generate C-code.
Thanks
Answers (1)
Yash
on 16 Feb 2025
0 votes
Code generation for Simulink model with FMU block is supported. Here's the details:
- FMI Version 3.0 is supported from MATLAB R2024a and onwards: https://www.mathworks.com/help/releases/R2024a/simulink/ug/work-with-fmi-in-simulink.html#bu4hna2
- FMI Version 2.0 is supported from MATLAB R2023b and onwards: https://www.mathworks.com/help/releases/R2023b/simulink/ug/work-with-fmi-in-simulink.html#bu4hna2
- FMI Version 1.0 is supported from MATLAB R2023b and onwards: https://www.mathworks.com/help/releases/R2023b/simulink/ug/work-with-fmi-in-simulink.html#bu4hna2
- From R2020b till R2023a, FMI Version 1.0 was supported for code generation target slrealtime.tlc in Co-Simulation mode only: https://www.mathworks.com/help/releases/R2023a/simulink/ug/work-with-fmi-in-simulink.html#bu4hna2
Categories
Find more on FMU Importing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!