![Omron CX-PROGRAMMER V8.1 Скачать руководство пользователя страница 176](http://html1.mh-extra.com/html/omron/cx-programmer-v8-1/cx-programmer-v8-1_operation-manual_744203176.webp)
151
Statement Descriptions
Section 5-5
Note
ELSE can be omitted.
Statement Syntax
IF
<
condition_1
>
THEN
<
expression_1
>
;
ELSIF
<
condition_2
>
THEN
<
expression_2
>
;
ELSIF
<
condition_3
>
THEN
<
expression_3
>
;
...
ELSIF
<
condition_n
>
THEN
<
expression_n
>
;
ELSE
<
expression_m
>
;
END_IF;
Processing Flow Chart
■
Usage
Use the IF statement to perform different operations depending which of mul-
tiple conditions (
condition
equation) is met.
■
Description
Condition 1 = If true, execute expression 1
Condition 1
= If false,
Condition 2
= If true, execute
expression 2
Condition 2
= If false,
Condition 3
= If true, execute
expression 3
etc.
Condition n
= If true, execute
expression n
If none of these conditions are met,
condition m
is executed.
■
Precautions
• IF must be used together with END_IF.
•
Condition_
@
contains the true or false result of the equation (e.g.,
IF(A>10)).
A boolean (BOOL data type) variable only can also be specified as the
condition
rather than an equation. For boolean conditions, the result is
true when the variable value is 1 (ON) and false when it is 0 (OFF).
• Statements that can be used in
expression_
@
are assignment state-
ments, IF, CASE, FOR, WHILE, or REPEAT.
Condition 1
Condition 2
Condition 3
False
False
False
True
True
True
Expression 1
Expression 2
Expression 3
Expression m
Содержание 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: ......