- Example illustrating the Law of Large Numbers: https://www.mathworks.com/help/simulink/slref/illustration-of-law-of-large-numbers.html
- Example that implements control algorithms: https://www.mathworks.com/help/simulink/slref/enabled-subsystems.html
- An advanced example that uses both "reset" and "held" options to demonstrate their difference: https://www.mathworks.com/help/simulink/slref/advanced-enabled-subsystems.html
Completely reset nested enabled subsystems
조회 수: 40 (최근 30일)
이전 댓글 표시
Hello, currently I try to build an simulation model (fmu) containing different components of an embedded device. When the device switchs off it stores some values in non volatile memory. After startup everything is reset and the data is restored from that memory. Now I want to simulate this behaviour in the simulink model. The components itself (all designed as libraries) containining further enabled subsystems with the output ports set to held. Now I need to somehow reset not only the states in the subsystem I also need the port output values to reset to their initial value.
My problem using an parent enabled subsystem: During an On cycle the output of the enabled subsystem switches from its initial state "invalid" to "valid". In the next On cycle the port remains on valid but i need the port initially to reset until the system gets enabled.
Is there a way to get this running? From the description of conditional subsystem it seems not possible to override the childs settings. Is their another possibility to control / override the states and initial port values of enabled subsystems?
댓글 수: 0
답변 (1개)
Aravind
2024년 11월 19일 4:19
Hello @Michael,
It sounds like you are looking for a way to reset the states of an enabled subsystem each time it is enabled.
You can accomplish this by adjusting the "States when enabling" parameter of the "Enable" block within the subsystem to "reset" instead of "held." By doing so, whenever the subsystem is enabled, all the blocks within it will reset to their initial states. You can find more details in the official documentation here: https://www.mathworks.com/help/simulink/slref/enable.html#mw_ae5a05ce-5d0f-403a-ad76-9ada6908e3cb.
Setting this parameter to "reset" allows you to reset the output of the enabled subsystem to "invalid" at the start of each "On" cycle, as you described.
To help you get started with using the "reset" option of the "States when enabling" parameter of the "Enable" block, here are some examples:
I hope this helps resolve your query.
참고 항목
카테고리
Help Center 및 File Exchange에서 Subsystems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!