Simulink Reference    
Action Port

Implement the Action subsystems used by if and switch control flow statements in Simulink

Library

Ports & Subsystems

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:

  1. Place a subsystem in the system containing the If or Switch Case block.
  1. You can use an ordinary subsystem or an atomic subsystem. In either case, the resulting Action subsystem is atomic.

  1. Add an Action Port to the new subsystem.
  1. This adds an input port named Action to the subsystem, which is now an Action subsystem.

Action subsystems execute their programming in response to the conditional outputs of an If or Switch Case block. Use Action subsystems as follows:

  1. Create an Action subsystem for each output port configured for an If or Switch Case block.
  2. Connect each output port (if, else, or elseif ports for the If block; case or default ports for the Switch Case block) to the Action port on an Action subsystem.
  1. When the connection is made, the icon for the subsystem and the Action Port block it contains are changed to the name of the output port for the If or Switch Case block (i.e., if{ }, else{ }, elseif{ }, case{ }, or default{ }).

  1. Open the new subsystem and add the diagram that you want to execute in response to the condition this subsystem covers.

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.

Data Type Support

There are no data inputs or outputs for Action Port blocks.

Parameters and Dialog Box

States when execution is resumed
Specifies how to handle internal states when the subsystem of this Action Port block is reenabled.
Set this field to 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.
Reenablement of a subsystem occurs when it is called and the condition of the call is true after having been previously false. In the following example, the Action Port blocks for both Action subsystems A and B have the States when execution is resumed parameter set to reset.
If case[1] is true, Action subsystem A is called. This implies that the default condition is false. When B is later called for the default condition, its states are reset. In the same way, Action subsystem A's states are reset when it is called right after Action subsystem B is called.
Repeated calls to a case's Action subsystem do not reset its states. If A is called again right after a previous call to A, this does not reset A's states because its condition, case[1], was not previously false. The same applies to B.

Characteristics

Sample Time
Inherited from driving If or Switch Case block.


  Abs Algebraic Constraint