183
Notes:
6-3. Description of High-level Instructions
• If you program the
F60 (CMP)
instruction using
special internal relay R9010 (ON all the time), the
same trigger as the instruction need not be
programmed.
• 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 using the output relays or the internal
relays.
The compared result of
1
is stored in the output
relays (Y0, Y1, and Y2) of program
2
.
The compared result of
3
is stored in the output
relays (Y3, Y4, and Y5) of program
4
.
• When comparing special data, such as BCD or binary without signs, flags R9009, R900A, R900B, and
R900C move as shown in the table below. In this case, construct your program as shown in the program
example below, using special internal relays R900B and R9009.
Program example:
Compares two BCD data in DT0 and DT1.
1
...When DT0 < DT1, internal relay R0 turns ON
2
...When DT0 = DT1, internal relay R1 turns ON
3
...When DT0 > DT1, internal relay R2 turns ON
X0
F60 CMP, DT0, K100
X0
Y0
R900A
X0
Y1
R900B
X0
Y2
R900C
X1
F60 CMP, DT1, K200
X1
Y3
R900A
X1
Y4
R900B
X1
Y5
R900C
1
2
"
"
"
"
"
3
4
"
"
"
"
"
X1
F60 CMP, DT0, DT1
X1
R0
R900B
X1
R1
R900B
X1
R2
R900B
1
2
3
R9009
R9009
R9009
Program example:
Compares DT0 with K100 when X0 turns
ON, and DT1 with K200 when X1 turns
ON
R9010
F60 CMP, DT0, K100
R9010
R0
R900A
R9010
R1
R900B
R9010
R2
R900C
R9010 can be abbreviated in this case.
S1 < S2
S1 = S2
S1 > S2
↕
OFF
↕
OFF
ON
OFF
↕
OFF
↕
ON
OFF
OFF
(> flag) (= flag) (< flag) (carry flag)
R900A R900B R900C
R9009
Flag
Comparison between
S1 and S2
“
↕
”: turns ON or OFF according to the conditions
Summary of Contents for FP1
Page 1: ...PROGRAMMABLE CONTROLLER FP1 is a global brand name of Matsushita Electric Works Hardware ...
Page 28: ...20 ...
Page 98: ...90 ...
Page 150: ...142 ...
Page 208: ...200 ...
Page 226: ...218 ...
Page 280: ...272 ...