Skip to content

Function blocks

Every block that can go into a diagram. A program is a list of block instances in execution order; an input pin takes a tag or a constant, an output pin writes a tag, and every time is in milliseconds.

This page is an index so far

Each block is listed with what it does. The pin-by-pin detail — every input, output, parameter and default — is being added block by block, in the shape shown under How a block is documented.

Timers and counters

Block What it does
TON On-delay. The output picks up once the input has been held for the set time.
TOF Off-delay. The output holds on for the set time after the input drops.
TP Pulse. A rising edge produces an output of exactly the set length, and is not retriggered.
CTU Count up. A rising edge adds one; a reset clears it; the output says the count reached the preset.
CTD Count down. A rising edge subtracts one; a load sets the count to the preset.
R_TRIG Rising edge. True for one cycle when the input goes up.
F_TRIG Falling edge. True for one cycle when the input goes down.
SR Latch where setting wins.
RS Latch where resetting wins.
BLINK Flasher. While enabled, the output alternates between a set on time and off time.

Arithmetic, logic and comparison

Block What it does
ADD SUB MUL DIV The four operations. Dividing by zero yields zero rather than a crash.
MIN MAX ABS Smaller of two, larger of two, absolute value.
AND OR XOR NOT Boolean logic.
GT GE LT LE Greater, greater-or-equal, less, less-or-equal.
EQ Equal within a tolerance, because two measured values are never exactly equal.
SEL Selector: passes one of two inputs according to a boolean.

Signal handling

Block What it does
SCALE Linear scaling from one range onto another.
LIMIT Clamps a value between a minimum and a maximum.
HYST Comparator with hysteresis — separate switch-on and switch-off thresholds.
RAMP Limits how fast a value may change, in units per second.
PT1 First-order filter with a time constant.

Process and machine

Block What it does
PID Control with anti-windup, output limits and a bumpless transfer between automatic and manual. The derivative is taken from the measurement, not the error, so a step in the setpoint does not kick the output. Reports saturation.
MOTOR Start and stop with feedback supervision. The feedback must confirm within a timeout, or the block latches a fault and drops the command. Stop outranks start; acknowledgement works only at standstill.
VALVE Open and close with end-position feedback, the same fault latching and acknowledgement. Closing outranks opening.

Motion

Named after PLCopen Motion, because that is the vocabulary a machine builder already has. Each is bound to an axis rather than to a tag — see FBD, axes and drives.

Block What it does
MC_POWER Switches the axis on; reports that it is in operation.
MC_MOVEVELOCITY Runs at a velocity, taking a changed setpoint while running.
MC_STOP Controlled stop along a deceleration ramp.
MC_RESET Acknowledges an axis fault.
MC_READACTVEL Reads the actual velocity.
MC_READSTATUS Reads whether the axis is running or faulted.
MC_MOVEABS MC_MOVEREL Move to a position, or by a distance.
MC_HOME Reference run.
MC_READACTPOS Reads the actual position.

CANopen

Block What it does
CO_CIA402 The drive state machine itself — the building block the motion blocks and the supplied composites are made from.
CO_SDOWRITE CO_SDOREAD Parameter access, at start-up only. Never inside the cycle.
CO_RAMPTIME Acceleration and deceleration times written into the drive, and only while the axis is stopped.

Composite blocks

A composite is a block you build yourself out of other blocks, with its own interface. It is used like any other block and opens up when you double-click it. See FBD, axes and drives.

How a block is documented

Each block will get a section in this shape, so the page stays uniform as it grows:

TON

One sentence on what it does and when to reach for it.

Pin Direction Type Default
IN input bool
Q output bool
PT parameter time, ms 1000

Then: the behaviour at the edges — what happens on a reset, on a power cycle, when a parameter changes while running — and the mistake people make with it.