EasyManua.ls Logo

Fuji Electric SPH Series - 2-4;2-5 Textual Languages (ST;IL)

Fuji Electric SPH Series
151 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
2-43
Section 2 Programming Languages
2-4 ST Language
The ST language consists of operators and statements. Operators perform basic operations such as arithmetic or comparison
operations. Statements specify the sequence of program execution and the ow of program control. ST language is a structured
text language that is composed of a combination of these operators and statements.
Statement
<Examples of ST language>
Statement
Conditional expression
A conditional expression
consists of variables,
an operator (e.g., >),
and immediate values.
Executable statement
An executable statement
consists of variables,
operators, and an
assignment statement.
A control statement, which is made up of
statements, conditional expressions, and
executable statements, is terminated by
a semicolon (“;”).
Comment
A comment begins with “(*”and ends with“*).”
No. Operation Operator Data type Description Sample value Precedence
1 Parentheses (expression) (2+3)*(4+5) 45
Highest
2 Function
Function name
(parameter)
LN(A)
MAX(X, Y)
3 Exponentiation ** REAL (base, exponent) 3.0**4.0 8.1E+1
4 Sign inversion - INT, DINT, REAL -Voo1 (Voo1=10) -10
5 Logical not NOT BOOL, WORD, DWORD
Logical NOT of
each list
FALSE
6 Multiplication * INT, DINT, UINT, UDINT, REAL 10*3 30
7 Division / INT, DINT, UINT, UDINT, REAL 6/2 3
8 Division remainder MOD INT, DINT, UINT, UDINT 17 MOD 10 7
9 Addition + INT, DINT, UINT, UDINT, REAL 2+3 5
10 Subtraction - INT, DINT, UINT, UDINT, REAL 4-2 2
11 Comparison <, >, <=, >=
Elementary
(excluding STRING type)
4>12 FALSE
12 Equality =
Elementary
(excluding STRING type)
T#26h =T#1d2h TRUE
13 Inequality <>
Elementary
(excluding STRING type)
8<>16 TRUE
14 Logical product &, AND BOOL, WORD, DWORD TRUE & FALSE FALSE
15 Exclusive or XOR BOOL, WORD, DWORD TRUE XOR FALSE TRUE
16 Logical add OR BOOL, WORD, DWORD TRUE OR FALSE TRUE Lowest
* Statements, conditional expressions, and executable statements must be separated by at least one space character.
2-4-1 ST operators

Table of Contents

Related product manuals