Skip to main content
Call Eric:863-698-8266
CURRYCONTROLS.COMControls & Automation Knowledge Hub
ReferencePLCProgrammingStandardsAnalog

Function Block Diagram

The graphical data-flow language of IEC 61131-3: how blocks, pins, and wires work, execution order, where FBD beats ladder and structured text, building reusable equipment blocks, and the habits that keep a diagram readable.

9 min readUpdated Sep 5, 2026Published Sep 5, 2026By Eric Sullivan

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

JobFBDAlternative
Analog signal chain: scale, filter, validate, alarmExcellent; the chain is visibleStructured text inside a block for the arithmetic
PID control with feedforward, limits, and mode logicExcellent; the PID block and its surroundings are one pictureA PID function block called from ladder
Reusable equipment control: pump, valve, analyzerExcellent as the host for a user-defined blockThe same block called from ladder
Discrete interlock chains and motor controlAdequate; boolean blocks work but read worse than rungsLadder
Sequences and startup stepsPoor; state logic becomes a mesh of wiresSequential function chart or a CASE in structured text
Loops over arraysNot possible directlyStructured text
Calculations with many termsCluttered; a formula becomes a tree of blocksStructured 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. 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. 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. 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. 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. 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.

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.