Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
11 Applied Instructions (Data Operation)
11.6 MEAN / Mean
243
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
11
Applied Instructions
(Data Operation)
12
Applied Instructions
(High Speed
Processing)
13
Applied Instructions
(Handy
Instruction)
14
Applied Instructions
(External FX I/O
Device)
15
Applied Instructions
(External Device
(optional device))
16
Applied Instructions
(External Device)
17
Applied Instructions
(Data Transfer 2)
18
Applied Instructions
(Floating Point)
19
Applied Instructions
(Data Operation 2)
20
Applied Instructions
(Positioning
Control)
Function and operation explanation
1. 16-bit operation (MEAN, MEANP)
The mean value of "n" 16-bit data from the device specified by is stored to the device specified by .
The sum is obtained as algebraic sum, and divided by "n".
The remainder is ignored.
2. 32-bit operation (DMEAN, DMEANP)
The mean value of "n" 32-bit data from the device specified by is stored to the device specified by .
The sum is obtained as algebraic sum, and divided by "n".
The remainder is ignored.
Cautions
1) 32-bit instructions are not provided in the FXU PLC Ver. 2.30 or earlier.
2) When a device number is exceeded, "n" is handled as a smaller value in the possible range.
3) Some restrictions to applicable devices
S1:The FX
3S, FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable.
S2:The FX
3G, FX3GC, FX3U and FX3UC PLCs only are applicable.
S3:The FX
3U and FX3UC PLCs only are applicable.
Error
When "n" is any value outside the range from "1" to "64", an operation error (M8067) is caused.
Program examples
The data of D0, D1 and D2 are summed, divided by "3", and then stored to D10.
Command input
Mean data
Resulting data
MEAN
EN
s
n
ENO
d
Number of
pieces of data
n
+ +1+ ····· + +n–1
s s s
d
Mean data
n
[ +1, ]
Command input
Resulting data
DMEAN
EN
s
n
ENO
d
Number of
pieces of data
d
[ +1, ] + [ +3, +2] + ····· + [{ +n × 2–1}], [{ +n × 2–2}]
s s s
s
s s
d
X000
D0
D10
MEAN
EN
s
n
ENO
d
K3
(D 0) + (D 1) + (D 2)
(D 10)
3
[Structured ladder/FBD]
[ ST ]
MEAN(X000, D0, K3, D10);