Main Content

Treat each discrete rate as a separate task

Option to enable multitasking execution

Model Configuration Pane: Solver

Description

The Treat each discrete rate as a separate task parameter specifies 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.

Programmatic Use

Parameter: EnableMultiTasking
Type: string | character vector
Value: "on" | "off"
Default: "off"

Version History

Introduced in R2016b