Зз ззз ззз ззз – Rockwell Automation 57C650 AutoMax Programming Executive Version 3.8 User Manual

Page 239

Advertising
background image

CĆ3

AutoMax Task Execution

The Control Block task starts, and finishes executing 2 ticks later. At this point, the

BASIC task is eligible to run (its time 0). When it finishes, the time elapsed from

the point of view of the Control Block task is 5 ticks and the higher priority task

can then execute again. At 10 ticks, however, both the Control Block and the

BASIC task are scheduled to run. Because the Control Block task has a higher

priority, it will execute first. The BASIC task will execute immediately afterwards.
Note that although the BASIC task was prevented from executing at the originally

scheduled 10 ticks, it is still scheduled to run again at the next 8Ćtick interval, i.e.,

at 18 ticks. Two ticks into this scan, however, it will be suspended by the Control

Block task which is scheduled to run at 20 ticks. After the Control Block task

completes its scan, the BASIC task will continue the remainder of its scan.

ЗЗ

ЗЗ

ЗЗ

ЗЗ

ЗЗ

ЗЗ

ЗЗ

ЗЗ

ЗЗ

ЗЗ

ЗЗ

Priority 4 task

Priority 7 task

Time

ЗЗ

ЗЗ

ЗЗ

ЗЗЗ

ЗЗЗ

ЗЗЗ

0

2

5

7

10

12

15 17 18

20

22 23

Initial Scan

In applications that require multiple interdependent tasks, the programmer needs

to ensure that the structure of the individual tasks takes into account the possible

timing lag between execution of different types of tasks. The first scan of the task

is used to execute only the initialization code for the following types of tasks: all

BASIC tasks with a START EVERY statement, all PC/Ladder Logic tasks, and all

Control Block tasks.
Control Block initialization code consists of all statements before the SCAN_LOOP

statement. BASIC task initialization code consists of all statements before the

START EVERY statement. PC/ladder Logic task initialization code is constructed

by the Executive software.
BASIC tasks without a START EVERY statement do not have initialization code

and are always executed in total (if they are not suspended by a higher priority

task which is scheduled to run) during their first scan. Execution of BASIC tasks

without a START EVERY statement is based only on their priority or their links to

other tasks because there is no method of establishing scan time without a

START EVERY statement. Note that this type of BASIC task is executed only once

unless it includes a GOTO statement that results in a loop.

Advertising