![background image](http://html1.mh-extra.com/html/omron/sysmac-cx-programmer-9/sysmac-cx-programmer-9_operation-manual_744241158.webp)
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 SYSMAC CX-Programmer 9
Page 2: ......
Page 4: ...iv ...
Page 6: ...vi ...
Page 8: ......
Page 16: ...xvi ...
Page 20: ...xx ...
Page 26: ...xxvi Application Precautions 4 ...
Page 27: ...Part 1 Function Blocks ...
Page 28: ......
Page 154: ...128 Procedures Section 3 2 ...
Page 155: ...Part 2 Structured Text ST ...
Page 156: ......
Page 160: ...134 CX Programmer Specifications Section 4 2 ...
Page 206: ...180 Procedures Section 6 1 ...
Page 208: ...182 System defined external variables supported in function blocks Appendix A ...
Page 230: ...204 Revision History ...
Page 231: ......