Why Simulink Embedded Coder Reusable functions are generated in Class private section
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all,
In simulink 2023 i have subsystem defined as resuble function. After code generation this function goes to class private member functions section. I want to use function for other areas/codes. Is there any way create reusable function outside of class?
*2018 version this reusable function created in <modelName>_private.h header file. Can we do same thing in 2023?
0 Kommentare
Antworten (1)
Poorna
am 16 Mai 2024
Hi Kraker,
Reusable subsystem functions are modeled as private member functions of the Model class as far as I know. If possible they will be generated as static private member functions. You can refer to this release notes: https://www.mathworks.com/help/ecoder/release-notes.html?&searchHighlight=#mw_6f37ccc3-f863-4521-99ba-37b24afbcab4
You can modify the Code Interface Packaging setting from "C++ Class" to either "Reusable function" or "NonReusable function" depending on the use case. This will ensure that the subsystem functions are declared in the <Model>_private.h header which will enable you to reuse the functions outside the generated code.
To know more about the Code Interface Packaging setting, refer to the following documentation:
Hope this Helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Simulink Coder finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!