Conditionally Executed Subsystems Overview
A conditionally executed subsystem is a nonvirtual subsystem that allows you to control its execution with an external signal. The external signal, called the control signal, is attached to the control input port. Conditional subsystems are useful when you create complex models that contain components whose execution depends on other components.
Simulink® supports these types of conditional subsystems:
Enabled Subsystem — Executes at each time step while the control signal is positive. Execution starts at the time step when the control signal crosses zero from the negative to the positive direction. See Using Enabled Subsystems.
Triggered Subsystem — Executes at each time step when the control signal rises or falls to zero or crosses zero. See Using Triggered Subsystems.
Enabled and Triggered Subsystem — Executes at the time step when the enable control signal has a positive value and the trigger control signal rises or falls to zero. See Using Enabled and Triggered Subsystems.
Function-Call Subsystem — Executes when the control signal receives a function-call event. Events can occur one or more time during a time step. A Stateflow® chart, Function-Call Generator block, S-Function block, or Hit Crossing block can provide function-call events. See Using Function-Call Subsystems.
A conditionally executed subsystem or conditionally executed referenced model runs:
Once at the current time step when enabled by a control block. A control block implements control logic similar to that expressed by a programming language statement such as
Once at the current time step when enabled or triggered by a control signal or an action signal.
One or more times during a time step when receiving a function-call event.
- Using Enabled Subsystems
- Using Triggered Subsystems
- Using Enabled and Triggered Subsystems
- Using Function-Call Subsystems