![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/3/8d/38d56254-54fe-46e3-85ae-d3f5260e1091/38d56254-54fe-46e3-85ae-d3f5260e1091-bgac.png)
FX Series Programmable Controlers Applied Instructions 5
5-46
5.5.6 MEAN (FNC 45)
Operation:
The ran
e of source data is defined b
operands
Sand n. S is the head address of the source data
and n specifies the number of consecutive source
devices used.
The value of all the devices within the source
ran
e is summed and then divided b
the number
of devices summed, i.e. n. This
enerates an
inte
er mean value which is stored in the
destination device (D). The remainder of the
calculated mean is i
nored.
Points to note:
If the source area specified is actuall
smaller than the ph
sicall
available area, then onl
the
available devices are used. The actual value of n used to calculate the mean will reflect the
used, available devices. However, the value for n which was entered into the instruction will
still be displa
ed. This can cause confusion as the mean value calculated manuall
usin
this
ori
inal n value will be different from that which is displa
ed.
If the value of nis specified outside of the stated ran
e (1 to 64) an error is
enerated.
Mnemonic Function
Operands
Program steps
SD n
MEAN
FNC 45
(Mean)
Calculates the
mean of a ran
e
of devices
KnX, KnY,
KnM, KnS,
T, C, D
KnY, KnM,
KnS,
T, C, D, V, Z
K,H,
Note:
n= 1 to 64
MEAN,
MEANP:
7 steps
DMEAN,
DMEANP:
13steps
X0
D 10 K 3
[ S ] [ D ]
D 0
[ n ]
MEAN
General rule
Example
D= =
( S
0
+ S
1
+ < + S
n
)
n
Σ
S
S
0
n
S
n
D10=
(D0) + (D1) + (Dn)
3