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!