4 Understanding Programming
4-12
CP2E CPU Unit Software User’s Manual(W614)
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 Block
s
and Structured Text
(Cat. No. W447).
z
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.
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.
z
Control Statements
4-3-4
ST Language
Control Statements, Operators and Functions that Can be Used in
ST Programs
Control statements
Availability in CP2E
IF, THEN, ELSEIF, ELSE, END_IF
Yes
CASE, ELSE, END_CASE
Yes
FOR, TO, BY, DO, END_FOR
Yes
WHILE, DO, END_WHILE
Yes
REPEAT, UNTIL, END_REPEAT
Yes
EXIT
Yes
RETURN
Yes
Summary of Contents for SYSMAC CP Series
Page 3: ......
Page 32: ...1 Overview 1 4 CP2E CPU Unit Software User s Manual W614 ...
Page 44: ...3 CPU Unit Operation 3 8 CP2E CPU Unit Software User s Manual W614 ...
Page 116: ...6 I O Allocation 6 8 CP2E CPU Unit Software User s Manual W614 ...
Page 144: ...7 PLC Setup 7 28 CP2E CPU Unit Software User s Manual W614 ...
Page 170: ...10 Interrupts 10 14 CP2E CPU Unit Software User s Manual W614 ...
Page 200: ...11 High speed Counters 11 30 CP2E CPU Unit Software User s Manual W614 ...
Page 272: ...12 Pulse Outputs 12 72 CP2E CPU Unit Software User s Manual W614 ...
Page 278: ...13 PWM Outputs 13 6 CP2E CPU Unit Software User s Manual W614 ...
Page 460: ...18 Programming Device Operations 18 28 CP2E CPU Unit Software User s Manual W614 ...
Page 576: ...Revision 2 CP2E CPU Unit Software User s Manual W614 ...
Page 577: ......