Real-Time Workshop | ![]() ![]() |
Singletasking and Multitasking
Execution of a Model: an Example
In this section we will examine how a simple multirate model executes in both real time and simulation, using a fixed-step solver. We will consider the operation of both SingleTasking
and MultiTasking
solver modes.
The example model is shown in Figure 8-10. We will refer to the six blocks of the model as A through F, as labelled in the block diagram.
Note that the execution order of the blocks (indicated in the upper right of each block) has been forced into the order shown by assigning higher priorities to blocks F, E, and D. The ordering shown is one possible valid execution ordering for this model. (See "Determining Block Update Order" in Using Simulink.)
The execution order is determined by data dependencies between blocks. In a real-time system, the execution order determines the order in which blocks execute, within a given time interval or task. In this discussion we will treat the model's execution order as a given, since we are concerned with the allocation of block computations to tasks, and to the scheduling of task execution.
Figure 8-10: Example Model with Multiple Rates and Transition Blocks
![]() | Slower to Faster Transitions in Real Time | Singletasking Execution | ![]() |