Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 233

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

■Applicable devices
Operand
Bit
X, Y, M, L,
J\
SM, F, B, SB,
FX, FY
(s1)
(s2)
(d)
(n)
Processing details
• These instructions compare the (n) points of 16-bit binary data from the device specified by (s1) with the (n) points of 16-bit
binary data from the device specified by (s2), and stores the operation result in the device specified by (d) and later.
• If the comparison condition is satisfied, the relevant device specified by (d) turns on; otherwise, the device turns off.
(s1)
1234
(BIN)
(s1)+1
5678
(BIN)
(s1)+2
5000
(BIN)
(n)
(s1)+(n)-2
7777
(BIN)
(s1)+(n)-1
4321
(BIN)
• Specify data in units of 16 bits.
• A constant can be specified for (s1).
=
(s1)
32000
(BIN)
• The following table lists the comparison operation results of each instruction.
Instruction symbol (ladder, FBD/LD)
BKCMP=(P)(_U), BKCMP_EQ(P)(_U)
BKCMP<>(P)(_U), BKCMP_NE(P)(_U)
BKCMP>(P)(_U), BKCMP_GT(P)(_U)
BKCMP<=(P)(_U), BKCMP_LE(P)(_U)
BKCMP<(P)(_U), BKCMP_LT(P)(_U)
BKCMP>=(P)(_U), BKCMP_GE(P)(_U)
BKCMP=(P)(_U), BKCMP_EQ(P)(_U)
BKCMP<>(P)(_U), BKCMP_NE(P)(_U)
BKCMP>(P)(_U), BKCMP_GT(P)(_U)
BKCMP<=(P)(_U), BKCMP_LE(P)(_U)
BKCMP<(P)(_U), BKCMP_LT(P)(_U)
BKCMP>=(P)(_U), BKCMP_GE(P)(_U)
• When the comparison operation results stored in (n) points from the device specified by (d) are all on (1), SM704 turns on.
Operation error
Error code
Description
(SD0)
2821H
The device ranges starting from the ones specified by (s1) and (d) are overlapping.
The device ranges starting from the ones specified by (s2) and (d) are overlapping.
Word
T, ST, C, D, W,
U\G, J\,
SD, SW, FD, R,
U3E\(H)G
ZR, RD
(s2)
5321
(BIN)
(s2)+1
3399
(BIN)
(s2)+2
5678
(BIN)
>
(s2)+(n)-2
6543
(BIN)
(s2)+(n)-1
1200
(BIN)
(s2)
32000
(BIN)
(s2)+1
4321
(BIN)
(s2)+2
32000
(BIN)
(n)
(s2)+(n)-2
1234
(BIN)
(s2)+(n)-1
5678
(BIN)
Condition
(s1)=(s2)
(s1)(s2)
(s1)>(s2)
(s1)(s2)
(s1)<(s2)
(s1)(s2)
(s1)(s2)
(s1)=(s2)
(s1)(s2)
(s1)>(s2)
(s1)(s2)
(s1)<(s2)
Double word Indirect
Z
LT, LST,
LZ
LC
(d)
OFF
(d)+1
ON
(d)+2
OFF
(n)
(d)+(n)-2
ON
(d)+(n)-1
ON
(d)
ON
(1)
(d)+1
OFF
(0)
(d)+2
ON
(1)
(d)+(n)-2
OFF
(0)
(d)+(n)-1
OFF
(0)
Result
On (1)
Off (0)
6.1 Comparison Operation Instructions
Constant
Others
specification
K, H E
$
(0)
(1)
(0)
(n)
(1)
(1)
(n)
6 BASIC INSTRUCTIONS
6
231

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents