beautypg.com

Multitasking operation, Task control – Rockwell Automation GMLC Reference Manual User Manual

Page 379

background image

Publication GMLC-5.2 - November 1999

342

Multitasking Blocks

Multitasking Operation

In the motion controllers, multitasking operates by means of a software
device, called a task dispatcher, that constantly shifts its focus among all
active tasks. If two tasks are active, the task dispatcher executes a block
from the first task, then executes a block from the second task, then
returns to execute the next block in the first task, and so on in alternation.
If more than two tasks are active, the task dispatcher executes one block
from each task in round robin fashion. Consequently, although most
blocks do not hang the task dispatcher, the greater the number of active
tasks, the slower each one runs. This type of operation is known as
cooperative multitasking.

With multitasking, each task can be thought of as a separate program or
sub-program operating concurrently with the other tasks. When

multitasking is on, Task 0 is the main program as begun at the

block at the beginning of the diagram. However, the

block does

not enable multitasking.

Within a task, conditional blocks and Wait for… blocks are evaluated
once, then control returns to the task dispatcher. In this way, a Wait for nn
or conditional block in one task does not pause execution of any other
tasks or hang the task dispatcher.

Task Control

The Task Control Block is used to:

Turn on multitasking and begin executing a new task (Start New Task
Type).

Stop execution of the current task (Stop Current Task Type).

Stop execution of a selected task, other than the current task (Stop
Other Task Type).

Resume execution of a previously stopped task (Resume Task Type).

Turn off multitasking by disabling the task dispatcher (Stop
Dispatcher Type).