Stop Simulink Model Update via Callback

조회 수: 4 (최근 30일)
RIchard
RIchard 2024년 4월 15일
편집: RIchard 2024년 4월 16일
I have a callback on a custom block that checks a bus selector for missing signals, at the start of the model update routine. Based on the results of that update, I send an sldiagviewer.reportError(errMsg) command to Matlab. What I want it to do is stop the update cycle at that point because I know it will throw an error downstream in ~5 minutes where the user will have to fix the problem. Instead, Simulink just continues runnign the update cycle until Simulink decides it cannot continue anymore.
So my question is basically how to stop the update cycle?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2024년 4월 15일
Instead of sldiagviewer.reportError(errMsg), if you do error(errMsg), it should stop.
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2024년 4월 15일
편집: Fangjun Jiang 2024년 4월 15일
okay, try modelName([],[],[],'term'). I think model update is equivalant as modelName([],[],[],'compile')
RIchard
RIchard 2024년 4월 16일
편집: RIchard 2024년 4월 16일
Your orignal comment is correct and I have accepted it. Somehow, I was incorrectly calling `error`, and it was going to the matlab version instead of simulink.

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by