Attention
IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.
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 |
Support |
Partial |
Statements¶
Statement |
Description |
Status |
|---|---|---|
Assign a value to a variable |
Supported |
|
Conditional branching |
Supported |
|
Multi-way selection by integer value |
Supported |
|
Counted loop |
Supported |
|
Pre-tested loop |
Supported |
|
Post-tested loop |
Supported |
|
Break from innermost loop |
Supported |
|
Early exit from POU |
Supported |
Operators¶
Category |
Description |
Status |
|---|---|---|
Addition, subtraction, multiplication, division, modulo, power |
Supported |
|
Equality, inequality, less than, greater than |
Supported |
|
AND, OR, XOR, NOT |
Supported |
Function Calls¶
Topic |
Description |
Status |
|---|---|---|
Calling functions and function block instances |
Partial |
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 |