FT1A S
MART
A
XIS
U
SER
’
S
M
ANUAL
FT9Y-B1382
18-1
18: A
VERAGE
I
NSTRUCTIONS
Introduction
Average instructions are instructions that average the specified data.
AVRG (Average)
The AVRG instruction is effective for data processing of analog input values. A maximum of eight AVRG instructions can be programmed in a user
program.
Applicable CPU Modules
Valid Devices
For the valid device address range, see pages 6-1 and 6-2
(Basic Vol.).
Internal relays M0 through M1277 can be designated as D2. 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 read out.
When F (float) data type 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 65535, 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 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 65535 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 type 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 CPU module. 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 device designated by D1. For details about the user
program execution errors, see Chapter 4 “User Program Execution Errors” on page 4-21.
When input is on, sampling data designated by device S1 is
processed according to sampling conditions designated by
devices S2 and S3.
When sampling is complete, average, maximum, and minimum
values are stored to 3 consecutive devices starting with device
designated by D1, then sampling completion output designated
by device D2 is turned on.
AVRG(*)
S1
*****
S3
*****
D1
*****
S2
*****
D2
*****
Data Type
W, I
D, L, F
Average
D1
D1·D1+1
Maximum value
D1+1
D1+2·D1+3
Minimum value
D1+2
D1+4·D1+5
FT1A-12
FT1A-24
FT1A-40
FT1A-48
FT1A-Touch
X
X
X
X
X
Device
Function
I
Q
M
R
T
C
D
Constant
Repeat
S1 (Source 1)
Sampling data
X
X
X
X
X
X
X
—
—
S2 (Source 2)
Sampling end input
X
X
X
X
—
—
—
—
—
S3 (Source 3)
Sampling cycles (scan times)
X
X
X
X
X
X
X
0-65535
—
D1 (Destination 1)
First device address to store results
—
—
—
—
—
—
X
—
—
D2 (Destination 2)
Sampling completion output
—
X
—
—
—
—
—
—
Summary of Contents for microsmart pentra
Page 1: ...FT1A SERIES FC9Y B1382 Ladder Programming Manual ...
Page 6: ...Preface 5 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 104: ...7 DATA COMPARISON INSTRUCTIONS 7 10 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 122: ...8 BINARY ARITHMETIC INSTRUCTIONS 8 18 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 138: ...10 SHIFT ROTATE INSTRUCTIONS 10 12 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 162: ...11 DATA CONVERSION INSTRUCTIONS 11 24 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 188: ...12 CALENDAR COMPARISON INSTRUCTIONS 12 26 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 198: ...15 REFRESH INSTRUCTIONS 15 4 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 202: ...16 INTERRUPT CONTROL INSTRUCTIONS 16 4 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 266: ...20 DUAL TEACHING TIMER INSTRUCTIONS 20 4 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 318: ...25 USER COMMUNICATION INSTRUCTIONS 25 22 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...