356
SUM, SUMP, DSUM, DSUMP
Program Example
(1) The following program searches D100 to D105 for the contents of D0 when X20 is ON, and stores the search results at
W0 and W1.
[Ladder Mode]
[List Mode]
[Operation]
(2) The following program searches D100 to D111 for the contents of D11 and D10 when X20 is ON, and stores the search
results at W0 and W1.
[Ladder Mode]
[List Mode]
[Operation]
: Head number of the devices where the total number of bits of "1" is counted (BIN 16/32 bits)
: Head number of the devices where the total number of the bits will be stored (BIN 16/32 bits)
SUM, SUMP
16-bit data check
DSUM, DSUMP
32-bit data check
7.5.2
SUM, SUMP, DSUM, DSUMP
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
K, H
Other
Bit
Word
Bit
Word
––
––
––
Step
Instruction
Device
Data
to
be
searched
123
Search
data
D0
123
122
123
300
500
32000
D103
D105
D101
D102
D100
D10
4
2
2
W
1
Search
resu
l
ts
Pos
i
t
i
on
of
match
N
umber
of
matches
W
0
Step
Instruction
Device
Data
to
be
searched
56789051
Search
data
D11
,
D10
D107
,
D106
D111
,
D110
D103
,
D102
D105
,
D10
4
D101
,
D100
D109
,
D108
2
3
W
1
Search
resu
l
ts
Pos
i
t
i
on
of
match
N
umber
of
matches
W
0
56789051
-
30000
30000
56789051
56789051
200000
Basic
Process
High
performance
Redundant Universal
LCPU
Command
Command
P
S
D
S
D
SUM, DSUM
SUMP, DSUMP
indicates an instruction s
y
mbol of S
U
M/DS
U
M.
S
D
S
D