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!