Program example
Program to obtain the No. of D10 data bits that are set to ON (1) when XB turns ON.
XB
10
SUM
D10
Counter data
B15...................................................B0
D10
1 1
0
0
0
0
1 0
The total No. of bits set
to "1" is stored in D20
Counting with SUM command
- 173 -
Coding
No. of
Com-
D20
steps
mand
10
LD
11
SUM
15
0
0
1
0
0
0 1
1
D20
SUM
Device
XB
D10
D20
6