How can I conditionally disable callbacks during a model build in Simulink?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 15 Fév 2013
Modifié(e) : MathWorks Support Team
le 6 Juin 2023
I have a Simulink model in Simulink version R2023a that has many callbacks. As a result, opening, editing, and saving it is very slow. Most of the time I do not want to run the model, I just want to make some edits and this is slowing my work significantly.
Is there any way to temporarily disable callbacks in a model?
Réponse acceptée
MathWorks Support Team
le 6 Juin 2023
Modifié(e) : MathWorks Support Team
le 6 Juin 2023
Unfortunately, there isn't a way to ignore the model callbacks when building a model as of Simulink version R2023a. To work around this issue you can create a MATLAB script that 'strips' or comments out the callbacks.
For example, below is an example to strip the 'InitFcn' of a model (saved in 'mdl') and then put it back:
>> origCB = get_param(mdl,’InitFcn’);
>> set_param(mdl,’InitFcn’,’’); %Disable initFcn
>> % Do something here
>> set_param(mdl,’InitFcn’,origCB) %Enable initFcn
If you have many callbacks, you can find them using the 'Callback Tracer'. You can also find the slowest callbacks and only disable those. Please refer to the following documentation page for more information on the 'Callback Tracer'
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Simulink Environment Customization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!