DVP - ES2/EX2/SS2/SA2/SX2 Operation Manual - Programming

API

Mnemonic

Operands

Function

Controllers

179

D

WSUM

P

Sum of multiple

ES2/EX2

SS2

SA2 SX2

devices

 

 

SE

 

 

 

 

 

 

Type

Bit Devices

 

 

 

 

Word devices

 

 

 

 

 

 

Program Steps

OP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

Y

M

S

K

H

KnX

KnY

KnM

KnS

T

C

D

E

 

F

WSUM, WSUMP: 7 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

 

*

*

 

 

 

DWSUM, DWSUMP: 13

n

 

 

 

 

*

*

 

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

steps

 

 

D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

 

*

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

 

16-bit

 

 

 

 

32-bit

 

 

 

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

 

 

SE

SE

SE

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.If the specified source devices S are out of valid range, only the devices in valid range will be processed.

3.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.

Program example:

When X10 = ON, 3 consecutive devices (n = 3) from D0 will be summed up and the result will be stored in D10

 

X10

 

WSUM

D0

K3

D10

 

 

 

 

 

 

 

 

 

 

 

 

 

(D0+D1+D2)

 

 

D10

 

 

 

 

 

 

 

 

 

 

 

D0

K100

 

 

 

 

D1

K113

 

 

Result: D10

K338

 

 

 

 

D2

K125

 

 

 

3 - 406

Page 522
Image 522
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Wsum, DWSUM, Dwsump