IDEC FC4A-C10R2 User Manual page 231

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

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.
CMP>=(W)
I0
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.
CMP>=(W)
I0
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).
CMP>=(W)
I0
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.
CMP>=(W)
I0
This program turns the output off when the input is off.
CMP>=(W)
I0
M0
S1 R
S2 –
D1 –
REP
D10
15
M10
3
S1 R
S2 R
D1 –
REP
D10
D20
M10
3
S1 R
S2 R
D1 R
REP
D10
D20
M10
3
S1 –
S2 –
D1 –
REP
D10
C1
Q0
S1 –
S2 –
D1 –
REP
D10
C1
M0
Q0
« FC4A M
10: D
S1 (Repeat = 3)
D10
10
15
D11
20
D12
S1 (Repeat = 3)
10
D10
20
D11
D12
30
S1 (Repeat = 3)
10
D10
20
D11
D12
30
Input I0
D10 ≥ C1
Comparison
Result
D10 < C1
Comparison
Output Q0
Input I0
D10 ≥ C1
Comparison
Result
D10 < C1
Output Q0
S
U
'
M
ICRO
MART
SER
S
ANUAL
C
ATA
OMPARISON
S2 (Repeat = 0)
15
15
AND
15
S2 (Repeat = 3)
0
D20
20
D21
AND
D22
100
S2 (Repeat = 3)
0
D20
20
D21
D22
100
ON
OFF
ON
OFF
ON
OFF
ON
OFF
»
I
NSTRUCTIONS
D1 (Repeat = 0)
M10
D1 (Repeat = 0)
M10
D1 (Repeat = 3)
M10 turned on
M11 turned on
M12 turned off
10-3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents