![IDEC OpenNet series Скачать руководство пользователя страница 273](http://html.mh-extra.com/html/idec/opennet-series/opennet-series_user-manual_617384273.webp)
19: C
OORDINATE
C
ONVERSION
I
NSTRUCTIONS
19-6
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
AVRG (Average)
Valid Operands
For the valid operand number range, see page 6-2.
▲
Internal relays M0 through M2557 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 is read out.
While input is on, the AVRG instruction is executed in each scan. When the quantity of sampling cycles designated by
operand S3 is 1 through 65535, sampling data designated by operand S1 is processed in each scan. When the designated
sampling cycles have been completed, the average value of the sampling data is set to operand designated by D1. The max-
imum value of the sampling data is set to the next operand, D1+1. The minimum value of the sampling data is set to the
next operand, D1+2. The sampling completion output designated by operand D2 is turned on.
When the quantity of sampling cycles designated by operand 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 operand S2 is turned on. Then, the aver-
age, maximum, and minimum values are set to 3 operands starting with operand designated by D1.
When the sampling exceeds 65535 cycles, the average, maximum, and minimum values at this point are set to 3 operands
starting with operand designated by D1, and sampling continues.
When the sampling end input is turned on before the sampling cycles designated by operand S3 have not been completed,
sampling is stopped and the results at this point are set to 3 operands starting with operand 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 operand as a dummy for source oper-
and S2.
Valid Data Types
When a bit operand such as I (input), Q (output), M (internal relay), or R (shift register) is designated as the source or des-
tination, 16 points (word or integer data type) are used.
When a word operand such as T (timer), C (counter), D (data register), or L (link register) is designated as the source or
destination, 1 point (word or integer data type) is used.
Operand
Function
I
Q
M
R
T
C
D
L
Constant
Repeat
S1 (Source 1)
Sampling data
X
X
X
X
X
X
X
X
—
—
S2 (Source 2)
Sampling end input
X
X
X
X
—
—
—
—
—
—
S3 (Source 3)
Sampling cycles
X
X
X
X
X
X
X
X
0-65535
—
D1 (Destination 1)
First operand number to store results
—
—
—
—
—
—
X
X
—
—
D2 (Destination 2)
Sampling completion output
—
X
▲
—
—
—
—
—
—
—
W (word)
I (integer)
D (double word)
L (long)
X
X
—
—
When input is on, sampling data designated by oper-
and S1 is processed according to sampling conditions
designated by operands S2 and S3.
When sampling is complete, average, maximum, and
minimum values are stored to 3 consecutive operands
starting with operand designated by D1, then sam-
pling completion output designated by operand D2 is
turned on.
This instruction is effective for data processing of
analog input values. A maximum of 10 AVRG
instructions can be programmed in a user program.
AVRG(*)
S1
*****
S3
*****
D1
*****
S2
*****
D2
*****
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]