Omron SYSMAC C200HS Operation Manual page 113

Programmable controllers
Hide thumbs Also See for SYSMAC C200HS:
Table of Contents

Advertisement

Inputting, Modifying, and Checking the Program
4-7-7 Branching Instruction Lines
Branching
point
00000
Diagram A: Correct Operation
Branching
point
00000
Diagram B: Incorrect Operation
TR Bits
When an instruction line branches into two or more lines, it is sometimes neces-
sary to use either interlocks or TR bits to maintain the execution condition that
existed at a branching point. This is because instruction lines are executed
across to a right-hand instruction before returning to the branching point to ex-
ecute instructions on a branch line. If a condition exists on any of the instruction
lines after the branching point, the execution condition could change during this
time making proper execution impossible. The following diagrams illustrate this.
In both diagrams, instruction 1 is executed before returning to the branching
point and moving on to the branch line leading to instruction 2.
00002
00001
00002
If, as shown in diagram A, the execution condition that existed at the branching
point cannot be changed before returning to the branch line (instructions at the
far right do not change the execution condition), then the branch line will be ex-
ecuted correctly and no special programming measure is required.
If, as shown in diagram B, a condition exists between the branching point and the
last instruction on the top instruction line, the execution condition at the branch-
ing point and the execution condition after completing the top instruction line will
sometimes be different, making it impossible to ensure correct execution of the
branch line.
There are two means of programming branching programs to preserve the ex-
ecution condition. One is to use TR bits; the other, to use interlocks
(IL(02)/IL(03)).
The TR area provides eight bits, TR 0 through TR 7, that can be used to tempo-
rarily preserve execution conditions. If a TR bit is placed at a branching point, the
current execution condition will be stored at the designated TR bit. When return-
ing to the branching point, the TR bit restores the execution status that was
saved when the branching point was first reached in program execution.
Address
Instruction 1
00000
00001
Instruction 2
00002
00003
Instruction 1
Address
00000
Instruction 2
00001
00002
00003
00004
Section 4-7
Instruction
Operands
LD
00000
Instruction 1
AND
00002
Instruction 2
Instruction
Operands
LD
00000
AND
00001
Instruction 1
AND
00002
Instruction 2
103

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents