9. Data Processing Design Examples 9.3 MEAN/SQR - Mean Value and Square Root Control Purpose: z When X0 = ON, calculate the mean of values in D0~D9 and store the value in D200; calculate the square root of D200 and save the value in D250. z When X1 = ON, calculate the mean of values in D100~D163, store the value in D300; calculate the square root of D300 and save the value in D350. Devices: Control Program: X0 X1 Program Description:
z If the data number falls out of the range between 1~64 in MEAN instruction, or if the SQR instruction specifies a negative value, PLC will regard it as an “instruction operation error.” DVP-PLC Application Examples 9-4 Device Function X0 Executing MEAN/SQR instruction to calculate 10 continuous data X1 Executing MEAN/SQR instruction to calculate 64 continuous data D0~D9 Storing historical data D200 Storing mean value D250 Storing square root of the mean value D100~D163 Storing historical data D300 Storing mean value D350 Storing square root of the mean value MEAN D0 D200 K10 SQR D200 D250 MEAN D100 D300 K64 SQR D300 D350