![Omron SYSMAC CX-Programmer 9 Скачать руководство пользователя страница 174](http://html1.mh-extra.com/html/omron/sysmac-cx-programmer-9/sysmac-cx-programmer-9_operation-manual_744241174.webp)
148
Statement Descriptions
Section 5-5
5-5
Statement Descriptions
5-5-1
Assignment
■
Summary
The left side of the statement (variable) is substituted with the right side of the
statement (equation, variable, or constant).
■
Reserved Words
:=
Combination of colon (:) and equals sign (=).
■
Statement Syntax
Variable:
=
Equation, variable, or constant;
■
Usage
Use assignment statements for inputting values in variables. This is a basic
statement for use before or within control statements. This statement can be
used for setting initial values, storing calculation results, and incrementing or
decrementing variables.
■
Description
Substitutes (stores) an
equation
,
variable
, or
constant
for the
variable
.
Examples
Example 1: Substitute variable A with the result of the equation X+1.
A:=X+1;
Example 2: Substitute variable A with the value of variable B.
A:=B;
Example 3: Substitute variable A with the constant 10.
A:=10;
■
Precautions
The data type of the equation, variable, or constant to be assigned must be
the same as the data type of the variable to be substituted. Otherwise, a syn-
tax error will occur.
5-5-2
Control Statements
IF Statement (Single
Condition)
■
Summary
This statement is used to execute an expression when a specified condition is
met. If the condition is not met, a different expression is executed.
■
Reserved Words
IF, THEN, (ELSE), END_IF
Note
ELSE can be omitted.
■
Statement Syntax
IF
<
condition
>
THEN
<
expression_1
>
;
ELSE
<
expression_2
>
;
END_IF;
Содержание SYSMAC CX-Programmer 9
Страница 2: ......
Страница 4: ...iv ...
Страница 6: ...vi ...
Страница 8: ......
Страница 16: ...xvi ...
Страница 20: ...xx ...
Страница 26: ...xxvi Application Precautions 4 ...
Страница 27: ...Part 1 Function Blocks ...
Страница 28: ......
Страница 154: ...128 Procedures Section 3 2 ...
Страница 155: ...Part 2 Structured Text ST ...
Страница 156: ......
Страница 160: ...134 CX Programmer Specifications Section 4 2 ...
Страница 206: ...180 Procedures Section 6 1 ...
Страница 208: ...182 System defined external variables supported in function blocks Appendix A ...
Страница 230: ...204 Revision History ...
Страница 231: ......