Chapter 3. multi-tasking, Part 3 multi-tasking programming tips, Sel os – IAI America S-SEL-E User Manual

Page 109

Advertising
background image

Page 104

Chapter 3. Multi-Tasking

Part 3

Multi-Tasking Programming Tips

Although multi-tasking methods are generally expressed as "the simultaneous execution of multiple programs (multi-tasks)," the
programs are not actually carried out simultaneously. Rather, several programs are performed in sequence in a very short space of
time using the free time available in each program. Avoid any program combination that uses up the controller CPU for one
program. The most efficient configuration, making the multi-tasking function fully useful, will be shown later.

1.

Inefficient Configuration

n Basically, in the multi-tasking operation, the

controller system program [SEL OS] monitors
each of the programs and when the program
being executed goes into a waiting condition
such as waiting for an input signal, the next
program is executed.

n As shown at the left, all the programs are

created to advance through the steps without
waiting based on conditions alone so that they
are continually scanning.

n In this case the program being executed does

not have a waiting condition and uses up the
CPU. Because of this, the controller system
program [SEL OS] forces the programs that
are running to switch in sequence.

n Programs that are always scanning and using

up the CPU do work but they are inefficient
and this is not a true multi-tasking system.
Try to avoid this kind of programming as
much as possible.

Advancing

Starting

Forward SOL ON

Forward

Start

Forward

edge

Backward

Backward

Backward

edge

Program

[SEL OS]

Program 1

Program m

Program n

Program 2

Execute

Execute

Execute

Execute

Execute

Execute

Execute

Execute

Return to first program

Compulsive program change

Execution by constant
scanning of the program.

TAG

1

N600

AND

N300

BTON

300

N600

AND

300

AND

15

BTOF

300

N300

AND

16

BTOF

600

GOTO

1

Advertising
This manual is related to the following products: