EasyManua.ls Logo

Allen-Bradley Logix5000

Allen-Bradley Logix5000
708 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 383
Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE) Chapter 8
Example 1: Average array_dint, which is DINT[4,5].
Relay Ladder
Structured Text
SIZE(array_dint,0,length);
sum := 0;
FOR position = 0 TO (length-1) DO
sum := sum + array_dint[position];
END_FOR;
dint_ave := sum / length;
Dimension 1
Dimension 0
0
20 19 18 17 16
15 14 13 12 11
10 9 8 7 6
54321
1
2
3
01234
AVE
19 14 9 4+++
4
-------------------------------------
46
4
------
11.5===
dint_ave = 12
Sub
s
cripts

Table of Contents

Other manuals for Allen-Bradley Logix5000

Related product manuals