Why does the 'LoadFcn' Callback of a commented block get executed in Simulink R2024b?
조회 수: 3 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2016년 11월 14일
편집: MathWorks Support Team
2024년 11월 12일
Why does the 'LoadFcn' Callback of a commented block get executed in Simulink R2024b?
채택된 답변
MathWorks Support Team
2024년 11월 6일
편집: MathWorks Support Team
2024년 11월 12일
As for Simulink R2024b, this is the expected behavior.
We can classify the block callbacks in two categories: edit time and run time.
Edit time callbacks like the 'LoadFcn' callback need to execute even if the block is commented out. Just to display the commented block in the model, the block needs to be loaded, and the load callback is triggered. A similar behavior is observed with the 'DeleteFcn' and 'DestroyFcn' callbacks.
On the other hand, callbacks that are runtime (not needed for editing) like 'InitFcn' and 'StartFcn' are not triggered for commented out blocks and inactive variants.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!