Nested enabled subsystem in Simulink

11 views (last 30 days)
jonatan blom
jonatan blom on 8 Mar 2019
Answered: Claudio Rey on 21 Apr 2020
Hi,
I have a model which contains two nested enabled subsystem.
The inner subsystem is set to "States when enabling: Reset" and the outer "States when enabling: Hold" . But when the outer subsystem is disabled and the inner still enabled the inner resets its states.
I want the inner subsystem to reset only when its enable signal transitions from false to true.
I have tried to put the inner subsystem in an atomic subsystem but still the same behavior. How can I solve this?
Kind regards Jonatan

Answers (2)

Claudio Rey
Claudio Rey on 21 Apr 2020
I have been investigating behaviors with nested enables as I want to emulate using clock valid signals, Clock valid signals do not reset the states. However I want to reset the block periodically as well to simulate the effect of resetb. This is essential on getting state machines to reset when the system is re-enabled. to emulate clock valid signals I use an enable that holds the states, this works. To emulate resetb I use an enable that resets the block and I modifiy the output ports to also reset. Well the combination does not work. if you put the held enable block on the outermost level then the internals reset even when they are told to hold, even when the outermost enable has not been tripped. If you put the reset enable on the outermost and the inner reset on hold, then the inner blocks reset only once at the beginning.
This is unexpected behaviour and there is no way around it.

Claudio Rey
Claudio Rey on 21 Apr 2020
This gives you the answer:
For nested subsystems whose Enableblocks have different parameter settings, the settings for the child subsystem override the settings inherited from the parent subsystem.
So, they are all held or all reset. No two ways about it. So if you want to have a hold function inside a system with a reset you have to use triggers. That forces triggered blocks to all run at twice the speed of the required sampling rate. This is ineficient.

Products


Release

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!