| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
Ports & Subsystems
Adding a Trigger block to a subsystem or a model allows an external signal to trigger its execution. You can configure the Trigger block to execute the subsystem:
Once on each integration step when the value of the external signal changes in a specifiable way.
Multiple times during a time step when the external signal is a function-call from a Function-Call Generator block or S-function.
A subsystem or model can contain only one Trigger block. For more information, see Defining Function-Call Models, Function-Call Subsystems, and Triggered Subsystems.
The Trigger block accepts signals of any numeric data type supported by Simulink software, including fixed-point data types. For more information, see Data Types Supported by Simulink in the Simulink documentation.

Select the type of event that triggers execution of the subsystem.
Default: rising
Triggers execution of the subsystem when the control signal rises from a negative or zero value to a positive value. If the initial value is negative, rising to zero triggers execution.
Triggers execution of the subsystem when the control signal falls from a positive or a zero value to a negative value. If the initial value is positive, falling to zero triggers execution.
Triggers execution of the subsystem when the signal is either rising or falling.
Allows a Function-Call Generator or S-function to control execution of the subsystem or model. The Trigger type must be function-call for Trigger ports at the root-level of a model. Only function-call signals can trigger execution of a model.
| Parameter: TriggerType |
| Type: string |
| Value: 'rising' | 'falling' | 'either' | 'function-call' |
| Default: 'rising' |
Specify the state values when triggered by a function-call.
Default: held
Leaves the states at their current values.
Resets the states.
Uses the held/reset setting from the parent subsystem initiating the function-call. If the parent of the initiator is the model root, the inherited setting is held. If the trigger has multiple initiators, set the parents of all initiators to either held or reset.
If you select function-call as the block trigger type, the dialog enables this parameter. The parameter setting applies only if the model explicitly enables and disables the function-call subsystem. For example:
The function-call subsystem resides in an enabled subsystem. In this case, the model enables and disables the function-call subsystem along with the parent subsystem.
The function-call initiator that controls the function-call subsystem resides in an enabled subsystem. In this case, the model enables and disables the function-call subsystem along with the enabled subsystem containing the function-call initiator.
The function-call initiator is a Stateflow event bound to a particular state. See Using Bind Actions to Control Function-Call Subsystems in the Stateflow documentation.
The function-call initiator is an S-function that explicitly enables and disables the function-call subsystem. See ssEnableSystemWithTid for an example.
| Parameter: StatesWhenEnabling |
| Type: string |
| Value: 'held' | 'reset' | 'inherit' |
| Default: 'held' |
Specify when to propagate a variable-size signal.
Default: During execution
Propagates variable-size signals only when enabling the subsystem containing the Trigger Port block.
Propagates variable-size signals at each time step.
Selecting Function-call from the Trigger type list enables this parameter.
| Parameter: PropagateVarSize |
| Type: string |
| Value: 'Only when enabling' | 'During execution' |
| Default: 'During execution' |
Select this check box to output the trigger signal.
Default: On
Shows the Trigger block output port and outputs the trigger signal if this block is in a subsystem. This action allows the system to determine what caused the trigger. The width of the signal is the width of the triggering signal. The signal value is:
1 for a signal that causes a rising trigger
-1 for a signal that causes a falling trigger
2 for a function-call trigger
0 otherwise
Removes the output port.
This dialog box disables this parameter for function-call Trigger blocks residing at the root level of a model.
| Parameter: ShowOutputPort |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'on' |
Specify the trigger output data type.
Default: Auto
Specifies the data type is the same as the port connected to output.
Sets the date type to double.
Sets the data type to integer.
Selecting Function-call from the Trigger type list and selecting the Show output port check box enables this parameter.
The Trigger block ignores the Data type override setting of the Fixed-Point Tool.
Specify the calling frequency of a subsystem.
Default: triggered
Applies to applications that do not have a periodic calling frequency.
Applies if the caller of the parent function-call subsystem calls the subsystem once per time step when the subsystem is active (enabled). A Stateflow chart is an example of a caller.
Selecting Function-call from the Trigger type list enables this parameter.
| Parameter: SampleTimeType |
| Type: string |
| Value: 'triggered' | 'periodic' |
| Default: 'triggered' |
Specify the sample time.
Default: 1
Set this parameter to the sample time you expect for the calling rate of the function-call subsystem containing this Trigger block. If the actual calling rate for the subsystem differs from the rate that this parameter specifies, Simulink software displays an error.
Setting Trigger type to function-call and Sample time type to periodic enables this parameter.
| Parameter: SampleTime |
| Type: string |
| Value: 1 |
| Default: 1 |
Select to enable zero-crossing detection.
Default: On
| Parameter: ZeroCross |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'on' |
Sample Time | Specified by the Sample time parameter if:
Otherwise, specified by the signal at the trigger port. |
Dimensionalized | Yes |
Virtual | Yes, when the output port is not present For more information, see Virtual Blocks in the Simulink documentation. |
Zero-Crossing Detection | Yes, if enabled |
![]() | Transport Delay | Trigger-Based Linearization | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |