Allen-Bradley Logix5000 Reference Manual page 691

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

Advertisement

BOOL expression
True
Statement 1
Statement 2
Statement 3
Statement 4
...
While the bool_expression is true, the controller
executes only the statements within the WHILE...DO
loop.
Arithmetic Status Flags:
Fault Conditions:
Example 1:
If you want this
The WHILE...DO loop evaluates its conditions first. If the conditions
are true, the controller then executes the statements within the loop.
This differs from the REPEAT...UNTIL loop because the
REPEAT...UNTIL loop executes the statements in the construct and
then determines if the conditions are true before executing the
statements again. The statements in a REPEAT...UNTIL loop are
always executed at least once. The statements in a WHILE...DO loop
might never be executed.
The following diagrams show how a WHILE...DO loop executes and how an
EXIT statement leaves the loop early.
False
Rest Of The Routine
Not affected
A major fault will occur if
The construct loops too long
Enter this structured text
pos := 0;
While ((pos <= 100) & structarray[pos].value <> targetvalue)) do
end_while;
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Structured Text Programming
BOOL expression
True
Statement 1
Statement 2
Statement 3
Statement 4
...
Exit ?
No
To stop the loop before the conditions are true, use an EXIT
statement.
Fault type
6
pos := pos + 2;
String_tag.DATA[pos] := SINT_array[pos];
Appendix C
False
Yes
Rest Of The Routine
Fault code
1
691

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents