6 Application Instructions API 00-49 API 43 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 K3 D2 D0 DVP-PLC Application Manual 6-67 Mnemonic Operands Function D SUM P Sum of Active Bits Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F SUM, SUMP: 5 steps DSUM, DSUMP: 9 steps S * * * * * * * * * * * D * * * * * * * * PULSE 16-bit 32-bit EH3 SV2 ES EH3 EH3 ES EX SS SA SX SC EH SV EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SUM D0 D2 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0