Hello, I tried to add a block listener in model's StartFcn (please take look at my simple model file in attachment), but I got a error
Error evaluating 'StartFcn' callback of block_diagram 'simpleMdl'.
Caused by:
Can add listener only when block diagram is executing.
I debugged a little, it seems that error is related to the second block (idx == 2). If I change the idx from [1 2 3] to [1 3], no error happens if I press the model's start button, but still the listener callback won't be executed.
Am I doing something wrong in code? How can I specify the exec. block callback?
Thank you very much.
1 Comment
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/278869-error-by-adding-block-listeners-and-its-execution#comment_455373
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/278869-error-by-adding-block-listeners-and-its-execution#comment_455373
Sign in to comment.