Why does the output of an If Action Subsystem seem to hold the last computed value?
조회 수: 6 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2021년 6월 25일
답변: MathWorks Support Team
2021년 9월 16일
I am using a couple If Action Subsystems with an If block in Simulink. I have connected the outputs of the If Action Subsystems to a scope block, and the results I see are not what I was expecting.
The If Action Subsystems seem to hold the last-known value rather than resetting to zero. This means I can't add the outputs to achieve my desired output. How can I make these signals reset to zero when the subsystem isn't active?
채택된 답변
MathWorks Support Team
2021년 6월 25일
This behavior is by design. We recommend using a Merge block to consolidate the outputs from If Action Subsystems, as the Merge block will automatically select the most recently-computed input as its output.
For more information about the Merge block, please see the following documentation page: https://www.mathworks.com/help/simulink/slref/merge.html
The following documentation page provides usage examples for the If Action Subsystems, with the recommended workflow of using a Merge block to consolidate the signals:
There is a way to force the individual If Action Subsystem outputs to reset to 0 or another provided value when they are no longer active.
To define this reset behavior:
1. Double click on one of the If Action subsystems
2. Double click on the Out block inside the subsystem (Out1 by default)
3. Select "Output when disabled" to be "reset" instead of "held"
4. Define Initial Output as 0 or another desired value to reset to
5. Do the same workflow for the other If Action subsystems
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subsystems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!