Relay Ladder; Structured Text - Allen-Bradley Logix5000 Reference Manual

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Example 1:
0
20
0
15
1
Dimension 0
10
2
5
3
Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE)
Average array_dint, which is DINT[4,5].
Dimension 1
1
2
3
4
19
18
17
16
14
13
12
11
9
8
7
6
4
3
2
1

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;
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
19
+
14
+ +
9
------------------------------------ -
AVE
=
4
dint_ave = 12
Chapter 8
4
46
----- -
=
=
11.5
4
383

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents