8. Function Commands
SUM, SUMP
- 279 -
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
B15……………………………………………B0
The total No. of bits set
to 1 is stored in D20.
6
Counter data
Counting with SUM command