Unexpected code generated when subsystem is changed to atomic

1 次查看(过去 30 天)
In my model, I set two signals as test points. When I proceed to generate code, the code is as expected. When I change one of the subsystems in the model to 'Atomic', I seem to observe some extraneous code generated (see below). Why does this happen

采纳的回答

MathWorks Support Team
编辑:MathWorks Support Team 2021-9-28
The C-API generates code for all signals, not just test points. The reason you are seeing new signals appear is because when the subsystem is made atomic, some signals that were previously virtual become non-virtual and thus show up in the C-API. For more information on Virtual signals, please review the following documentation page: https://www.mathworks.com/help/simulink/ug/signal-types.html
However, these signals will not appear when generating code using Embedded Coder as it employs optimizations not available in Simulink Coder to make the generated code more efficient. Consider using Embedded Coder if the aim is to eliminate these extraneous signals. 

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

产品


版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by