WHILE DO END_WHILE
Statement - Repeat a list of statements.
Syntax
WHILE <BOOL expression> DO
<statements>
END_WHILE ;
Remarks
The statements between DO and END_WHILE are executed while the boolean expression is TRUE. The condition is evaluated before the statements are executed. If the condition is FALSE when WHILE is first reached, statements are never executed.
|
Loop instructions may lead to infinite loops that block the target cycle. Never test the state of an input in the condition as the input will not be refreshed before the next cycle. |
ST Language
iMax := 10;
WHILE iPos < iMax DO
MyArray[iPos]:= 0;
iPos +:=1;
END_WHILE;
FBD Language
Not available.
LD Language
Not available.
WHILE DO END_WHILE |
IEC 61131-3 Automation platform > Programming - Reference guide > Basic Operations > WHILE DO END_WHILE |
Created with the Personal Edition of HelpNDoc: Full-featured EBook editor