EasyManua.ls Logo

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION - Page 168

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION
183 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...
153
Structured Text (ST Language) Specifications Appendix B
Precautions
WHILE must be used in combination with END_WHILE.
Before executing the expression, if the condition equation is false, the process will end without executing
the expression.
Statements that can be used in the expression are assignment statements, IF, CASE, FOR, WHILE, or
REPEAT.
Multiple statements can be executed in the expression. Be sure to use a semicolon (;) delimiter between
multiple statements in an expression.
The condition can also be specified as a boolean variable (BOOL data type) only rather than an equation.
Examples
Example 1: The value exceeding 1000 in increments of 7 is calculated and substituted for variable A.
A:=0;
WHILE A>=1000 DO
A:=A+7;
END_WHILE;
Example 2: While X<3000, the value of X is doubled, and the value is substituted for the array variable DATA[1].
The value of X is then multiplied by 2 again, and the value is substituted for the array variable DATA[2]. This
process is repeated.
n:=1’
WHILE X<3000 DO
X:=X*2;
DATA[n]:=X;
n:=n+1;
END_WHIE;
REPEAT Statement
Summary
This statement is used to repeatedly execute an expression until a specified condition is true.
Reserved Words
REPEAT, UNTIL, END_REPEAT
Statement Syntax
REPEAT
<expression>;
UNTIL <condition>
END_REPEAT
Processing Flow Chart
Expression
False
Iteration
Tr ue
End
Condition

Table of Contents

Related product manuals