Treat each discrete rate as a separate task
Option to enable multitasking execution
Model Configuration Pane: Solver
Description
Specify whether the software executes blocks with periodic sample times individually or in groups.
To use this parameter, clear the Use local solver when referencing model parameter.
A model with multiple tasks cannot reference a multirate model that uses single tasking mode.
Dependencies
To enable this parameter, set the solver Type to Fixed-step
.
Settings
off
(default) | on
off
All blocks are processed through each stage of simulation together (for example, calculating output and updating discrete states). Use single-tasking execution if:
Your model contains one sample time.
Your model contains a continuous and a discrete sample time, and the fixed step size is equal to the discrete sample time.
on
Groups of blocks with the same execution priority are processed through each stage of simulation based on task priority. The multitasking mode helps to create valid models of real-world multitasking systems, where sections of your model represent independent tasks.
Tips
Use the Single task data transfer and Multitask data transfer parameters to control the diagnostic behavior for sample rate transitions between blocks that have different sample times.
Recommended Settings
The table summarizes recommended values for this parameter based on considerations related to code generation.
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact for simulation or during development Off for production code generation |
Efficiency | No impact |
Safety precaution | No recommendation |
Programmatic Use
Parameter: EnableMultiTasking |
Type: string | character vector |
Value: 'on' | 'off' |
Default: 'off' |
Version History
Introduced in R2016b
See Also
Topics
- Time-Based Scheduling (Simulink Coder)
- Time-Based Scheduling and Code Generation (Simulink Coder)
- Rate Transitions and Data Transfers (Simulink Coder)
- Solver Pane