10: D
ATA
C
OMPARISON
I
NSTRUCTIONS
10-2
« FC4A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
»
Applicable CPU Modules
Valid Operands
For the valid operand number range, see pages 6-1 and 6-2.
▲
Internal relays M0 through M1277 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value is read out.
Valid Data Types
Special Internal Relays M8150, M8151, and M8152 in CMP=
Slim type CPU modules FC4A-D20RK1, -D20RS1, -D40K3, and -D40S3 have three special internal relays to indicate the
comparison result of the CMP= instruction. Depending on the result, one of the three special internal relays turns on.
When more than one CMP= or ICMP>= instruction is used, M8150, M8151, or M8152 indicates the result of the instruc-
tion that was executed last.
Examples: CMP>=
The following examples are described using the CMP
≥
instruction. Data comparison operation for all other data compari-
son instructions is the same for the CMP
≥
instruction.
• Data Type: Word
• Data Type: Integer
FC4A-C10R2/C
FC4A-C16R2/C
FC4A-C24R2/C
FC4A-D20K3/S3
FC4A-D20RK1/RS1 & FC4A-D40K3/S3
X
X
X
X
X
Operand
Function
I
Q
M
R
T
C
D
Constant
Repeat
S1 (Source 1)
Data to compare
X
X
X
X
X
X
X
X
1-99
S2 (Source 2)
Data to compare
X
X
X
X
X
X
X
X
1-99
D1 (Destination 1)
Comparison output
—
X
▲
—
—
—
—
—
1-99
W (word)
I (integer)
X
X
When a bit operand such as I (input), Q (output), M (internal relay), or R (shift register) is
designated as the source, 16 points are used. When repeat is designated for a bit operand, the
quantity of operand bits increases in 16-point increments.
When a word operand such as T (timer), C (counter), or D (data register) is designated as the
source, 1 point is used. When repeat is designated for a word operand, the quantity of oper-
and words increases in 1-point increments.
The destination uses only 1 point of output or internal relay. When repeat is designated for
the destination, outputs or internal relays as many as the repeat cycles are used.
When S1 > S2, M8150 (greater than) turns on.
When S1 = S2, M8151 (equal to) turns on.
When S1 < S2, M8152 (less than) turns on.
S2
Value
M8150 M8151 M8152
D1
Status
(1) S1 > S2
ON
OFF
OFF
OFF
(2) S1 = S2
OFF
ON
OFF
ON
(3) S1 < S2
OFF
OFF
ON
OFF
S2
S1
(2)
(1)
(3)
Small
Large
When repeat is designated, the comparison result of the last
repeat cycle turns on one of the three special internal relays.
I0
REP
S1 –
D10
D1 –
Q0
CMP>=(W)
S2 –
D20
56
D20
50
D20
Q0 turned off
Q0 turned on
S2
D1
42
D10
127
D10
S1
I1
REP
S1 –
D30
D1 –
Q1
CMP>=(I)
S2 –
D40
–3
D40
–3
D40
Q1 turned off
Q1 turned on
S2
D1
–4
D30
12
D30
S1
Summary of Contents for FC4A-C10R2
Page 1: ...FC4A SERIES Micro Programmable Logic Controller User s Manual FC9Y B812 ...
Page 6: ...PREFACE 4 FC4A MICROSMART USER S MANUAL ...
Page 94: ...2 MODULE SPECIFICATIONS 2 74 FC4A MICROSMART USER S MANUAL ...
Page 184: ...6 ALLOCATION NUMBERS 6 20 FC4A MICROSMART USER S MANUAL ...
Page 218: ...8 ADVANCED INSTRUCTIONS 8 8 FC4A MICROSMART USER S MANUAL ...
Page 240: ...11 BINARY ARITHMETIC INSTRUCTIONS 11 8 FC4A MICROSMART USER S MANUAL ...
Page 244: ...12 BOOLEAN COMPUTATION INSTRUCTIONS 12 4 FC4A MICROSMART USER S MANUAL ...
Page 252: ...13 SHIFT ROTATE INSTRUCTIONS 13 8 FC4A MICROSMART USER S MANUAL ...
Page 274: ...15 WEEK PROGRAMMER INSTRUCTIONS 15 8 FC4A MICROSMART USER S MANUAL ...
Page 378: ...22 DUAL TEACHING TIMER INSTRUCTIONS 22 4 FC4A MICROSMART USER S MANUAL ...
Page 386: ...23 INTELLIGENT MODULE ACCESS INSTRUCTIONS 23 8 FC4A MICROSMART USER S MANUAL ...
Page 408: ...24 ANALOG I O CONTROL 24 22 FC4A MICROSMART USER S MANUAL ...
Page 426: ...26 COMPUTER LINK COMMUNICATION 26 6 FC4A MICROSMART USER S MANUAL ...