Initialize, Reinitialize, Reset, and Terminate Functions without stateflow.
조회 수: 6 (최근 30일)
이전 댓글 표시
I am trying to reset multiple states inside a model using one of the simulink block mentioned in the title.
The issue, is that I do not understand how to trigger the event (i.e., the reset). The only examples from mathworks I am able to find are using stateflow to trigger the event, which is not part of my tool suite.
댓글 수: 1
Lucky
2025년 6월 10일
It sounds like you're trying to reset multiple states in a Simulink model using one of the "Resettable Subsystem" or "Triggered Subsystem" blocks, but without using Stateflow
답변 (1개)
Aabha
2025년 6월 12일
You can implement ‘initialize’, ‘reinitialize’, ‘reset’, and ‘terminate’ functions in Simulink without using Stateflow by using a combination of ‘Initialize’, ‘Reset’, and ‘Terminate Function’ blocks, available in Simulink ‘Function-Call Subsystems’.
During simulation, you can reset the state of a block using a 'State Writer' block. To control when reset occurs, use a ‘Reset Function’ block. To configure the reset conditions, open the Reset Function block, and model reset conditions using a ‘State Writer’ block inside. Once that is done, make sure to connect the state writer with the state owner.
Please refer to the following link that demonstrates an example of Using Initialize, Reinitialize, Reset, and Terminate Functions, without Stateflow: https://www.mathworks.com/help/releases/r2025a/simulink/ug/initialize-blocks-with-state.html
Additionally, to reset multiple internal states, an alternative approach is to use a 'Resettable Subsystem'. This subsystem resets all blocks inside it when a signal triggers the 'Reset Port'. You can trigger the reset of a resettable subsystem using any boolean signal such as a comparison logic, manual switch, a function-call subsystem output, etc. A rising/falling edge on this signal will reset all the internal states.
Please refer to the following documentation link to understand more about how resettable subsystems can be implemented: https://www.mathworks.com/help/releases/r2025a/simulink/ug/reset-block-states-in-a-subsystem.html
I hope this helps.
참고 항목
카테고리
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!