IDEC FC4A-C10R2 User Manual page 230

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

10: D
C
ATA
OMPARISON
Applicable CPU Modules
FC4A-C10R2/C
FC4A-C16R2/C
X
Valid Operands
Operand
S1 (Source 1)
S2 (Source 2)
D1 (Destination 1)
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
W (word)
I (integer)
X
X
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 S1 > S2, M8150 (greater than) turns on.
When S1 = S2, M8151 (equal to) turns on.
When S1 < S2, M8152 (less than) turns on.
Small
S2
(1)
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
CMP>=(W)
I0
• Data Type: Integer
CMP>=(I)
I1
10-2
I
NSTRUCTIONS
FC4A-C24R2/C
X
X
Function
Data to compare
Data to compare
Comparison output
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.
S1
Large
(2)
(3)
S1 –
S2 –
D1 –
REP
D10
D20
Q0
S1 –
S2 –
D1 –
REP
D30
D40
Q1
« FC4A M
FC4A-D20K3/S3
X
I
Q
X
X
X
X
X
S2 Value
(1) S1 > S2
(2) S1 = S2
(3) S1 < S2
When repeat is designated, the comparison result of the last
repeat cycle turns on one of the three special internal relays.
S1
D10
127
D10
42
S1
12
D30
–4
D30
S
U
'
M
ICRO
MART
SER
S
ANUAL
FC4A-D20RK1/RS1 & FC4A-D40K3/S3
X
M
R
T
C
D
Constant
X
X
X
X
X
X
X
X
X
X
▲ — — — —
M8150
M8151
ON
OFF
OFF
ON
OFF
OFF
S2
D20
50
D20
56
S2
–3
D40
–3
D40
»
Repeat
X
1-99
X
1-99
1-99
D1
M8152
Status
OFF
OFF
OFF
ON
ON
OFF
D1
Q0 turned on
Q0 turned off
D1
Q1 turned on
Q1 turned off

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents