7.5 Data Processing Instructions
7.5.2 16-/32-bit data bit check
7-63
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
SUM, DSUM
SUM, DSUM
DSUM(P)
From the 32-bit data in the device specified for
, stores the total number of bits where 1 is
set, to the device specified for
.
O
peration Error
No operation error occurs in the execution of the SUM(P) and DSUM(P) instructions.
Program Example
(1) In the following program, the number of bits which are turned ON in the devices from X8 to
X17 are stored to Var_D0 when X10 turns ON.
[Structured ladder]
[ST]
SUMP(X10,K4X8,D0);
[Operation]
s
d
s
d
1 0 0 1 1 1 0 0 1 0 1 0 0 1 1 1
b15
b8
0 0 0 0 0 0 0 0 0 0 0 1 0 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
16 bi
ts
w
here
1 i
s
set
i
n
the
examp
l
e
.)
0 0 0 1 0 0 0 0 1 1 1 1 0 1 1 0
b31
b16 b15
b0
X
17
0 0 1 0 1 0 1 1 0 0 0 0 0 1 1 1
X
8
S
tores
the
tota
l
num
b
er
of
bi
ts
w
here
1 i
s
set
to
D
0.
Var
_
D
0
7
Содержание MELSEC Q Series
Страница 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Страница 2: ......
Страница 14: ...A 12 MEMO ...
Страница 340: ...6 178 MEMO MTR ...
Страница 708: ...7 368 MEMO ...
Страница 776: ...8 68 MEMO ...
Страница 796: ...9 20 MEMO ...
Страница 804: ...App 8 MEMO ...
Страница 812: ...Index 8 MEMO ...
Страница 815: ......