Avrg (Average) - IDEC MICROSmart FC6A Series Ladder Programming Manual

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

17: A
VERAGE
Introduction
This chapter describes the average instructions that average the specified data.

AVRG (Average)

AVRG(*)
*****
The AVRG instruction is effective for data processing of analog input values. A maximum of 32 AVRG instructions can be programmed in a user
program.
Valid Devices
Device
S1 (Source 1)
S2 (Source 2)
S3 (Source 3)
D1 (Destination 1)
D2 (Destination 2)
For valid device address ranges, see "Device Addresses" on page 2-1.
Special internal relays cannot be designated as D2.
When T (timer) or C (counter) is used as S1 or S3, the timer/counter current value (TC or CC) is displayed.
When F (float) data is selected, only data registers can be designated as S1 and D1.
While input is on, the AVRG instruction is executed in each scan. When the quantity of sampling cycles (scan times) designated by device S3 is 1
through 65,535, sampling data designated by device S1 is processed in each scan. When the designated sampling cycles have been completed, the
average value of the sampling data is set to the device designated by D1 (data type W or I) or D1·D1+1 (data type D, L, or F). The maximum value
of the sampling data is set to the next device, D1+1 (data type W or I) or D1+2·D1+3 (data type D, L, or F). The minimum value of the sampling
data is set to the next device, D1+2 (data type W or I) or D1+4·D1+5 (data type D, L, or F). The sampling completion output designated by device
D2 is turned on.
When the quantity of sampling cycles designated by device S3 is 0, sampling is started when the input to the AVRG instruction is turned on, and
stopped when the sampling end input designated by device S2 is turned on. Then, the average, maximum, and minimum values are set to 3 devices
starting with device designated by D1.
When the sampling exceeds 65,535 cycles, the average, maximum, and minimum values at this point are set to 3 devices starting with device
designated by D1, and sampling continues.
When the sampling end input is turned on before the sampling cycles designated by device S3 have been completed, sampling is stopped and the
results at this point are set to 3 devices starting with device designated by D1.
The average value is calculated to units, rounding the fractions of one decimal place.
When the sampling end input is not used, designate an internal relay or another valid device as a dummy for source device S2.
When F (float) data is selected and S1 does not comply with the normal floating-point format, a user program execution error will result, turning on
special internal relay M8004 and ERR LED on the FC6A Series MICROSmart. When an error occurs, incorrect S1 data are skipped. Average,
maximum, and minimum values are calculated from correct S1 data, and set to 3 devices starting with the device designated by D1. For details
about user program execution errors, see "User Program Execution Errors" on page 3-10.
I
NSTRUCTIONS
S1
S2
S3
*****
*****
*****
Function
Sampling data
Sampling end input
Sampling cycles (scan times)
First device address to store results
Sampling completion output
FC6A S
MICROS
ERIES
MART
When input is on, sampling data assigned by device S1 is
processed according to sampling conditions assigned by devices
D1
D2
S2 and S3.
*****
When sampling is complete, average, maximum, and minimum
values are stored to 3 consecutive devices starting with device
assigned by D1, then sampling completion output assigned by
device D2 is turned on.
Data Type
Average
Maximum value
Minimum value
I
Q
X
X
X
X
X
X
X
L
P
M
ADDER
ROGRAMMING
W, I
D1
D1+1
D1+2
M
R
T
C
D
P
X
X
X
X
X
X
X
X
X
X
X
X
X
FC9Y-B1726
ANUAL
D, L, F
D1·D1+1
D1+2·D1+3
D1+4·D1+5
Constant
Repeat
0-65,535
17-1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents