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

API

45

Mnemonic

Operands

Function

Controllers

D

MEAN

P

Mean

ES2/EX2

SS2

SA2

SX2

SE

Type

 

Bit Devices

 

 

 

 

Word devices

 

 

 

 

 

 

Program Steps

 

OP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

Y

M

S

 

K

H

KnX

KnY

KnM

KnS

T

C

D

E

F

MEAN, MEANP: 7 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S

 

 

 

 

 

 

 

 

*

*

*

 

 

*

*

*

*

 

 

 

DMEAN, DMEANP: 13

D

 

 

 

 

 

 

 

 

 

*

*

 

 

*

*

*

*

 

*

*

n

 

 

 

 

 

 

*

*

*

*

*

 

 

*

*

*

*

 

*

*

steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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 D: Destination for storing result

 

n: Number of consecutive device from S

 

Explanations:

1.The instruction obtains the mean value from n consecutive registers from S and stores the value in D.

2.Remainders in the operation will be ignored.

3.If S is not within the valid range, only those addresses within the valid range will be processed.

4.If n is out of the valid range (1~64), PLC will determine it as an “instruction operation error”.

5.If operand D uses index F, only a 16-bit instruction is available.

6.Valid range of operand n : n = 1~64

Program Example:

When X10 = ON, the contents in 3 (n = 3) registers starting from D0 will be summed and then divided by 3 to obtain the mean value. The result will be stored in D10 and the remainder will be left out

X10

MEAN D0 D10 K3

(D0+D1+D2)/3 D10

D0 K100

D1

K113

 

D10

K112

 

Remainder = 3, left out

D2 K125

3 - 110

Page 226
Image 226
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Mean, DMEAN, Dmeanp