| Contents | Index |
Ports & Subsystems
Adding a Trigger block to a model allows an external signal to trigger its execution. You can add a trigger port to a root-level model or to a subsystem.
Configure the Trigger block to execute the model either:
Once on each integration step, when the value of the external signal changes in a way that you specify.
Multiple times during a time step, when the external signal is a function-call from a Function-Call Generator block or S-function.
Include only one Trigger block in a model or a subsystem.
Specify the properties that the trigger port enforces for any incoming signal, using the Signal Attributes tab.
The Trigger block supports signal label propagation.
For more information, see:
The Trigger block accepts signals of supported Simulink numeric data types, including fixed-point data types. For more information, see Data Types Supported by Simulink in the Simulink documentation.
The Main tab of the Trigger block dialog box appears as follows:

The Signal Attributes tab of the Trigger block dialog box appears as follows:

Select the type of event that triggers execution of the subsystem.
Default: rising
Triggers execution of the model or 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 model or 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 model or 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.
See Block-Specific Parameters for the command-line information.
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.
To enable this parameter, select function-call from the Trigger Type list.
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.
See Block-Specific Parameters for the command-line information.
Specify when to propagate a variable-size signal.
Default: During execution
Propagates variable-size signals only when enabling the model or subsystem containing the Trigger block.
Propagates variable-size signals at each time step.
Select Function-call from the Trigger type list to enable this parameter.
See Block-Specific Parameters for the command-line information.
Select this check box to output the trigger signal.
Default: On
Shows the Trigger block output port and outputs the trigger signal. This action allows the system to determine which signal 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.
See Block-Specific Parameters for the command-line information.
Specify the trigger output data type.
Default: auto
Specifies that the data type is the same as the port connected to output.
Sets the date type to double.
Sets the data type to integer.
To enable this parameter, select the Show output port check box.
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.
Select Function-call from the Trigger type list to enable this parameter.
See Block-Specific Parameters for the command-line information.
Specify the calling rate for blocks.
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 displays an error.
Setting Trigger type to function-call and Sample time type to periodic enables this parameter.
See Block-Specific Parameters for the command-line information.
Select to enable zero-crossing detection.
Default: On
See Block-Specific Parameters for the command-line information.
Specify the dimensions of the input signal to the block.
Default: 1
Valid values are:
| Value | Description |
n | Accepts vector signal of width n |
[m n] | Accepts matrix signal having m rows and n columns |
See Block-Specific Parameters for the command-line information.
Specify the rate at which the block driving the triggered signal is expected to run.
Default: -1
To inherit the sample time, set this parameter to -1.
See How to Specify the Sample Time for more information.
See Block-Specific Parameters for the command-line information.
Specify the minimum value that the block should output.
Default: [] (unspecified)
This number must be a finite real double scalar value.
Note If you specify a bus object as the data type for this block, do not set the minimum value for bus data on the block. Simulink ignores this setting. Instead, set the minimum values for bus elements of the bus object specified as the data type. For information on the Minimum property of a bus element, see Simulink.BusElement. |
Simulink software uses this value to perform:
Simulation range checking (see Signal Ranges)
Automatic scaling of fixed-point data types
See Block-Specific Parameters for the command-line information.
Specify the maximum value that the block should output.
Default: [] (unspecified)
This number must be a finite real double scalar value.
Note If you specify a bus object as the data type for this block, do not set the maximum value for bus data on the block. Simulink ignores this setting. Instead, set the maximum values for bus elements of the bus object specified as the data type. For information on the Maximum property of a bus element, see Simulink.BusElement. |
Simulink software uses this value to perform:
Simulation range checking (see Signal Ranges)
Automatic scaling of fixed-point data types
See Block-Specific Parameters for the command-line information.
Specify the expected data type of the signal feeding the trigger port.
Default: Inherit: auto
Data type is double
Data type is double.
Data type is single.
Data type is int8.
Data type is uint8.
Data type is int16.
Data type is uint16.
Data type is int32.
Data type is uint32.
Data type is boolean.
Data type is fixed point, fixdt(1,16,0).
Data type is fixed point, fixdt(1,16,2^0,0).
Data type is enumerated, for example, Enum: Basic Colors.
The name of a data type object, for example, Simulink.NumericType.
See Block-Specific Parameters for the command-line information.
Select the category of data to specify.
Default: Inherit
Inheritance rule for data types. Selecting Inherit enables a second list.
Built-in data types. Selecting Built in enables a second list. Select one of the following choices:
double (default)
single
int8
uint8
int16
uint16
int32
uint32
boolean
Fixed-point data types.
Enumerated data types. Selecting Enumerated enables a second text box, where you can enter the class name.
Expressions that evaluate to data types. Selecting Expression enables a second text box, where you can enter the expression.
To enable this parameter, click Show data type assistant.
See Block-Specific Parameters for the command-line information.
Specify data type override mode for this signal.
Default: Inherit
Inherits the data type override setting from its context, that is, from the block, Simulink.Signal object or Stateflow chart in Simulink that is using the signal.
Ignores the data type override setting of its context and uses the fixed-point data type specified for the signal.
The ability to turn off data type override for an individual data type provides greater control over the data types in your model when you apply data type override. For example, you can use this option to ensure that data types meet the requirements of downstream blocks regardless of the data type override setting.
This parameter appears only when the Mode is Built in or Fixed point.
Specify whether you want the fixed-point data as signed or unsigned.
Default: Signed
Selecting Mode > Fixed point enables this parameter.
See Block-Specific Parameters for the command-line information.
See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.
Specify the method for scaling your fixed-point data to avoid overflow conditions and minimize quantization errors.
Default: Best precision, Binary point, Integer
Specify binary point location.
Enter slope and bias.
Specify best-precision values. This option appears for some blocks.
Specify integer. This setting has the same result as specifying a binary point location and setting fraction length to 0. This option appears for some blocks.
Selecting Mode > Fixed point enables this parameter.
Selecting Binary point enables:
Fraction length
Calculate Best-Precision Scaling
Selecting Slope and bias enables:
Slope
Bias
Calculate Best-Precision Scaling
See Block-Specific Parameters for the command-line information.
See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.
Specify the bit size of the word that holds the quantized integer.
Default: 16
Minimum: 0
Maximum: 32
Selecting Mode > Fixed point enables this parameter.
See Block-Specific Parameters for the command-line information.
See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.
Specify fraction length for fixed-point data type.
Default: 0
Binary points can be positive or negative integers.
Selecting Scaling > Binary point enables this parameter.
See Block-Specific Parameters for the command-line information.
See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.
Specify slope for the fixed-point data type.
Default: 2^0
Specify any positive real number.
Selecting Scaling > Slope and bias enables this parameter.
See Block-Specific Parameters for the command-line information.
See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.
Specify bias for the fixed-point data type.
Default: 0
Specify any real number.
Selecting Scaling > Slope and bias enables this parameter.
See Block-Specific Parameters for the command-line information.
See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.
Cause the block to interpolate or extrapolate output at time steps for which no corresponding workspace data exists when loading data from the workspace.
Default: On
Causes the block to interpolate or extrapolate output at time steps for which no corresponding workspace data exists when loading data from the workspace.
Does not cause the block to interpolate or extrapolate output at time steps for which no corresponding workspace data exists when loading data from the workspace.
See Block-Specific Parameters for the command-line information.
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 |

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