I cannot evaluate “pauseFcn” callback by using “sim” command
Hello, I’m having issues with Simulink callbacks. I’m using MATLAB 2019a.
I have a Simulink model. I am adding a listener to an output of that model by using startFcn callback. I am expecting the model to pause when the output takes a specific value. I am implementing this algorithm inside the listener’s callback function.
When I try this from Simulink by using "Run" button, the results are as expected, i.e., model pauses and the calculations are done within the "pauseFcn". But when I use "sim(‘myModel’)" command in MATLAB, Simulink does not evaluate the pauseFcn even if the condition is triggered.
In addition, I traced the callbacks from command window. I see that, when I use ‘Run’ button, pauseFcn callback is triggered properly and commands in it are evaluated. However, when I use sim command, I see that pauseFcn callback is not triggered.
What should I do to make the model work corretly with sim command? Is this a bug?Hello, I’m having issues with Simulink callbacks. I’m using MATLAB 2019a.
I have a Simulink model. I am adding a listener to an output of that model by using startFcn callback. I am expecting the model to pause when the output takes a specific value. I am implementing this algorithm inside the listener’s callback function.
When I try this from Simulink by using "Run" button, the results are as expected, i.e., model pauses and the calculations are done within the "pauseFcn". But when I use "sim(‘myModel’)" command in MATLAB, Simulink does not evaluate the pauseFcn even if the condition is triggered.
In addition, I traced the callbacks from command window. I see that, when I use ‘Run’ button, pauseFcn callback is triggered properly and commands in it are evaluated. However, when I use sim command, I see that pauseFcn callback is not triggered.
What should I do to make the model work corretly with sim command? Is this a bug? Hello, I’m having issues with Simulink callbacks. I’m using MATLAB 2019a.
I have a Simulink model. I am adding a listener to an output of that model by using startFcn callback. I am expecting the model to pause when the output takes a specific value. I am implementing this algorithm inside the listener’s callback function.
When I try this from Simulink by using "Run" button, the results are as expected, i.e., model pauses and the calculations are done within the "pauseFcn". But when I use "sim(‘myModel’)" command in MATLAB, Simulink does not evaluate the pauseFcn even if the condition is triggered.
In addition, I traced the callbacks from command window. I see that, when I use ‘Run’ button, pauseFcn callback is triggered properly and commands in it are evaluated. However, when I use sim command, I see that pauseFcn callback is not triggered.
What should I do to make the model work corretly with sim command? Is this a bug? simulink, callback, sim, listener MATLAB Answers — New Questions