Real-Time Workshop |
 |
Executing Multitasking Models
In cases where the continuous part of a model executes at a rate that is different from the discrete part, or a model has blocks with different sample rates, the code assigns each block a task identifier (tid
) to associate the block with the task that executes at the block's sample rate.
Certain restrictions apply to the sample rates that you can use:
- The sample rate of any block must be an integer multiple of the base (i.e., the fastest) sample period. The base sample period is determined by the Fixed step size specified on the Solver page of the Simulation parameters dialog box (if a model has continuous blocks) or by the fastest sample time specified in the model (if the model is purely discrete). Continuous blocks always execute via an integration algorithm that runs at the base sample rate.
- The continuous and discrete parts of the model can execute at different rates only if the discrete part is executed at the same or a slower rate than the continuous part (and is an integer multiple of the base sample rate).
| Singletasking vs. Multitasking Environments | | Multitasking and Pseudomultitasking |  |