Main Content

If Action Subsystem

Subsystem whose execution is enabled by If block

  • If Action Subsystem block

Libraries:
Simulink / Ports & Subsystems

Description

TheIf Action Subsystemblock is aSubsystemblock preconfigured as a starting point for creating a subsystem whose execution is controlled by anIfblock. TheIfblock evaluates a logical expression and then, depending on the result of the evaluation, outputs an action signal. Execution of the subsystem is controlled by anAction Portblock placed inside the subsystem.

金宝app®ignores a priority set on anIf Action Subsystemblock. Instead, set the priority on theIfblock that initiates execution of the subsystem.

Merge Signals from If Action Subsystem Blocks

This example shows how to merge signals controlled by anIfblock. For more information, seeSelect Subsystem Execution.

Model ex_if_block

TheIfblock selects the execution of anIf Action Subsystemblock from a set of subsystems. Regardless of which subsystem theIfblock selects, you can create one output signal with aMergeblock.

All blocks in anIf Action Subsystemblock must execute at the same rate as the driving If block. To satisfy this requirement, set the sample time parameter for each block to either inherited (-1) or the same value as the If block sample time.

Support for Fixed-Point Data Type

TheIf不直接支持定点数据块t金宝appypes. However, you can use theCompare To Constantblock to work around this limitation. For more information,Fixed-Point Data Type Support for If Block.

Ports

Input

expand all

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

UseInportblocks to get signals from the local environment.

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

Placing anAction Portblock in a subsystem block adds an external input port to the block and changes the block to anIf Action Subsystem.

Dot-dash lines from aSwitch Caseblock to anSwitch Case Action Subsystemblock representactionsignals. An action signal is a control signal connected to the action port of a Switch Case Action Subsystem block. A message on the action signal initiates execution of the subsystem.

Data Types:action

Output

expand all

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

UseOutportblocks to send signals to the local environment.

Data Types:一半|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|一半a|integera|singlea|stringa

Direct Feedthrough

no

Multidimensional Signals

yesa

Variable-Size Signals

yesa

Zero-Crossing Detection

no

aActual data type or capability support depends on block implementation.

Extended Capabilities

版本历史

Introduced before R2006a