St Language - Omron SYSMAC CP Series User Manual

Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

4 Understanding Programming
4-3-4

ST Language

CP2E can use the ST (Structured Text) language within function blocks.
The standard control statements, operators, and functions make the ST language ideal for mathemati-
cal processing that is difficult to write in ladder programming.
Additional Information
For details on ST programming specifications, notation, and input procedures, refer to the CX-
Programmer Operation Manual: Function Blocks and Structured Text (Cat. No. W447).
Features of ST Programming
• There are many control statements available, such as loop statements and IF-THEN-ELSE state-
ments, many operators such as arithmetic operators, comparison operators, and AND/OR opera-
tors, as well as many mathematical functions, string extract and merge functions, Memory Card
processing functions, string transfer functions, and trigonometric functions.
• Programs can be written like high-level languages such as C, and comments can be included to
make the program easy to read.
• ST programs can be uploaded and downloaded just like ordinary programs, but ST program can
only be used in function blocks.
• One-dimensional array variables are supported for easier data handling in applications.
Control Statements, Operators and Functions that Can be Used in
ST Programs
The control statements, operators and functions that can be used in CP2E are shown as follows. A part
of operators and functions are not available in CP2E.
The data types used in ST programs are the same as that can be used in function blocks.
Control Statements
IF, THEN, ELSEIF, ELSE, END_IF
CASE, ELSE, END_CASE
FOR, TO, BY, DO, END_FOR
WHILE, DO, END_WHILE
REPEAT, UNTIL, END_REPEAT
EXIT
RETURN
4-12
Control statements
Availability in CP2E
Yes
Yes
Yes
Yes
Yes
Yes
Yes
CP2E CPU Unit Software User's Manual(W614)

Advertisement

Table of Contents
loading

Table of Contents