Cannot locate state owner block for state writer

조회 수: 10 (최근 30일)
Williem
Williem 2025년 3월 26일
댓글: Williem 2025년 4월 2일
Hello,
When I try to run my simulation I get the error :
Error:Cannot locate state owner block for State Reader or State Writer block xxxx within model 'xxx'. However, when I look at the specific state-writer I can see that it is connected. Then when I open the state writer and click highlight it brings me to the corresponding state owner and I can run the simulation with no errors. The issue is I have to keep on doing this everytime I open up the simulation file again, which is an extra step that takes extra time.
For extra context, the state writer is in a "Reset function" subsystem, which is part of a mask in a custom library.
Does anybody know what the issue could be?

답변 (1개)

Zinea
Zinea 2025년 3월 30일
The error you are facing is because the State Writer is placed in a masked subsystem. In order to resolve this you can follow the following steps:
  1. First, delete the State Writer in your Reset function subsystem.
  2. Go to the State Owner block (the original source) and right-click + drag from the State Owner block.
  3. When the context menu appears, select "Create writer block".
  4. Cut (Ctrl+X) the newly created State Writer.
  5. Navigate to your Reset function subsystem and paste (Ctrl+V) the State Writer.
Hope this helps, best!
  댓글 수: 2
Zinea
Zinea 2025년 4월 2일
Was the issue resolved? If not, please share your model for reproduction at my end.
Williem
Williem 2025년 4월 2일
yes that worked. Thanks!

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

카테고리

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

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by