User`s guide

7 Models with Multiple Sample Rates
7-2
Introduction
Every Simulink block can be classified according to its sample time as constant,
continuous-time, discrete-time, inherited, or variable. Examples of each type
include:
Constant — Constant block, Width
Continuous-time — Integrator, Derivative, Transfer Function
Discrete-time — Unit Delay, Digital Filter
Inherited — Gain, Sum, Lookup Table
Variable These are S-functions blocks that set their time of next hit based
upon current information. These blocks work only with variable step solvers.
Blocks in the inherited category assume the sample time of the blocks that are
driving them. Every Simulink block therefore has a sample time, whether it is
explicit, as in the case of continuous or discrete blocks (continuous blocks have
a sample time of zero), or implicit, as in the case of inherited blocks.
Simulink allows you to create models without any restrictions on the
connections between blocks with disparate sample times. It is therefore
possible to have blocks with differing sample times in a model (a mixed-rate
system). A possible advantage of employing multiple sample times is improved
efficiency when executing in a multitasking real-time environment.
Simulink provides considerable flexibility in building these mixed-rate
systems. However, the same flexibility also allows you to construct models for
which the code generator cannot generate correct real-time code for execution
in a multitasking environment. But to make these models operate correctly in
real-time (i.e., give the right answers), you must modify your model. In general,
the modifications involve placing Unit Delay and Zero Order Hold blocks
between blocks that have unequal sample rates. The sections that follow
discuss the issues you must address to use a mixed-rate model successfully in
a multitasking environment.