필터 지우기
필터 지우기

Why Simulink Embedded Coder Reusable functions are generated in Class private section

조회 수: 3 (최근 30일)
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?

답변 (1개)

Poorna
Poorna 2024년 5월 16일
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!

Community Treasure Hunt

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

Start Hunting!

Translated by