EasyManuals Logo

Omron CX-PROGRAMMER V8.1 User Manual

Omron CX-PROGRAMMER V8.1
231 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
Page #182 background imageLoading...
Page #182 background image
157
Statement Descriptions Section 5-5
Reserved Words
WHILE, DO, END_WHILE
Statement Syntax
WHILE <condition> DO
<expression>;
END_WHILE;
Processing Flow Chart
Usage
Use the WHILE statement when the number of iterations has not been deter-
mined beforehand (depends on the condition being met) to repeat specified
processing for the duration that the condition is met. This statement can be
used to execute processing while the condition equation is true only (pretest
loop).
Description
Before the expression is executed, the condition is evaluated.
If the condition is true, the expression is executed. Afterwards, the condition is
evaluated again. This process is repeated. If the condition is false, the expres-
sion is not executed and the condition evaluation ends.
Precautions
WHILE must be used in combination with END_WHILE.
Before executing the expression, if the condition equation is false, the pro-
cess will end without executing the expression.
Statements that can be used in the expression are assignment state-
ments, 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;
Iteration
Condition
Expression
False
Tr ue
End

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CX-PROGRAMMER V8.1 and is the answer not in the manual?

Omron CX-PROGRAMMER V8.1 Specifications

General IconGeneral
BrandOmron
ModelCX-PROGRAMMER V8.1
CategorySoftware
LanguageEnglish

Related product manuals