Stop Simulink Model Update via Callback
조회 수: 4 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
Fangjun Jiang
2024년 4월 15일
Instead of sldiagviewer.reportError(errMsg), if you do error(errMsg), it should stop.
댓글 수: 3
Fangjun Jiang
2024년 4월 15일
편집: Fangjun Jiang
2024년 4월 15일
okay, try modelName([],[],[],'term'). I think model update is equivalant as modelName([],[],[],'compile')
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!