Mitsubishi — Chapter 8 Application Instructions API 100-149

9 Application Instructions API 150-199 API 179 Operands: S : Source device n : Data length to be summed up D : Device for storing the result Explanations: 1. WSUM instruction sums up n devices starting from S and store the result in D. 2. The instruction supports EH3/SV2 series PLCs whose version is 1.0, EH2/SV series PLCs whose version is 1.8, and SX series PLCs whose version is 3.0 (and above). 3. If the specified source devices S are out of valid range, only the devices in valid range will be processed. 4. Valid range for n : 1~64. If the specified n value is out of the available range (1~64), PLC will take the upper (64) or lower (1) bound value as the set value. 5.

D used in the 16-bit/32-bit instruction is a 32-bit register. Program example 1: When X10 = ON, 3 consecutive devices ( n = 3) from D0 will be summed up and the result will be stored in (D11, D10). X10 (D0+D1+D2) (D11, D10) D0 K100 D1 K113 (D11, D10) Result: K338 K125 D2 DVP-PLC Application Manual 9-93 Mnemonic Operands Function D WSUM P Sum of multiple devices Type OP Bit Devices Word devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F WSUM, WSUMP: 7 steps DWSUM, DWSUMP: 13 steps S * * * n * * * D * * * PULSE 16-bit 32-bit SA SX SC EH SV EH3 SV2 ES EX SS SA SX SC EH SV EH3 SV2 ES EX SS SA SC EH3 ES EX SS S X EH SV SV2 WSUM D0 K3 D10