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
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' |
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 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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)