Mitsubishi Electronics FX3S Benutzerhandbuch
330
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
Series
Programming Manual - Basic & Applied Instruction Edition
12 Data Operation – FNC 40 to FNC 49
12.6 FNC 45 – MEAN / Mean
12.6
FNC 45 – MEAN / Mean
Outline
This instruction obtains the mean value of data.
1. Instruction format
2. Set data
3. Applicable devices
S1: This function is supported only in FX
3G
/FX
3GC
/FX
3U
/FX
3UC
PLCs.
S2: This function is supported only in FX
3U
/FX
3UC
PLCs.
Explanation of function and operation
1. 16-bit operation (MEAN and MEANP)
The mean value of "n" 16-bit data from
is stored to
.
• The sum is obtained as algebraic sum, and divided by "n".
• The remainder is ignored.
• The remainder is ignored.
2. 32-bit operation (DMEAN and DMEANP)
The mean value of "n" 32-bit data from [
+1,
] is stored to [
+1,
].
• The sum is obtained as algebraic sum, and divided by "n".
• The remainder is ignored.
• The remainder is ignored.
Operand type
Description
Data type
Head word device number storing data to be averaged
16- or 32-bit binary
Word device number storing the mean value result
16- or 32-bit binary
n
Number of data to be averaged (n = 1 to 64)
16- or 32-bit binary
Oper-
and
Type
Bit Devices
Word Devices
Others
System User
Digit Specification
System User
Special
Unit
Index
Con-
stant
stant
Real
Number
Charac-
ter String
Pointer
X Y M T C S D .b KnX KnY KnM KnS T C D
R U \G
V Z Modify K H
E
" "
P
S1
S2
S1
S2
n
S1
DMEAN
DMEANP
Mnemonic
Operation Condition
P
FNC 45
MEAN
D
16-bit Instruction
7 steps MEAN
MEANP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Pulse (Single)
Operation
32-bit Instruction
13 steps
Continuous
Operation
Pulse (Single)
Pulse (Single)
Operation
S
1
S
D
S
1
S
S
2
D
D
1
S
D
1
D
Command
input
FNC 45
MEAN
n
S
D
n
S
S
S
+ + 1 +
……… + + n − 1
D
D
1
S
D
1
S
D
1
D
D
1
D
[ + 1, ] + [ + 3, + 2] +
……… + [{ + n × 2 − 1}, { + n × 2 − 2}]
[ + 1, ]
Command
input
FNC 45
DMEAN
n
S
D
n
S
S
S
S
S
S
D
D