916
7 APPLICATION INSTRUCTIONS
7.20 Data Processing Instructions
Checking 32-bit binary data
DSUM(P)
These instructions store the total number of "1" bits in the 32-bit binary data stored in the specified device.
■Execution condition
■Descriptions, ranges, and data types
■Applicable devices
• These instructions store the total number of "1" bits in the 32-bit binary data, which is stored in the device specified by (s),
in the device specified by (d).
Ladder ST
ENO:=DSUM(EN,s,d);
ENO:=DSUMP(EN,s,d);
FBD/LD
Instruction Execution condition
DSUM
DSUMP
Operand Description Range Data type Data type (label)
(s) Start device containing data in which the total number of "1"
bits is to be counted
-2147483648 to 2147483647 32-bit signed binary ANY32
(d) Device for storing the total number of bits 16-bit signed binary ANY16
EN Execution condition Bit BOOL
ENO Execution result Bit BOOL
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB,
FX, FY
J\ T, ST, C, D, W,
SD, SW, FD, R,
ZR, RD
U\G, J\,
U3E\(H)G
Z LT, LST,
LC
LZ K, H E $
(s)
(d)
The total number of 1s is stored in binary. (Sixteen 1s in the left example)
RnCPU
RnENCPU
RnSFCPU RnSFCPURnPCPURnPCPU
(Standard) (Safety)
(Redundant)
(Process)
b31 b16
100 11 1001 1000111
b15 b0
000 01 0001 1110110
(d)
b15 b8b7 b0
000 00 0000 0010000
(s)+1 (s)