Calculating The Mean Value Of 16-Bit Binary Data - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Motion module instructions, standard functions/ function blocks
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Calculating the mean value of 16-bit binary data

MEAN(_U)
These instructions calculate the average value of the (n) points of 16-bit data in the devices starting from the specified one.
ST
ENO:=MEAN(EN,s,n,d);
■Execution condition
Instruction
MEAN
MEAN_U
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
MEAN
Start device where the data for calculating the average value are
stored
MEAN_U
(d)
MEAN
Device for storing the mean value
MEAN_U
(n)
Number of data, or the device number where the number of data is
stored
EN
Execution condition
ENO
Execution result
*1 When specifying setting data by using a label, define an array to secure enough operation area and specify an element of the array
label.
■Applicable devices/labels
Operand
Bit
(s)
(d)
(n)
Processing details
• These instructions calculate the average value of the (n) points of 16-bit binary data in the devices starting from the one
specified by (s), and stores the average value in the device specified by (d).
(s)
(s)+1
(n)
(s)+2
(s)+(n)-1
(1) Mean value
• If the calculation result is not an integer, the first decimal place is rounded down.
• When (n) is 0, the processing is not performed.
Operation error
There is no operation error.
Execution condition
(d)
(1)
ENO:=MEAN_U(EN,s,n,d);
Range
0 to 65535
Word
8.1 Data Processing Instructions
Data type
*1
ANY16_S
*1
ANY16_U
ANY16_S
ANY16_U
ANY16
BOOL
BOOL
Constant
8 DATA PROCESSING
99
8

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents