Checking 16-bit binary data
SUM(P)
RnPCPU
RnCPU RnENCPU
(Process)
These instructions store the total number of "1" bits in the 16-bit binary data stored in the specified device.
Ladder
(s)
FBD/LD
EN
ENO
s
d
■Execution condition
Instruction
SUM
SUMP
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
Device containing data in which the total number of "1" bits
is to be counted
(d)
Device for storing the total number of bits
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L,
SM, F, B, SB,
FX, FY
(s)
(d)
Processing details
• These instructions store the total number of "1" bits in the 16-bit binary data, which is stored in the device specified by (s),
in the device specified by (d).
b15
∙∙∙
b8b7
(s)
1 1 0
0
1
0 1 1 0
0
b15
∙∙∙
b8b7
(d)
0 0 0
0
0
0 0 0 0
0
7 APPLICATION INSTRUCTIONS
914
7.20 Data Processing Instructions
RnPCPU
RnSFCPU RnSFCPU
(Redundant)
(Standard)
(Safety)
(d)
Execution condition
Word
J\
T, ST, C, D, W,
SD, SW, FD, R,
ZR, RD
∙∙∙
b0
1
1 0 0 0 1
∙∙∙
b0
0
0 1 0 0 0
ST
ENO:=SUM(EN,s,d);
ENO:=SUMP(EN,s,d);
Range
-32768 to 32767
Double word Indirect
U\G, J\,
Z
LT, LST,
U3E\(H)G
LC
The total number of 1s is stored in binary. (Eight 1s in the left example)
Data type
Data type (label)
16-bit signed binary
ANY16
16-bit signed binary
ANY16
Bit
BOOL
Bit
BOOL
Constant
specification
LZ
K, H E
Others
$