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