- 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
42 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Aravind
on 19 Nov 2024 at 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.
See Also
Categories
Find more on Subsystems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!