Attention

IronPLC implements many parts of the IEC 61131-3 standard and is working toward full Structured Text support. Key features still missing include arrays and structures. Try it out in the IronPLC Playground.

Functions

IEC 61131-3 defines a set of standard functions available in all programming languages. Functions are stateless — they produce the same output for the same inputs every time.

Numeric Functions

Function

Description

Status

ABS

Absolute value

Supported

SQRT

Square root

Supported

LN

Natural logarithm

Supported

LOG

Base-10 logarithm

Supported

EXP

Natural exponential

Supported

EXPT

Exponentiation

Supported

TRUNC

Truncate real to integer

Supported

Trigonometric Functions

Function

Description

Status

SIN

Sine

Supported

COS

Cosine

Supported

TAN

Tangent

Supported

ASIN

Arc sine

Supported

ACOS

Arc cosine

Supported

ATAN

Arc tangent

Supported

Arithmetic Functions

Function

Description

Status

ADD

Addition

Supported

SUB

Subtraction

Supported

MUL

Multiplication

Supported

DIV

Division

Supported

MOD

Modulo

Supported

Comparison Functions

Function

Description

Status

GT

Greater than

Supported

GE

Greater than or equal

Supported

EQ

Equal

Supported

LE

Less than or equal

Supported

LT

Less than

Supported

NE

Not equal

Supported

Assignment Functions

Function

Description

Status

MOVE

Assignment (copy value)

Supported

Selection Functions

Function

Description

Status

SEL

Binary selection

Supported

MAX

Maximum

Supported

MIN

Minimum

Supported

LIMIT

Clamp to range

Supported

MUX

Multiplexer

Not yet supported

Bit String Functions

Function

Description

Status

SHL

Shift left

Supported

SHR

Shift right

Supported

ROL

Rotate left

Supported

ROR

Rotate right

Supported

String Functions

Function

Description

Status

LEN

String length

Supported

LEFT

Left substring

Supported

RIGHT

Right substring

Supported

MID

Middle substring

Supported

CONCAT

String concatenation

Supported

INSERT

String insertion

Supported

DELETE

String deletion

Supported

REPLACE

String replacement

Supported

FIND

String search

Supported

Type Conversion Functions

Function

Description

Status

Type conversions

Type conversion functions (*_TO_*)

Supported (numeric)

BCD_TO_INT / INT_TO_BCD

BCD conversion functions

Supported