Managing Sample Times in Subsystems
Subsystems fall into two categories: triggered and nontriggered.
For triggered subsystems, in general, the subsystem gets its sample
time from the triggering signal. One exception occurs when you use
a Trigger block
to create a triggered subsystem. If you set the block Trigger
type to function-call and
the Sample time type to periodic,
the SampleTime parameter becomes active. In this
case, you specify the sample time of the Trigger block,
which in turn, establishes the sample time of the subsystem.
The four nontriggered subsystems are virtual, enabled, atomic,
and action. Simulink calculates the sample times of virtual and
enabled subsystems based on the respective sample times of their contents.
The atomic subsystem is a special case in that the subsystem block
has a SampleTime parameter. Moreover, for a sample
time other than the default value of –1, the blocks inside
the atomic subsystem can have only a value of Inf,
–1, or the identical (discrete) value of the subsystem SampleTime parameter.
If the atomic subsystem is left as inherited, Simulink calculates
the block sample time in the same manner as the virtual and enabled
subsystems. However, the main purpose of the subsystem SampleTime parameter
is to allow for the simultaneous specification of a large number of
blocks, within an atomic subsystem, that are all set to inherited.
Finally, the sample time of the action subsystem is set by the If block or the Switch Case block.
 | Determining the Compiled Sample Time of a Block | | Managing Sample Times in Systems |  |
Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
Get this Simulink Kit