Treat each discrete rate as a separate task

Description

Specify whether Simulink® executes blocks with periodic sample times individually or in groups.

Category: Solver

Settings

Default: Off

On

Selects multitasking execution for models operating at different sample rates. Specifies that groups of blocks with the same execution priority are processed through each stage of simulation (for example, calculating output and updating discrete states) based on task priority. The multitasking mode helps to create valid models of real-world multitasking systems, where sections of your model represent concurrent tasks.

Off

Specifies that 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.

Tips

  • A multirate model with multitasking mode enabled cannot reference another multirate model that has the single-tasking mode enabled.

  • The Single task rate transition and Multitask rate transition parameters on the Diagnostics > Sample Time pane allow you to adjust error checking for sample rate transitions between blocks that operate at different sample rates.

Dependency

This parameter is enabled by selecting the Fixed-step solver type.

Command-Line Information

Parameter: EnableMultiTasking
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact for simulation or during development
Off for production code generation
EfficiencyNo impact
Safety precaution

No recommendation

See Also

Related Topics