St Language - Omron WS02-CXPC1-V9 - V9 Operation Manual

Table of Contents

Advertisement

ST Language

4-1
ST Language
4-1-1
Overview
132
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).
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 Program
IF score > setover THEN
underNG := FALSE;
OK := FALSE;
overNG := TRUE;
ELSIF score < setunder THEN (*If score=<setover and score < setunder*)
overNG := FALSE;
OK := FALSE;
underNG := TRUE;
ELSE
underNG := FALSE;
overNG := FALSE;
OK := TRUE;
END_IF;
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.
(*If score>setover*)
(*Turn OFF underNG*)
(*Turn OFF OK*)
(*Turn ON overNG*)
(*Turn ON overNG*)
(*Turn OFF OK*)
(*Turn ON underNG*)
(*If setover>score>setunder*)
(*Turn OFF underNG*)
(*Turn OFF overNG*)
(*Turn OFF OK*)
(*End of IF statement*)
Section 4-1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cx-programmer 9Sysmac ws02-cxpc1-v9

Table of Contents