- First, delete the State Writer in your Reset function subsystem.
- Go to the State Owner block (the original source) and right-click + drag from the State Owner block.
- When the context menu appears, select "Create writer block".
- Cut (Ctrl+X) the newly created State Writer.
- Navigate to your Reset function subsystem and paste (Ctrl+V) the State Writer.
Cannot locate state owner block for state writer
16 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
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:
Hope this helps, best!
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!