Attention

IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.

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

Status

ABS

Absolute value

Supported

SQRT

Square root

Supported (REAL, LREAL)

LN

Natural logarithm

Supported (REAL, LREAL)

LOG

Base-10 logarithm

Supported (REAL, LREAL)

EXP

Natural exponential

Supported (REAL, LREAL)

EXPT

Exponentiation

Supported

SIN

Sine

Supported (REAL, LREAL)

COS

Cosine

Supported (REAL, LREAL)

TAN

Tangent

Supported (REAL, LREAL)

ASIN

Arc sine

Supported (REAL, LREAL)

ACOS

Arc cosine

Supported (REAL, LREAL)

ATAN

Arc tangent

Supported (REAL, LREAL)

ADD

Addition

Supported

SUB

Subtraction

Supported

MUL

Multiplication

Supported

DIV

Division

Supported

MOD

Modulo

Supported

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

SEL

Binary selection

Supported

MAX

Maximum

Supported

MIN

Minimum

Supported

LIMIT

Clamp to range

Supported

MUX

Multiplexer

Supported

SHL

Shift left

Supported

SHR

Shift right

Supported

ROL

Rotate left

Supported

ROR

Rotate right

Supported

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 conversions

Type conversion functions

Supported

Function Blocks

Function Block

Description

Status

TON

On-delay timer

Not yet supported

TOF

Off-delay timer

Not yet supported

TP

Pulse timer

Not yet supported

CTU

Count up

Not yet supported

CTD

Count down

Not yet supported

CTUD

Count up/down

Not yet supported

R_TRIG

Rising edge detection

Not yet supported

F_TRIG

Falling edge detection

Not yet supported

SR

Set/reset flip-flop

Not yet supported

RS

Reset/set flip-flop

Not yet supported