Attention

IronPLC supports IEC 61131-3 Structured Text excluding I/O mapping.

Standard Library

IronPLC provides the standard functions and function blocks defined by IEC 61131-3. These are available in all programming languages.

Tip

Examples on supported function pages are interactive — you can edit and run them directly in the IronPLC Playground.

Functions

Function

Description

ABS

Absolute value

SQRT

Square root

LN

Natural logarithm

LOG

Base-10 logarithm

EXP

Natural exponential

EXPT

Exponentiation

SIN

Sine

COS

Cosine

TAN

Tangent

ASIN

Arc sine

ACOS

Arc cosine

ATAN

Arc tangent

ADD

Addition

SUB

Subtraction

MUL

Multiplication

DIV

Division

MOD

Modulo

GT

Greater than

GE

Greater than or equal

EQ

Equal

LE

Less than or equal

LT

Less than

NE

Not equal

SEL

Binary selection

MAX

Maximum

MIN

Minimum

LIMIT

Clamp to range

MUX

Multiplexer

SHL

Shift left

SHR

Shift right

ROL

Rotate left

ROR

Rotate right

LEN

String length

LEFT

Left substring

RIGHT

Right substring

MID

Middle substring

CONCAT

String concatenation

INSERT

String insertion

DELETE

String deletion

REPLACE

String replacement

FIND

String search

Type conversions

Type conversion functions

Function Blocks

Function Block

Description

TON

On-delay timer

TOF

Off-delay timer

TP

Pulse timer

CTU

Count up

CTD

Count down

CTUD

Count up/down

R_TRIG

Rising edge detection

F_TRIG

Falling edge detection

SR

Set/reset flip-flop

RS

Reset/set flip-flop