Simulink Reference Previous page   Next Page
Trigger

Add a trigger port to a subsystem

Library

Ports & Subsystems

Description


Adding a Trigger block to a subsystem makes it a triggered subsystem. A triggered subsystem executes once on each integration step when the value of the signal that passes through the trigger port changes in a specifiable way (described below). A subsystem can contain no more than one Trigger block. For more information about triggered subsystems, see Creating a Model in the Using Simulink documentation.

The Trigger type parameter allows you to choose the type of event that triggers execution of the subsystem:

You can output the trigger signal by selecting the Show output port check box. Selecting this option 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

Data Type Support

The Trigger block accepts signals of any data type supported by Simulink, including fixed-point data types.

For a discussion on the data types supported by Simulink, refer to Data Types Supported by Simulink in the Using Simulink documentation.

Parameters and Dialog Box

Trigger type
The type of event that triggers execution of the subsystem.
States when enabling
This option is enabled only if you select function-call as the block's trigger type. It specifies whether a function-call enable trigger causes Simulink to reset the states of the subsystem containing this Trigger block to their initial values. Selecting held (the default) causes Simulink to leave the states at their current values. Selecting reset for this option causes Simulink to reset the states. Selecting inherit causes the trigger's held/reset setting to be the same as that of the function-call initiator's parent subsystem, for example, an enabled subsystem, or the model's root system if the function-call initiator is at the model's root level. If the parent of the initiator is the model root, the inherited setting is held. If the trigger has multiple initiators and its States when enabling setting is inherit, the parents of all initiators must have the same held/reset setting, i.e., either all held or all reset. For more information about the States when enabling setting, see Function-Call Subsystems in the "Implementing Block Features" section of Writing S-Functions.
Show output port
If selected, Simulink draws the Trigger block output port and outputs the trigger signal. Simulink does not allow you to log the output of this port if the block's Trigger type is function-call.
Output data type
Specifies the data type (double or int8) of the trigger output. If you select auto, Simulink sets the data type to be the same as that of the port to which the output is connected. If the port's data type is not double or int8, Simulink signals an error.

Enable zero crossing detection
Select to enable zero crossing detection. For more information, see Zero Crossing Detection in the Using Simulink documentation.
Sample time type
This parameter is active only when Trigger type is set to function-call. Its value may be triggered or periodic. Select periodic if the caller of the parent function-call subsystem, for example, a Stateflow chart, calls the subsystem once per time step when the subsystem is active (enabled). Otherwise, select triggered. See "Using Bind Actions to Control Function-Call Subsystems" in Using Stateflow and the "Function-Call Subsystems" section of Writing S-functions for more information.
Sample time
This parameter is active only when the Trigger type is function-call and the Sample time type is periodic. Set this parameter to the sample time at which you expect the function-call subsystem that contains this block to be called. See Specifying Sample Time in the online documentation for information on how to the value of this parameter. Simulink displays an error if the actual rate at which the subsystem is called differs from the rate that this parameter specifies.

Characteristics

Sample Time
Determined by the sample time parameter if the trigger type is function-call and the sample time type is periodic; otherwise, by the signal at the trigger port.
Dimensionalized
Yes
Zero Crossing
Yes, if enabled


Previous page  Transport Delay Trigger-Based Linearization Next page

© 1994-2005 The MathWorks, Inc.