Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Create an Action Subsystem

What Are Action Subsystems?

Action subsystems are subsystems that execute in response to a conditional output from an If block or a Switch Case block. In essence, they are subsystems with an Action port, which allow for block execution based on conditional inputs from an If block or Switch Case block.

Simulink® has two types of action subsystems, based on the type of block they receive conditional input from.

If Action Subsystem

The If Action Subsystem is preconfigured to serve as a starting point for creating a subsystem whose execution is triggered by an If block. To implement an if-else condition, connect If action subsystem blocks to the outputs of anIf block.

Switch Case Action Subsystem

The Switch Case Action Subsystem is preconfigured to serve as a starting point for creating a subsystem whose execution is triggered by a Switch Case block. To implement a switch condition, connect Switch Case Action Subsystem blocks to the outputs of a Switch Case block.

    Note:   All blocks in an action subsystem must run at the same sample time as the If or Switch Case block that triggers its execution. You can achieve this automatically by setting the Sample time parameter of each block in the subsystem to -1 (inherited).

Set States when an Action Subsystem Executes

When an action subsystem is triggered to execute, you can choose whether to hold the subsystem states at their previous values or reset them to their initial conditions.

  1. Open the Action Port block inside the action subsystem.

  2. Select one of the following for the States when execution is resumed parameter:

    • held if you want the states to maintain their most recent values

    • reset if you want the states to revert to their initial conditions

    Note:   For nested subsystems whose Action Port blocks have different parameter settings, the settings on the child subsystem's dialog box override those inherited from the parent subsystem.

For more information, see Action Port, If, and Switch Case.

Was this topic helpful?