St Language Configuration; Statements - Omron WS02-CXPC1-V9 - V9 Operation Manual

Table of Contents

Advertisement

ST Language Configuration

5-4

ST Language Configuration

5-4-1

Statements

Statement
End of statement
Comment
Assign-
Assignment
ment state-
ment
Control
IF, THEN, ELSIF, ELSE,
statements
END_IF
CASE, ELSE, END_CASE
FOR, TO, BY, DO,
END_FOR
WHILE, DO, END_WHILE
REPEAT, UNTIL,
END_REPEAT
EXIT
RETURN
Function block instance call
Function
Ends the statement
All text between (* and *) is treated as
a comment.
Substitutes the results of the expres-
sion, variable, or value on the right for
the variable on the left.
Evaluates an expression when the
condition for it is true.
Evaluates an express based on the
value of a variable.
Repeatedly evaluates an expression
according to the initial value, final
value, and increment.
Repeatedly evaluates an expression
as long as a condition is true.
Repeatedly evaluates an expression
until a condition is true.
Stops repeated processing.
ST program:
Ends the ST task that is being exe-
cuted, and executes the next task.
ST used in SFC:
Ends the SFC action program that is
being executed, and executes the
next action program.
ST used in a function block:
Returns from the called program to
the point in the calling program
where the call occurred.
Calls a function block definition.
Section 5-4
Example
;
(*comment*)
A:=B;
IF (condition_1) THEN
(expression 1);
ELSIF (condition_2) THEN
(expression 2);
ELSE
(expression 3);
END_IF;
CASE (variable) OF
1: (expression 1);
2: (expression 2);
3: (expression 3);
ELSE
(expression 4);
END_CASE;
FOR (identifier) := (initial_value) TO
(final_value) BY (increment) DO
(expression);
END_FOR;
WHILE (condition) DO
(expression);
END_WHILE;
REPEAT
(expression);
UNTIL (condition)
END_REPEAT;
EXIT;
RETURN;
When used in a function block:
Variable name with FUNCTION
BLOCK data type (called function
block definition's input variable name
:= calling function block definition's
variable name or constant, ..., called
function block definition's output vari-
able name or constant => calling func-
tion block definition's output variable
name, ...);
141

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cx-programmer 9Sysmac ws02-cxpc1-v9

Table of Contents