![IDEC OpenNet series Скачать руководство пользователя страница 274](http://html.mh-extra.com/html/idec/opennet-series/opennet-series_user-manual_617384274.webp)
19: C
OORDINATE
C
ONVERSION
I
NSTRUCTIONS
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
19-7
Example: AVRG
The following example demonstrates a program to calculate average values of the data register D100 and store the result to
data register D200 in every 500 scans.
When the sampling end input does not turn on
While sampling end input I10 is off, the average, maximum, and minimum values are calculated in every 500 scans and
stored to data registers D200, D201, and D202, respectively. Sampling completion output M100 is set every 500 scans.
When the sampling end input turns on
When sampling end input I10 turns on, the average, maximum, and minimum values at this point are stored to data regis-
ters D200, D201, and D202, respectively. Sampling completion output M100 is also set. When sampling end input I10
turns off, sampling resumes starting at the first scan.
M8125 is the in-operation output special internal relay.
M8125
S1
D100
S2
I10
AVRG(W)
D2
M100
S3
500
D1
D200
512
1st scan
497
2nd scan
521
500th scan
499
1st scan
478
2nd scan
In-operation Special IR M8125
ON
OFF
Sampling End Input I10
ON
OFF
Sampling Completion Output M100
ON
OFF
Sampling Data D100
Average Value D200
500
Maximum Value D201
530
Minimum Value D202
480
Values are set ever y 500 scans.
489
151st scan
510
152nd scan
509
153rd scan
504
421st scan
493
1st scan
In-operation Special IR M8125
ON
OFF
Sampling End Input I10
ON
OFF
Sampling Completion Output M100
ON
OFF
Sampling Data D100
Average Value D200
502
Maximum Value D201
513
Minimum Value D202
485
Values are set when I10 is turned on.
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]