7 Applied Instructions
7.5 Data Operation
253
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
1
Outline
2
Instruction List
3
Configuration of 
Instruction
4
How to Read 
Explanation of 
Instructions
5
Basic Instruction
6
Step Ladder 
Instructions
7
Applied 
Instructions
8
Interrupt Function 
and Pulse Catch 
Function
A
Relationships 
between devices 
and addresses
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) When handling 32-bit data in a structured program, a 16-bit device cannot be specified directly as in the
case of a simple project. Use a label to handle 32-bit data.  
A 32-bit counter can be specified directly as it is a 32-bit long device.  
Use a global label to specify a device. 
2) The FX
U PLC of V2.30 or earlier does not support 32-bit instructions. 
3) When a device number is exceeded, "n" is handled as a smaller value in the possible range.
4) Some restrictions to applicable devices
S1:The FX
3U, FX3UC and FX3G PLCs only are applicable. 
S2: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
Label 1
*1
n
[     +1,      ]
Command input
Label 2
*2
*1 This defines the head device number that stores the data to be averaged. 
*2 This defines the device that stores the mean 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]
[ ST ]
MEAN(X000, D0, K3, D10);