Action Port
Control port for action signal to If Action Subsystem or Switch Case Action Subsystem block
Description
The Action Port block controls the execution of these subsystem blocks:
If Action Subsystem blocks connected to If blocks.
Switch Case Action Subsystem blocks connected to Switch Case blocks.
Simulink based states in Stateflow® charts. See Create and Edit Simulink Based States (Stateflow).
Examples
Simulink Subsystem Semantics
This set of examples shows different types of Simulink® Subsystems and what semantics are used when simulating these subsystems. Each example provides a description of the model and the subtleties governing how the model is executed.
If-Then-Else Blocks
The effect of feeding a sine wave into If Action Subsystem blocks. It is designed to illustrate the similarity between the If Action Subsystem block and the Enabled Subsystem block.
Modeling Clutch Lock-Up Using If Blocks
Use If/Else subsystems to build a clutch model. An 'If' subsystem models the clutch dynamics in the locked position while an 'Else' subsystem models the unlocked position. One or the other is enabled using the 'If' block. The dot-dashed lines from the 'If' block denote control signals, which are used to enable If/Else (or other conditional) subsystems. Checking any of the boxes on the GUI produces a plot of any of the selected variables (versus time).
Parameters
States when execution is resumed — Select handling of internal states
held
(default) | reset
Select how to handle internal states when a subsystem with an Action Port block reenables.
held
When the subsystem reenables, retain the previous state values of the subsystem. Previous state values between calls are retained even if you call other subsystem blocks connected to the If or Switch Case block.
reset
When the subsystem reenables, reinitialize the state values.
A subsystem reenables when the logical expression for its action port evaluates to true after having been previously false. In the following example, the Action Port blocks for both subsystems
A
andB
have the States when execution is resumed parameter set toreset
.When case[1] is
true
, subsystem A is executed. Repeated calls to subsystem A while case [1] continues to betrue
, does not reset its state values. The same behavior applies to subsystem B.
Programmatic Use
Block Parameter:
InitializeStates |
Type: character vector |
Value:
'held' | 'reset' |
Default:
'held' |
Propagate sizes of variable-size signals — Select when to propagate a variable-size signal
Only when execution is
resumed
(default) | During execution
Select when to propagate a variable-size signal.
Only when execution is resumed
Propagate variable-size signals only when reenabling the subsystem containing the Action Port block.
During execution
Propagate variable-size signals at each time step.
Programmatic Use
Block Parameter:
PropagateVarSize |
Type: character vector |
Values: 'Only when
execution is resumed' | 'During
execution' |
Default: 'Only when
execution is resumed' |
Extended Capabilities
HDL Code Generation
Generate VHDL, Verilog and SystemVerilog code for FPGA and ASIC designs using HDL Coder™.
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
This block has one default HDL architecture.
Version History
Introduced before R2006a
See Also
If | If Action Subsystem | Switch Case | Switch Case Action Subsystem
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: United States.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)