High−level Instructions
3 − 133
Precautions when using two or more comparison instructions
The comparison instruction flags R900A to R900C are updated with each execution of the comparison
instruction.
If you use two or more comparison instructions in your program, be sure to use the flags immediately after
each comparison instruction, by employing output relays or internal relays.
Example: Compares DT1 and DT0 with DT11 and DT10, and DT3 and DT2
with DT21 and DT20.
Y11
Y12
X0
X0
X0
X0
F61 DCMP, DT 0, DT 10
R900A
R900B
R900C
Y14
Y15
X1
X1
X1
X1
F61 DCMP, DT 2, DT 20
R900A
R900B
R900C
a)
b)
c)
d)
Y13
Y10
The comparison result for a) is output to the output relays
(Y10, Y11, and Y12) of program b).
The comparison result for c) is output to the output relays
(Y13, Y14, and Y15) of program d).