Structured Text Programming
532 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018
Affects Math Status Flags
No
Fault Conditions
A major fault will occur if Fault type Fault code
The construct loops too long 6 1
Example 1
If performing the following, Enter this structured text
The REPEAT_UNTIL loop executes the statements in the construct and then
determines if the conditions are true before executing the statements again. This
differs from the WHILE_DO loop because the WHILE_DO The WHILE_DO loop
evaluates its conditions first.
If the conditions are true, the controller then executes the statements within the
loop. The statements in a REPEAT_UNTIL loop are always executed at least once.
The statements in a WHILE_DO loop might never be executed.
pos := -1;
REPEAT
pos := pos + 2;
UNTIL ((pos = 101) OR
(structarray[pos].value = targetvalue))
end_repeat;