Create free-running task
The Idle Task block and the subsystem connected to it specify functions in the downstream subsystem to execute as background tasks. The tasks executed through the Idle Task block are of the lowest priority, lower than that of the base rate task.
This block is not supported on target computers that run an operating system.
Port_1 — Simulated interrupt
scalar | vector
Optional simulated interrupt for testing asynchronous interrupt behavior during Simulink® simulation.
To enable this port, select parameter Enable simulation input.
Port_1 — Task identifiers and preemption flags
Numbers that identify the background tasks and task preemption flags, represented as vectors. A task identifier vector stores numbers that identify the background tasks.
For each background task, the preemption flag vector stores a flag that indicates whether the task can be preempted. Unless the preemption flag vector contains one element, the number of elements in the preemption flag vector must match the length of the task identifier vector. If the preemption flag vector has the same number of elements as the task identifier vector, each task represented in the task identifier vector has the preemption setting defined by the value of the corresponding element in the preemption flag vector. When the preemption flag vector contains one element, the flag setting applies to the entire task identifier vector.
A higher-priority task cannot preempt a lower-priority task that cannot be preempted.
Task numbers — Identifiers for tasks created
[1 2] (default) | vector of integers in the range 0 to 15
Specify task identifiers for functions that are in the downstream subsystem as a
vector of integers in the range 0 to 15. The vector must contain the same number of
values as the number of functions in the downstream subsystem. For example, the default
[1 2] indicates that the downstream subsystem contains two
The number of values that you enter corresponds to the number of functions in the
downstream subsystem. The values that you specify determine the execution order of the
functions. For example, the vector
[2 3 1] indicates that:
The subsystem contains three functions.
The third function executes first.
The first function executes second.
The second function executes third.
After the functions execute, the Idle Task block cycles back and repeats the execution of the functions in the same order.
Preemption flags — Preemption flags for specified tasks
[0 1] (default) | vector of 0 to 16 integers in the range [ 0, 1]
Specify preemption flags for the tasks specified by the Task numbers parameter as a vector of up to 16 ones and zeros. Higher-priority interrupts can preempt interrupts that have a lower priority. To control preemption, use the preemption flags to specify whether an interrupt can be preempted.
1 indicates that the interrupt for the corresponding
task can be preempted. The value
0 indicates that the interrupt
cannot be preempted. You have the option of specifying:
One preemption value that applies to the entire vector that you specify for Task numbers.
A preemption value for each task identified in the vector that you specify for Task numbers. Specify the flag values in the order that corresponds to the order of the tasks in Task numbers.
For example, if you specify the vector
[2 3 1] for Task
 for Preemption
3 cannot be preempted. If you specify
[1 1 0]
for Preemption flags, tasks
3 can be preempted and task
1 cannot be
Enable simulation input — Input signal for simulation
off (default) | on
Select this parameter to create an input port that receives interrupt input for model simulation. Use the port to connect and test asynchronous interrupt processing behavior for one or more simulated interrupt sources during Simulink model simulation.
Introduced in R2011a