6 BASIC INSTRUCTIONS
6.1 Comparison Operation Instructions
157
6
Comparing 16-bit binary block data
BKCMP(P)(_U)
These instructions perform a comparison operation between (n) point(s) of 16-bit binary data in the device starting from the
one specified by (s1) and (n) point(s) of 16-bit binary data in the device starting from the one specified by (s2), and store the
operation result in the device specified by (d).
■Descriptions, ranges, and data types
■Applicable devices
*1 T, ST, C cannot be used.
• These instructions perform a comparison operation between (n) point(s) of 16-bit binary data in the device starting from the
one specified by (s1) and (n) point(s) of 16-bit binary data in the device starting from the one specified by (s2), and store the
comparison result in (n) point(s) of data starting from the device specified by (d).
• The relevant devices of (n) point(s) of data starting from the device specified by (d) are turned ON when the comparison
conditions are met and turned OFF when the comparison conditions are not met.
• Comparison operation is performed in units of 16 bits.
Ladder diagram Structured text
( is to be replaced by any of the following: BKCMP=(P)(_U),
BKCMP<>(P)(_U), BKCMP>(P)(_U)< BKCMP<=(P)(_U), BKCMP<(P)(_U),
BKCMP>=(P)(_U).)
Not supported
Operand Description Range Data type Data type (label)
(s1) BKCMP(P) Comparison data or the device where the
comparison data is stored
-32768 to +32767 16-bit signed binary ANY16
BKCMP(P)_U 0 to 65535 16-bit unsigned binary ANY16_U
(s2) BKCMP(P) Device where the comparison source data is
stored
16-bit signed binary ANY16
BKCMP(P)_U 16-bit unsigned binary ANY16_U
(d) Head device storing comparison result Bit ANY_BOOL
(n) Number of data to be compared 0 to 65535 16-bit unsigned binary ANY16_U
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(s1)
(s2)
(d)
*1
(n)
∙∙∙
>
OFF
ON
OFF
ON
1234 (BIN)
5678 (BIN)
5000 (BIN)
7777 (BIN)
4321 (BIN)
(n)
(n) (n)
5321 (BIN)
3399 (BIN)
5678 (BIN)
6543 (BIN)
1200 (BIN)
(0)
(1)
(0)
(1)
ON
(1)
(s1)
(s1)+1
(s1)+(n-2)
(s1)+(n-1)
(s1)+2
∙∙∙
(s2)
(s2)+1
(s2)+(n-2)
(s2)+(n-1)
(s2)+2
∙∙∙
(d)
(d)+1
(d)+(n-2)
(d)+(n-1)
(d)+2
b15 b0∙∙∙b15 b0∙∙∙
Operation result