149
Statement Descriptions
Section 5-5
■
Process Flow Diagram
■
Usage
Use the IF statement to perform a different operation depending on whether a
single condition (condition equation) is met.
■
Description
Condition = If true, execute expression_1
Condition
= If false, execute
expression_2
■
Precautions
• IF must be used together with END_IF.
• The
condition
must include a true or false equation for the evaluation
result.
Example: IF(A>10)
The
condition
can also be specified as a boolean variable only rather than
an equation. As a result, the variable value is 1 (ON) = True result, 0
(OFF) = False result.
• Statements that can be used in
expression_1
and
expression_2
are
assignment statements, IF, CASE, FOR, WHILE, or REPEAT.
Example:
IF
<
condition_1
>
THEN
IF
<
condition_2
>
THEN
<
expression_1
>
;
ELSE
<
expression_2
>
:
END_IF;
END_IF;
The processing flow diagram is as follows:
Condition
False
True
Expression 1
Expression 2
Condition 1
Condition 2
False
True
False
True
Expression 1
Expression 1
Содержание 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: ......