Simulink Reference | ![]() ![]() |
Implement the Action subsystems used by if
and switch
control flow statements in Simulink
Library
Description
Action Port blocks implement Action subsystems used in if
and switch
control flow statements. See the references for the If and Switch Case blocks for examples using Action Port blocks.
Use Action Port blocks to create Action subsystems as follows:
Action subsystems execute their programming in response to the conditional outputs of an If or Switch Case block. Use Action subsystems as follows:
if{ }
, else{ }
, elseif{ }
, case{ }
, or default{ }
).
The Action Port block has only the States when execution is resumed parameter in its parameters dialog. If you set this field to held
(the default value) for an Action Port block, the states of its Action subsystem are retained between calls even if other member Action subsystems of an if-else
or switch
control flow statement are called. If you set the States when execution is resumed field to reset
, the states of a member Action subsystem are reset to initial values when it is reenabled. See the "Parameters and Dialog Box" section following for more details.
Note All blocks in an Action subsystem driven by an If or Switch Case block must run at the same rate as the driving block. |
Data Type Support
There are no data inputs or outputs for Action Port blocks.
Parameters and Dialog Box
held
(the default value) to make sure that the Action subsystem states retain their previous values when the subsystem is reenabled. Otherwise, set this field to reset
if you want the states of the Action subsystem to be reinitialized when the subsystem is reenabled.reset
.Characteristics
Sample Time |
Inherited from driving If or Switch Case block. |
![]() | Abs | Algebraic Constraint | ![]() |