Unexpected code generated when subsystem is changed to atomic

1 回表示 (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2018 年 11 月 8 日
編集済み: MathWorks Support Team 2021 年 9 月 28 日
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 日
編集済み: 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 Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by