Attention
IronPLC supports IEC 61131-3 Structured Text excluding I/O mapping.
Structured Text¶
Structured Text (ST) is a high-level textual programming language defined by IEC 61131-3. It resembles Pascal and provides statements for assignment, selection, iteration, and function invocation.
IEC 61131-3 |
Section 3.3 |
Statements¶
Statement |
Description |
|---|---|
Assign a value to a variable |
|
Access a single bit of an integer or bit-string variable |
|
Conditional branching |
|
Multi-way selection by integer value |
|
Counted loop |
|
Pre-tested loop |
|
Post-tested loop |
|
Break from innermost loop |
|
Early exit from POU |
Operators¶
Category |
Description |
|---|---|
Addition, subtraction, multiplication, division, modulo, power |
|
Equality, inequality, less than, greater than |
|
AND, OR, XOR, NOT |
Function Calls¶
Topic |
Description |
|---|---|
Calling functions and function block instances |
Operator Precedence¶
Operators are listed from highest to lowest precedence.
Rank |
Operator |
Description |
|---|---|---|
1 |
|
Parenthesized expression |
2 |
Function calls |
Function and function block invocation |
3 |
|
Negation, boolean complement |
4 |
|
Exponentiation |
5 |
|
Multiply, divide, modulo |
6 |
|
Add, subtract |
7 |
|
Comparison |
8 |
|
Equality, inequality |
9 |
|
Boolean AND |
10 |
|
Boolean exclusive OR |
11 |
|
Boolean OR |