6F3B0250
7. Instructions
FUN 164
AVE
Average value
T1S only
Expression
Input
Function
When the input is ON, this instruction calculates the average value of the data stored in the n registers starting with A, and stores the average value in B. The allowable range of the table size n is 1 to 64.
Execution condition
Input |
| Operation | Output |
OFF | No execution |
| OFF |
ON | Execution |
| ON |
Operand
| Name |
|
| Device |
|
|
|
|
|
| Register |
|
|
|
| Constant | Index | ||
|
| X | Y | R | S | T. | C. | XW | YW | RW | SW | T | C | D | I | J | K |
|
|
A | Start of table |
|
|
|
|
|
| Ö | Ö | Ö | Ö | Ö | Ö | Ö |
|
|
|
|
|
n | Table size |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 - 64 |
|
B | Result |
|
|
|
|
|
|
| Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö |
|
|
Example
When R012 is ON, the average value of the data stored in the register table D0200 to D0209 (10 words), and the average value is stored in D0520.
D0200
D0201
D0202
D0203
D0204
D0205
D0206
D0207
D0208
D0209
100
10000
10
0
200
20000
20
D0520
2900
(Average value)
246 T1/T1S User’s Manual
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net