|On this page…|
A triggered subsystem has a single control input, called the trigger input, that determines whether the subsystem executes. You can choose from three types of trigger events to force a triggered subsystem to begin execution:
Note For discrete systems: If after rising, a signal remains at zero for more than one time step, then and only then, does the subsequent rising of the signal constitute a trigger event. Similarly, a falling trigger event occurs only if there are at least two time steps between two occurrences of the signal falling. This trigger event scheme eliminates false triggers caused by control signal sampling.
For example, in the following timing diagram for a discrete system, a rising trigger (R) does not occur at time step 3 because the signal remains at zero for only one time step prior to the rise.
A simple example of a triggered subsystem is illustrated.
In this example, the subsystem is triggered on the rising edge of the square wave trigger control signal.
You can use triggered ports in referenced models. Add a trigger port to a referenced model to create a simpler, cleaner model than when you include either:
A triggered subsystem in a referenced model
A Model block in a triggered subsystem
For information about using trigger ports in referenced models, see Conditional Referenced Models.
To convert a subsystem to use model referencing, see Convert a Subsystem to a Referenced Model.
You create a triggered subsystem by copying the Trigger block from the Ports & Subsystems library into a subsystem. The Simulink® software adds a trigger symbol and a trigger control input port to the Subsystem block.
Different symbols appear on the Trigger and Subsystem blocks to indicate rising and falling triggers (or either). This figure shows the trigger symbols on Subsystem blocks.
Unlike enabled subsystems, triggered subsystems always hold their outputs at the last value between triggering events. Also, triggered subsystems cannot reset their states when triggered; the states of any discrete block is held between trigger events.
In the Output data type field, specify the data type of the output signal as auto, int8, or double. The auto option causes the data type of the output signal to be the data type (either int8 or double) of the port to which the signal connects.
All blocks in a triggered subsystem must have either inherited (-1) or constant (inf) sample time. This is to indicate that the blocks in the triggered subsystem run only when the triggered subsystem itself runs, for example, when it is triggered. This requirement means that a triggered subsystem cannot contain continuous blocks, such as the Integrator block.