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

Assignment

Assign a value to a variable

Supported

IF

Conditional branching

Supported

CASE

Multi-way selection by integer value

Supported

FOR

Counted loop

Supported

WHILE

Pre-tested loop

Supported

REPEAT

Post-tested loop

Supported

EXIT

Break from innermost loop

Supported

RETURN

Early exit from POU

Supported

Operators

Category

Description

Status

Arithmetic Operators

Addition, subtraction, multiplication, division, modulo, power

Supported

Comparison Operators

Equality, inequality, less than, greater than

Supported

Logical Operators

AND, OR, XOR, NOT

Supported

Function Calls

Topic

Description

Status

Function Call

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

-, NOT

Negation, boolean complement

4

**

Exponentiation

5

*, /, MOD

Multiply, divide, modulo

6

+, -

Add, subtract

7

<, >, <=, >=

Comparison

8

=, <>

Equality, inequality

9

AND, &

Boolean AND

10

XOR

Boolean exclusive OR

11

OR

Boolean OR