3 . I n s t r u c t i o n S e t
M N050 03003E F or mo re infor ma tio n vi sit:
w w w. e a t o n . c o m
3-101
API Mnemonic
Operands
Function
45
D MEAN P
S, D, n
Mean Value
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
*
*
*
*
*
*
*
*
n
*
*
*
*
*
*
*
*
*
*
*
MEAN, MEANP: 7 steps
DMEAN, DMEANP: 13
steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
S
: Starting source address
D
: Destination address for the result
n
: Length of the
S
file
Description:
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
n
is out of the valid range (1~64), an error will be generated.
4. If
operands
D
,
n
use index F, then only 16-bit instruction is available.
5.
Valid range of operand
n
:
n
=1~64
Program Example:
When X20 = ON, add up the contents of the three registers starting from D0, and divide the sum
by three to get the mean value. Store this mean value in D10 and ignore the remainder.
MEAN
D0
K3
D10
X20
(D0+D1+D2)/K3
D10
D0
D1
D2
K100
K113
K125
K112
D10
Reminder = 3, be ignored
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...