What Is a Function Block Diagram?
A function block diagram, or FBD, is one of the five PLC programming languages defined by IEC 61131-3. Instead of rungs of ladder logic, FBD represents a program as a set of blocks wired together, with signals flowing from inputs on the left to outputs on the right. It reads like a signal-flow schematic, which makes it a natural fit for analog and process control.
Function Block Diagram in one line: A function block diagram (FBD) is a graphical PLC programming language, defined in IEC 61131-3, in which logic is built from interconnected function blocks - each performing an operation such as a timer, PID loop, or comparison - with data flowing along the connecting lines.
How a Function Block Diagram Works
Each block in an FBD performs a defined operation - a logical AND, a timer, a counter, a scaling calculation, or a PID controller. The block has input pins on the left and output pins on the right. You wire an output of one block into an input of the next, and the value flows along that connection when the program executes. The visual layout mirrors how the data actually moves through the logic.
This makes FBD especially readable for continuous and analog control. A loop that reads a pressure, scales it, compares it to a setpoint, and drives a valve is drawn almost exactly as an instrument engineer would sketch it. Complex logic that would sprawl across many ladder rungs often collapses into a compact, legible block diagram.
Where FBD Fits Best
FBD shines for process control, signal processing, and any logic that is fundamentally about moving and transforming analog values. PID loops, filtering, and analog computations are cleaner in FBD than in ladder. It also encourages reuse: a well-defined function block - say, a standard pump-control block - can be dropped into many programs, tested once, and trusted everywhere.
In oil and gas, FBD commonly appears in compressor control, metering, and any skid where analog loops dominate. Ladder still rules for discrete interlocks and permissives, so real projects frequently mix the two. Whatever the internal language, the PLC exposes its results as tags over its native protocol, and a SCADA platform like Merobix reads those tags to trend and alarm on them without needing to see the FBD itself.
Execution Order, Feedback, and One-Scan Delays
An FBD network looks parallel but executes sequentially: the runtime evaluates blocks in a defined order each scan, generally following data flow from inputs toward outputs, with the programming tool assigning explicit execution numbers where the order is ambiguous. Most of the time you never think about it. It starts to matter the moment a wire feeds backward - an output routed into an earlier block's input. That feedback value is necessarily the result from the previous scan, so a latch or filter built with feedback carries a one-scan delay by construction.
The practical rules are simple. When logic depends on order, set the execution order deliberately instead of trusting the tool's default, and document why. When you see feedback, ask what the one-scan-old value does on the first scan after a restart, and initialize it explicitly if the answer matters to the process. Edge-detection and latching blocks from the standard library are usually safer than hand-rolled feedback for exactly this reason: their first-scan behavior is defined and documented rather than an accident of layout.
A Worked Example: A Scaled High Alarm With a Delay
Take a pressure high alarm, drawn entirely in FBD with symbolic values. The analog input block delivers raw counts; a scale block converts counts to engineering units using the range configured for the transmitter; a comparison block tests the scaled value against a high setpoint H; an on-delay timer requires the comparison to stay true for a delay time T before passing it on; and the timer's output sets the alarm bit the SCADA system reads.
Reading the network left to right:
- Raw counts enter from the input channel.
- The scale block outputs the value in engineering units.
- The comparator goes true whenever the value exceeds H.
- The on-delay timer ignores excursions shorter than T, filtering measurement blips.
- The timer output drives the alarm bit, and the same signal can drive a lamp or feed an interlock.
The point of the example is how little translation the diagram needs: the instrument engineer's sketch, the loop narrative, and the executable program are nearly the same drawing. Change H or T and the structure is untouched; swap the comparator for a low-limit test and you have the matching low alarm. That structural stability is what makes FBD programs pleasant to maintain years after the original author has moved on.
Mixing FBD With the Other 61131-3 Languages
Real programs rarely commit to one language. Discrete interlocks and permissives usually stay in ladder logic, where electricians and technicians read them fastest; heavy math and data handling drop into structured text, often inside the body of a function block that FBD then wires into the diagram; stepwise sequences belong in sequential function charts. The IEC 61131-3 standard explicitly allows a project to mix languages per program unit, so choose per problem, not per project.
A rough map of where each language earns its place:
| Language | Strongest at |
|---|---|
| Ladder (LD) | Discrete interlocks, permissives, motor logic |
| Function block diagram (FBD) | Analog signal flow, PID loops, reusable blocks |
| Structured text (ST) | Math, loops, data handling inside blocks |
| Sequential function chart (SFC) | Stepwise sequences, batch phases, startup logic |
| Instruction list (IL) | Legacy code only; deprecated in the current edition of the standard |
Frequently Asked Questions
What is the difference between FBD and ladder logic?
Ladder logic is drawn as relay-style rungs and excels at discrete on/off interlocks; FBD is drawn as connected blocks with signals flowing left to right and excels at analog and process control such as PID loops. Both are IEC 61131-3 languages and are often mixed in one project.
When should I use a function block diagram?
FBD is a strong choice for continuous control, signal processing, and analog computations - anything where data flows through a series of transformations. It is also good when you want reusable, self-contained blocks like a standard PID or pump-control block.
Is a function block the same as a function block diagram?
A function block is a single reusable unit of logic with defined inputs and outputs; a function block diagram is the language in which you wire those blocks together into a program. FBD is the diagram; function blocks are its building pieces.
How do I troubleshoot an FBD program online?
Go online with the programming tool and watch live values on the block pins; a fault is usually visible as a value that stops changing where you expect it to flow onward. Check the execution order if a value seems one scan stale, and confirm feedback paths were initialized after restart. Forcing a pin can isolate a block, but forcing on a running process should follow the site's control-system procedures, be logged, and be removed promptly.
Is FBD slower than ladder logic at runtime?
Not meaningfully. Both compile to the controller's native execution, and any scan-time difference between an FBD and a ladder implementation of the same logic is negligible next to the effect of overall program size and I/O volume. Choose the language for readability and maintenance; if scan time is a genuine constraint, program structure and design matter far more than language choice.
Sources and verification
This page references the vendor products and their official documentation published by the organizations below. Editions, product capabilities, and documentation change over time - confirm current requirements and specifications directly with the source.
- Rockwell Automation Literature Library (Allen-Bradley, Studio 5000) - Rockwell Automation
- Siemens SIMATIC and TIA Portal documentation - Siemens
Merobix is not affiliated with, endorsed by, or sponsored by these organizations; their names are used only to identify the standards and products discussed.
Automation services
Need help turning this into a working system?
Merobix integrates SCADA, programs Allen-Bradley and Siemens PLCs, and designs and fabricates industrial control panels.
Meeting requests are reviewed before confirmation.