10: D
ATA
C
OMPARISON
I
NSTRUCTIONS
« FC4A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
»
10-3
Repeat Operation in the Data Comparison Instructions
The following examples are described using the CMP
≥
instruction of the word data type. Repeat operation for all other
data comparison instructions and the integer data type is the same for the following examples.
Repeat One Source Operand
When only S1 (source) is designated to repeat, source operands (as many as the repeat cycles, starting with the operand
designated by S1) are compared with the operand designated by S2. The comparison results are ANDed and set to the des-
tination operand designated by D1.
Repeat Two Source Operands
When S1 (source) and S2 (source) are designated to repeat, source operands (as many as the repeat cycles, starting with
the operands designated by S1 and S2) are compared with each other. The comparison results are ANDed and set to the
destination operand designated by D1.
Repeat Source and Destination Operands
When S1, S2 (source), and D1 (destination) are designated to repeat, source operands (as many as the repeat cycles, start-
ing with the operands designated by S1 and S2) are compared with each other. The comparison results are set to destina-
tion operands (as many as the repeat cycles, starting with the operand designated by D1).
Comparison Output Status
The comparison output is usually maintained while the input to the data comparison instruction is off. If the comparison
output is on, the on status is maintained when the input is turned off as demonstrated by this program.
This program turns the output off when the input is off.
I0
REP
3
S1 R
D10
D1 –
M10
CMP>=(W)
S2 –
15
AND
15
D11
10
D10
20
D12
M10
S1 (Repeat = 3)
D1 (Repeat = 0)
S2 (Repeat = 0)
15
15
15
AND
M10
I0
REP
3
S1 R
D10
D1 –
M10
CMP>=(W)
S2 R
D20
20
D21
0
D20
100
D22
S2 (Repeat = 3)
D1 (Repeat = 0)
20
D11
10
D10
30
D12
S1 (Repeat = 3)
I0
REP
3
S1 R
D10
D1 R
M10
CMP>=(W)
S2 R
D20
20
D21
0
D20
100
D22
M11 turned on
M10 turned on
M12 turned off
S2 (Repeat = 3)
D1 (Repeat = 3)
20
D11
10
D10
30
D12
S1 (Repeat = 3)
Input I0
ON
OFF
Comparison
D10
≥
C1
D10 < C1
Comparison
ON
OFF
I0
REP
S1 –
D10
D1 –
Q0
CMP>=(W)
Result
Output Q0
S2 –
C1
I0
M0
REP
S1 –
D10
D1 –
M0
S2 –
C1
Input I0
ON
OFF
Comparison
D10
≥
C1
D10 < C1
ON
OFF
Result
Output Q0
CMP>=(W)
Q0
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 ...