EasyManuals Logo

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION User Manual

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION
183 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 #160 background imageLoading...
Page #160 background image
145
Structured Text (ST Language) Specifications Appendix 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 syntax error will occur.
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;
Process Flow Diagram
Usage
Use the IF statement to perform a different operation depending on whether a single condition (condition equa-
tion) 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.
Condition
False
Tr ue
Expression 1 Expression 2

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION and is the answer not in the manual?

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION Specifications

General IconGeneral
BrandOmron
ModelCX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION
CategorySoftware
LanguageEnglish

Related product manuals