Main Content

Switch Case Action Subsystem

Subsystem whose execution is enabled by Switch Case block

  • Switch Case Action Subsystem block

Libraries:
Simulink / Ports & Subsystems

Description

The Switch Case Action Subsystem block is a Subsystem block preconfigured as a starting point for creating a subsystem whose execution is controlled by a Switch Case block. The input port to a Switch Case block selects a case defined using the Case conditions parameter. Depending on input value and case selected, an action signal is sent to execute a Switch Case Action Subsystem block. Execution of the subsystem is controlled by an Action Port block placed inside the subsystem.

Simulink® ignores a priority set on an Switch Case Action Subsystem block. Instead, set the priority on the Switch Case block that initiates execution of the subsystem.

All blocks in a Switch Case Action Subsystem block must run at the same rate as the driving Switch Case block. You can achieve this requirement by setting each block sample time parameter to be either inherited (-1) or the same value as the Switch Case block sample time.

Merge Signals from Switch Case Action Subsystem Blocks

The example model ex_switch_case_block shows how to create one signal from multiple subsystem output signals.

Model ex_switch_case_block

The Switch Case block selects the execution of one If Action Subsystem block from a set of subsystems. Regardless of which subsystem the Switch Case block selects, you can create one resulting signal with a Merge block.

Ports

Input

expand all

Placing an Inport block in a subsystem adds an external input port to the Subsystem block. The port label matches the name of the Inport block.

Use Inport blocks to get signals from the local environment.

Data Types: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point | enumerated | bus

Placing an Action Port block in a subsystem adds an external input port to the Subsystem block and changes the block to a Switch Case Action Subsystem block.

Dot-dash lines from a Switch Case block to an Switch Case Action Subsystem block represent action signals. An action signal is a control signal connected to the action port of an Switch Case Action Subsystem block. A message on the action signal initiates execution of the subsystem.

Data Types: action

Output

expand all

Placing an Outport block in a subsystem adds an output port from the Subsystem block. The port label on the subsystem block is the name of the Outport block.

Use Outport blocks to send signals to the local environment.

Data Types: half | single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point | enumerated | bus

Block Characteristics

Data Types

Booleana | busa | doublea | enumerateda | fixed pointa | halfa | integera | singlea | stringa

Direct Feedthrough

no

Multidimensional Signals

yesa

Variable-Size Signals

yesa

Zero-Crossing Detection

no

a Actual data type or capability support depends on block implementation.

Extended Capabilities

Version History

Introduced before R2006a