How can I remove real-time structures from code generated using Embedded Coder?
조회 수: 13 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2022년 11월 23일
답변: MathWorks Support Team
2023년 1월 24일
I am generating C code using Embedded Coder from a Simulink model and I need to remove the real-time structures (shown below) from the code.
With my current model settings, I am only seeing the RT_model structure in the code in the "init" and "step" functions, where they are not used for anything. The code generates like this:
/* Model step function */
void step(RT_MODEL_ADM_T *const ADM_M, BOOL_T *ADM_Y_return_value)
{
DW_ADM_T *ADM_DW = ((DW_ADM_T *) ADM_M->dwork);
….
}
/* Model initialize function */
void init(RT_MODEL_ADM_T *const ADM_M)
{
DW_ADM_T *ADM_DW = ((DW_ADM_T *) ADM_M->dwork);
….
}
Instead, I would like the code to generate like the code below:
void step(void)
{
...
}
void init(void)
{
...
}
Why are the real-time structures appearing in my code, and how can I get rid of them?
채택된 답변
MathWorks Support Team
2022년 11월 23일
This issue can be triggered in a few different ways. First, certain settings in the model's Configuration Parameters can cause the issue. In Configuration Parameters, under the Code Generation/Interfaces tab, make sure the "Code interface packaging" parameter is set to "Nonreusable.".
If that is not the issue, then check the documentation for the various blocks in your model. On the block's documentation page, under "Extended Capabilities" and "C/C++ Code Generation," ensure the blocks in your model aren't marked as "Not recommended for production code." . The "Step" block in particular is known to cause this issue. If blocks in your model are the issue, consider using alternative methods to achieve your desired functionality so that the offending blocks can be eliminated.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!