Error by adding block listeners and its execution

조회 수: 3 (최근 30일)
Song
Song 2016년 4월 13일
답변: Walter Roberson 2017년 5월 20일
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
Islam Bzhikhatlov
Islam Bzhikhatlov 2017년 5월 20일
when I try to read data from joint sensor I got same error, try to read data from another block.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2017년 5월 20일

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by