![Omron CX-PROGRAMMER V8.1 Скачать руководство пользователя страница 184](http://html1.mh-extra.com/html/omron/cx-programmer-v8-1/cx-programmer-v8-1_operation-manual_744203184.webp)
159
Statement Descriptions
Section 5-5
• 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: Numeric values from 1 through 10 are incremented and the total
is substituted for the variable TOTAL.
A:=1;
TOTAL:=0;
REPEAT
TOTAL:=TOTAL+A;
A:=A+1;
UNTIL A>10
END_REPEAT;
EXIT Statement
■
Summary
This statement is used within iteration statements (FOR, WHILE, REPEAT)
only to force an iteration statement to end. This statement can also be used
within an IF statement to force an iteration statement to end when a specified
condition is met.
■
Reserved Words
EXIT
■
Statement Syntax (Example: Using within IF Statement)
FOR (WHILE, REPEAT)
expression
...
IF
<
condition
>
THEN EXIT;
END_IF;
...
END_FOR (WHILE, REPEAT);
■
Usage
Use the EXIT statement to force iteration processing to end before the end
condition is met.
■
Description (Example: Using within IF Statement)
When the
condition
equation is true, the iteration statement (FOR, WHILE,
REPEAT) is forced to end, and any statements after EXIT will not be exe-
cuted.
Note
(1) The
condition
can also be specified as a boolean variable (BOOL data
type) only rather than an equation.
(2) Even if the
condition
equation is true before the
expression
has been ex-
ecuted, the
expression
will be executed.
■
Example
Processing is repeated from when variable n = 1 until 50 in increments of 1
and n is added to array variable DATA[n]. If DATA[n] exceeds 100, however,
processing will end.
Содержание CX-PROGRAMMER V8.1
Страница 3: ...iv...
Страница 5: ...vi...
Страница 7: ......
Страница 15: ...xvi...
Страница 19: ...xx...
Страница 25: ...xxvi Application Precautions 4...
Страница 26: ...Part 1 Function Blocks...
Страница 27: ......
Страница 153: ...128 Procedures Section 3 2...
Страница 154: ...Part 2 Structured Text ST...
Страница 155: ......
Страница 159: ...134 CX Programmer Specifications Section 4 2...
Страница 205: ...180 Procedures Section 6 1...
Страница 207: ...182 System defined external variables supported in function blocks Appendix A...
Страница 229: ...204 Revision History...
Страница 230: ......