Why does the 'LoadFcn' Callback of a commented block get executed in Simulink R2024b?
26 views (last 30 days)
Show older comments
MathWorks Support Team
on 14 Nov 2016
Edited: MathWorks Support Team
on 12 Nov 2024 at 19:13
Why does the 'LoadFcn' Callback of a commented block get executed in Simulink R2024b?
Accepted Answer
MathWorks Support Team
on 6 Nov 2024 at 0:00
Edited: MathWorks Support Team
on 12 Nov 2024 at 19:13
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 Comments
More Answers (0)
See Also
Categories
Find more on Simulink Environment Customization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!