7-62
7.5 Data Processing Instructions
7.5.2 16-/32-bit data bit check
SUM, DSUM
7.5.2
16-/32-bit data bit check
SUM, DSUM
Function
SUM(P)
From the 16-bit data in the device specified for
, stores the total number of bits set to 1, to
the device specified for
.
SUM(P)
DSUM(P)
P: Executing condition
:
indicates any of the following
instructions.
SUM
SUMP
DSUM
DSUMP
Input argument,
EN:
Executing condition
:Bit
s:
Data whose total number of bits set to 1 is counted
:ANY16/32
Output argument,
ENO:
Execution result
:Bit
d:
Start number of the device that stores the total number of bits :ANY16
Setting
data
Internal device
R, ZR
J
\
U
\G
Zn
Constant
K, H
Others
Bit
Word
Bit
Word
−
−
−
Universal
UD
High
Performance
Structured ladder
ST
S
U
M
EN
ENO
s
d
S
U
M
(EN,
s
, d);
ENO:=
s
d
s
d
b15
b8
1 1 0 0 1 0 1 1 0 0 1 1 0 0 0 1
b0
b7
b15
b8
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
b0
b7
T
ota
l
num
b
er
of
bi
ts
w
here
1 i
s
set
S
tores
the
tota
l
num
b
er
of
bi
ts
w
here
1 i
s
set
i
n
B
IN d
ata
.
(T
here
are
8 bi
ts
w
here
1 i
s
set
i
n
the
examp
l
e
.)
s
d
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......