Why does the 'LoadFcn' Callback of a commented block get executed in Simulink R2024b?
2 ビュー (過去 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!