Enabled subsystem is not reseted when parent subsystem is reseted

1 view (last 30 days)
Hello, apparently if a parent subsystem is reseted the enabled subsystems in the parent sybsystem are not reseted. If the enable function is removed, the subsystem is reseted when the parent subsystem reseted. My solution now is to attach the reset signal to the enabled subsystem, but it is not very clean. Does anyone know a better solution? Or why this is happening and if I am doing something wrong? :)
Attached are the images of the model, simulation and simulink file. Thanks in advance
PD: I wont be able to see any responses for a week, so don't be surprised if I don't answer fast ;)
MATLAB Version: (R2023a) Update 5
Simulink model:
First subsystem with external reset:
Second subsystem with external enable:
Simulation with the enables subsystem

Answers (1)

Sayan on 30 Oct 2023
Hi Alejandro,
I understand from your issue that the child Enabled Subsystem is not reset when the parent Resettable Subsystem is reset with an external trigger.
The possible workarounds for the issue are as follows:
  • Rather than attaching a reset signal to your Enabled Subsystem you can use the Resettable Subsystem block (available at Simulink / Ports & Subsystems) and put the child model inside the block after removing the Enable port. Here, you need to trigger the child Subsystem with the same control signal as the parent. Using this will reset the child the same way as the parent Subsystem at the same time step.
  • Alternatively, you can make the parent Subsystem enabled by removing the Reset port and triggering both subsystems with the same control signal. Now to reset the output signal, you need to reset the the Outport of each Subsystem when they are disabled and set the "Initial Output" to zero. However, you need to disable the control signal for at least one time step. You can find the same in the following documentation:
Further information on "Using Enabled Subsystems" and "Using Resettable Subsystems" can be found in the following documentation:
Hope this helps in resolving the issue.
  1 Comment
Alejandro on 30 Oct 2023
Hi Sayan,
Thank you for your answer.
Maybe I was not exactly clear with what I need. I still need the enabled subsystem, so I can not just replace it with a Triggered Subsystem (for your first solution you are talking of removing the Enable port). And for your second solution I also need to reset a unit delay to it's initial value and a filter, so it would also not work.
Sadly there ar no Subsystems with Enabled and Resetable inputs. The Resettable parent Subsystem is only there because I need to reset the Enabled Subsystem.

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!