Delta Electronics Programmable Logic Controller DVP-PLC User Manual
Page 275

6 Application Instructions API 00-49
DVP-PLC Application Manual
6-63
API Mnemonic
Operands
Function
43
D SUM P
Sum of Active Bits
Controllers
ES/EX/SS SA/SX/SC EH/SV
Bit Devices
Word Devices
Program Steps
Type
OP
X Y M S K H
KnX
KnY KnM KnS T C D E F
S
* *
*
*
*
*
*
*
*
*
*
D
*
*
*
*
*
*
*
*
SUM, SUMP: 5 steps
DSUM, DSUMP: 9 steps
PULSE 16-bit 32-bit
ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV
Operands:
S
: Source device D: Destination device for storing counted value
Explanations:
1. If
S
and D are used in device F, only 16-bit instruction is applicable.
2.
See the specifications of each model for their range of use.
3.
Flag: M1020 (zero flag)
4.
Among the bits of S, the total of bits whose content is “1” will be stored in D.
5.
When all the 16 bits of S are “0”, zero flag M1020 = On.
6.
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