Glossary · FB

What is Function block (FB)?

A unit with inputs, outputs and internal memory that persists between scans, used by declaring an instance of it.

Timers, counters and edge detectors are all function blocks: declared in VAR as T1 : TON;, and every declaration creates an instance with its own memory. Two timers of the same type never interfere.

Writing your own blocks is the right way to reuse motor or valve logic across dozens of devices instead of copying code.

Related terms

Program organization unit (POU)
The unit every piece of PLC code lives in. The standard defines three: PROGRAM, FUNCTION and FUNCTION_BLOCK.
Function (FUN)
A unit that takes inputs and returns one value with no memory at all: the same inputs always give the same result.
On-delay timer (TON)
A standard function block whose output Q becomes true after IN has stayed true for PT without interruption, and resets as soon as IN drops.

All terms