FX Series Programmable Controlers Applied Instructions 5
5-60
5.5.6 MEAN (FNC 45)
Operation:
The range of source data is defined by operands S
and 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
range is summed and then divided by the number
of devices summed, i.e. n. This generates an
integer mean value which is stored in the
destination device (D). The remainder of the
calculated mean is ignored.
Points to note:
If the source area specified is actually smaller than the physically available area, then only 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 displayed. This can cause confusion as the mean value calculated manually using this
original n value will be different from that which is displayed.
If the value of nis specified outside of the stated range (1 to 64) an error is generated.
Mnemonic Function
Operands
Program steps
SD n
MEAN
FNC 45
(Mean)
Calculates the
mean of a range
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:
7steps
DMEAN,
DMEANP:
13steps
FX
1S
FX
1N
FX
2N
FX
2NC
PULSE-P
16 BIT OPERATION
32 BIT OPERATION
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