The short answer
Function Block Diagram
Function block diagram is a graphical language in which blocks with input and output pins are wired together so that data flows from left to right. It is the natural language for analog signal processing, PID control, and any logic that reads as a chain of operations, and it is the usual host for reusable equipment blocks such as a pump or valve controller. Its weaknesses are sequences and branching, which are clearer in structured text or a sequential function chart.
Key points
- Data flows left to right through wired blocks. Read a diagram the way the signal travels.
- Execution order follows the wiring, and feedback paths need an explicit rule.
- FBD is where analog processing, PID, and reusable equipment blocks live.
- A user-defined function block with a structured interface is the reuse mechanism.
- Keep one idea per sheet. A diagram that needs scrolling in two directions is two diagrams.
How it works
A function block diagram is a set of blocks, each with named input pins on the left and output pins on the right, connected by wires that carry values. A block executes when its inputs are available and produces its outputs; the next block along the wire consumes them. The diagram reads like a signal path: the raw input enters at the left, passes through scaling, filtering, and validation, feeds a PID controller, and leaves as a speed reference at the right.
Blocks can be standard instructions supplied by the platform, such as a timer, a comparator, or a PID, or user-defined function blocks written in any IEC language. A wire can carry any data type, including a structure, which is how a whole pump status travels from block to block as one connection.
Execution order
In a text language the order of statements is explicit. In a diagram it is implied by the wiring, and the platform resolves it: blocks execute in an order that ensures each has its inputs before it runs, generally left to right and top to bottom where the wiring allows. That works until the diagram has a feedback loop, where the output of a block feeds back to an input of an earlier block. Then some value must come from the previous scan, and the platform either requires a marker on the feedback wire or picks one silently.
Where FBD fits
| Job | FBD | Alternative |
|---|---|---|
| Analog signal chain: scale, filter, validate, alarm | Excellent; the chain is visible | Structured text inside a block for the arithmetic |
| PID control with feedforward, limits, and mode logic | Excellent; the PID block and its surroundings are one picture | A PID function block called from ladder |
| Reusable equipment control: pump, valve, analyzer | Excellent as the host for a user-defined block | The same block called from ladder |
| Discrete interlock chains and motor control | Adequate; boolean blocks work but read worse than rungs | Ladder |
| Sequences and startup steps | Poor; state logic becomes a mesh of wires | Sequential function chart or a CASE in structured text |
| Loops over arrays | Not possible directly | Structured text |
| Calculations with many terms | Cluttered; a formula becomes a tree of blocks | Structured text |
User-defined function blocks
The reason FBD carries so much of a modern program is the user-defined function block. A block called PumpControl is written once, with inputs for the call, the run feedback, the fault inputs, the HOA state, and the setpoints, and outputs for the run command, the status word, the alarms, and the run time. Every pump in the plant is an instance of that block, wired to its own I/O. When the failed-to-prove logic needs a change, it changes in one place and every pump gets it.
- 1
Define the interface
Inputs and outputs as structures where the platform supports it: one command structure in, one status structure out, plus the configuration parameters. A block with forty loose pins is hard to wire and harder to read.
- 2
Write the internals in the language that suits them
The interlock logic can be ladder; the timers and counters can be FBD; the state machine is structured text. The block hides which.
- 3
Publish the state
The block writes its mode, its active hold reason, its fault list, and its counters to the status structure, so the HMI faceplate and the online monitor show what it is doing without opening it.
- 4
Test it once, well
Simulate every input combination the block claims to handle, including the failure cases. That test is worth repeating on every revision, because every pump depends on it.
- 5
Version it
A block used a hundred times needs a version number in its description and a change record. A silent edit to a shared block is a change to a hundred pumps.
Keeping a diagram readable
- Signal enters at the left, leaves at the right, and does not double back.
- One idea per sheet: one loop, one pump, one analyzer. Cross-sheet connections use named tags, not wires that leave the page.
- Name every intermediate wire that carries something an operator or a troubleshooter would want to see. Unnamed wires cannot be trended.
- Align blocks in the order they execute and keep the wiring uncrossed where possible. A diagram that looks like a circuit board is not being read by anyone.
- Put constants in named parameters, not in literal pins scattered across the sheet.
- Comment the sheet with what it does and why, at the top, once.
Frequently asked questions
- Is FBD the same as a function block?
- No. A function block is a program organization unit with internal state, and it can be written in any of the five languages. Function block diagram is one of the languages, and it is the one most often used to wire function blocks together. The naming is confusing and the distinction matters when reading a specification.
- Can I troubleshoot FBD online?
- Yes, and it is one of its strengths for analog problems: the value on every wire is shown live, so a bad reading can be followed from the input pin through scaling and filtering to the point where it goes wrong. For discrete logic, ladder still shows the state of a contact more directly.
- Why does the diagram behave differently after I added a block?
- Execution order changed. The platform re-resolved the order when the wiring changed, and a feedback path that was reading last scan is now reading this scan, or the reverse. Mark feedback wires explicitly and check the execution numbers after any edit.
- Should I build my own pump block or use the vendor library?
- Vendor and integrator libraries exist for exactly this and are well tested. Use one where it matches the site standard and the HMI faceplates. Build your own when the library does something the site does not want, and then test it as carefully as the vendor did.
Related topics
- IEC 61131-3The standard behind PLC programming languages: the five languages, the common elements of data types, variables, and program organization units, what conformance actually means, and how the standard shows up in real platforms.
- Structured TextThe text language of IEC 61131-3: syntax, control structures, how it fits alongside ladder, the conventions that keep it readable for the next person, and the mistakes that make structured text a liability in a plant that troubleshoots online.
- Ladder Logic FundamentalsRungs, contacts, coils, and the relay conventions the language inherited — plus the patterns you will meet in almost every industrial program.
- PID Control for Pumps and ValvesWhat each term actually does, how to tune a loop on a real pump station, and the handful of mistakes that cause most of the oscillation people blame on tuning.
- Signal ValidationCatching a failed analog input in logic before it runs a pump on a dead transmitter: range checks, module status bits, frozen-value detection, rate checks, and what the program does with a bad value.
- How to Create a PID Loop in a PLCSet up a PID instruction from scratch: scale the PV and CV, pick the action, set the execution rate, configure limits and anti-windup, tune conservatively, and test the manual and auto transitions before it controls anything.
Direct contact
Have a controls question?
Reach Eric Sullivan directly about anything on this site, a controls or automation topic, or one of his personal projects.