Unexpected code generated when subsystem is changed to atomic
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!