Delta Electronics Extension Digital I/O Module DOP-EXIO14RAE User Manual
Page 136

Appendix D Use of Application Instructions|DOP-EXIO Series
Revision March, 2008, Doc. Name: 2007PDD23000014
D-55
Mnemonic
Operands Function
SUM
D
S
D
Sum of Active Bits
Bit Devices
Word Devices
X Y M S K H
KnX
KnY
KnM KnS
T
C
D
E
F
S
D
y
Note:
1. If S and D is used in device F, only 16-bit instruction is applicable.
16-bit instruction (5 Steps)
SUM
Continuous
execution
32-bit instruction (9 Steps)
DSUM
Continuous
execution
y
Flags: M1020 (Zero flag)
Operands:
S
: Source device
D
: Destination device for storing counted value
Explanations:
1. Among the bits of S, the total of bits whose content is “1” will be stored in D.
2. When all the 16 bits of S are “0”, zero flag M1020 = On.
3. When 32- instruction is in use, D will occupy 2 registers.
Program Example:
When X10 = On, among the 16 bits of D0, the total of bits whose content is “1” will be stored in D2.
X10
SUM
D0
D2
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
K3
D2
D0