6.1
Configuration
Programs written in ST language consist of operators and control statements.
Each statement must end with a semicolon ";".
Spaces, tabs, and line feeds can be inserted between an operator and data.
Comments can be inserted into a program. Enclose a comment statement with "(*" and "*)".
Program components
An ST program consists of the following components.
Item
Delimiter
Operator
Reserved word
Control statement
Device
Data type
Standard function
Constant
Label
Comment
Other symbols
• Write delimiters, operators, and reserved words in one-byte characters.
• For details on the reserved words, refer to the following.
GX Works3 Operating Manual
6 STRUCTURED TEXT LANGUAGE
60
6.1 Configuration
End of the statement
Space
Tab
Linefeed
Comment
Example
;, (,)
+, -, <, >, =
IF, CASE, WHILE, RETURN
X0, Y10, M100, ZR0
BOOL, DWORD
ADD, REAL_TO_STRING_E
123, "abc"
Switch_A
(*Turn on.*)
One-byte space, line feed code, TAB code
Assignment statement
Select statement
Function call statement
Function block call statement
Reference
Page 61 Delimiters
Page 61 Operators
Page 62 Control statements
MELSEC iQ-R CPU Module User's Manual (Application)
Page 40 Data Types
MELSEC iQ-R Programming Manual (Instructions,
Standard Functions/Function Blocks)
Page 71 Constants
Page 72 Labels and devices
Page 74 Comments