User`s guide

7 Models with Multiple Sample Rates
7-8
Singletasking
It is possible to execute the model code in a strictly singletasking manner.
While this method is less efficient with regard to execution speed, in certain
situations it may allow you to simplify your model.
In a singletasking environment, the base sample rate must define a time
interval that is long enough to allow the execution of all blocks within that
interval.
The following diagram illustrates the inefficiency inherent in singletasking
execution:
Figure 7-4: Singletasking System Execution
Singletasking system execution requires a sample interval that is long enough
to execute one step through the entire model.
Building the Program for Singletasking Execution
To use singletasking execution, select the singletasking mode on the Solver
page of the
Simulation Parameters dialog box. If the solver mode is auto,
singletasking will be used if your model:
Contains one sample time, or
Contains a continuous and a discrete sample time and the fixed step size is
equal to the discrete sample time
Model Execution
To generate code that executes correctly in real-time, you may need to modify
sample rate transitions within the model before generating code. To
understand this process, first consider how Simulink simulations differ from
real-time programs.
t0 t1 t2 t3 t4