132
ST Language
Section 4-1
4-1
ST Language
This section explains the specifications and operating procedures for ST pro-
grams directly allocated to CX-Programmer tasks (ST tasks). Refer to the fol-
lowing sections for information on functions and operations specific to ST
programs used in other programs (function blocks or SFC).
• ST programs used in function block instances:
Refer to
Part 1: Function Blocks
in this manual.
• ST programs used in SFC:
Refer to the
CX-Programmer Operation Manual: SFC
(W469).
4-1-1
Overview
The ST (Structured Text) language is a high-level language code for industrial
controls (mainly PLCs) defined by the IEC 61131-3 standard. The standard
control statements, operators, and functions make the ST language ideal for
mathematical processing that is difficult to write in ladder programming. (The
ST language does not support all of the processing that can be written in lad-
der language.)
The ST language supported by CX-Programmer Ver. 7.2 or higher conforms
with the IEC 61131-3 standard, and these ST-language programs can be allo-
cated to tasks.
The PLC must be a CS/CJ-series CPU Unit with unit version 4.0 or later, or a
CJ2-series CPU Unit.
The following list shows the features of the ST language.
•
There are many control statements available, such as loop statements
and IF-THEN-ELSE statements, many operators such as arithmetic oper-
ators, comparison operators, and AND/OR operators, as well as many
mathematical functions, string extract and merge functions, Memory Card
processing functions, string transfer functions, and trigonometric func-
tions.
•
Programs can be written like high-level languages such as C, and com-
ments can be included to make the program easy to read.
•
ST programs can be uploaded and downloaded just like ordinary pro-
grams, but ST program tasks cannot be uploaded and downloaded in task
units.
•
Function blocks (ladder or ST language) can be called in ST programs.
ST Program
IF score > setover THEN
(*If score>setover*)
underNG := FALSE;
(*Turn OFF underNG*)
OK := FALSE;
(*Turn OFF OK*)
overNG := TRUE;
(*Turn ON overNG*)
ELSIF score < setunder THEN
(*If score=<setover and score < setunder*)
overNG := FALSE;
(*Turn ON overNG*)
OK := FALSE;
(*Turn OFF OK*)
underNG := TRUE;
(*Turn ON underNG*)
ELSE
(*If setover>score>setunder*)
underNG := FALSE;
(*Turn OFF underNG*)
overNG := FALSE;
(*Turn OFF overNG*)
OK := TRUE;
(*Turn OFF OK*)
END_IF;
(*End of IF statement*)
Summary of Contents for CX-PROGRAMMER V8.1
Page 3: ...iv...
Page 5: ...vi...
Page 7: ......
Page 15: ...xvi...
Page 19: ...xx...
Page 25: ...xxvi Application Precautions 4...
Page 26: ...Part 1 Function Blocks...
Page 27: ......
Page 153: ...128 Procedures Section 3 2...
Page 154: ...Part 2 Structured Text ST...
Page 155: ......
Page 159: ...134 CX Programmer Specifications Section 4 2...
Page 205: ...180 Procedures Section 6 1...
Page 207: ...182 System defined external variables supported in function blocks Appendix A...
Page 229: ...204 Revision History...
Page 230: ......