Delimiters; Operators - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Delimiters

ST language supports the following delimiters to make the program structure clear.
Symbol
()
[]
. (period)
, (comma)
: (colon)
; (semicolon)
" (double quotation mark)
' (single quotation mark)
.. (two periods)

Operators

The following table lists the operators, applicable data types, and operation result data types used in ST programs.
Operator
*, /, +, -
<, >, <=, >=, =, <>
MOD
AND, &, XOR, OR, NOT
**
*1 WSTRING data type Unicode string cannot be specified.
The following table lists the operators in descending order of priority.
Operator
( )
Standard function ()
**
-
NOT
*
/
MOD
+
-
<, >, <=, >=
=
<>
&, AND
XOR
OR
• If one expression includes multiple operators with the same priority, operation is performed in order from the leftmost
operator.
• Up to1024 operators can be used in a single expression.
Description
Parenthesized expression
Specification of array element
Specification of structure or function block members
Argument separation
Device specifier
Termination of statement
Notation of Unicode string
Notation of string (ASCII, Shift JIS)
Specification of integer range
Applicable data type
ANY_NUM
ANY_ELEMENTARY
ANY_INT
ANY_BIT
ANY_REAL (base)
ANY_NUM (exponent)
Description
Parenthesized expression
Argument of standard function
Exponentiation
Sign inversion
Bit type complement
Multiplication
Division
Remainder
Addition
Subtraction
Comparison
Equality
Inequality
AND operation
XOR operation
OR operation
Operation result type
ANY_NUM
*1
Bit
ANY_INT
ANY_BIT
ANY_REAL
Example
(2+3)*(4+5)
CONCAT('AB','CD')
3.0**4
-10
NOT TRUE
10*20
20/10
17 MOD 10
1.4+2.5
3-2
10>20
T#26h=T#1d2h
8#15<>13
TRUE AND FALSE
TRUE XOR FALSE
TRUE OR FALSE
6 STRUCTURED TEXT LANGUAGE
6
Priority
1
2
3
4
5
6
7
8
9
10
11
61
6.1 Configuration

Advertisement

Table of Contents
loading

Table of Contents