Tiza Group

Home / Guides / Industry and automation

Function Block Diagram (FBD): Function Blocks in PLCs

What the function block diagram (FBD) is, how blocks and signals are connected, when to use it, and how to build reusable blocks for motors and valves.

By Shadai García, CEO and protection engineer at Tiza Group.

pipe with pumpVT4–20 mAPLCAI → PID → AOAO~~VFDgridMpumpESCALAFILTROPIDLÍMITEAOSPtpressureSPtransmitter measures, scales pressurethe PID compares with SP and sets the outputpressure settles at SPLoopTransmitterScaling and filterPIDDrive© tizagrp.compipe with pumpVT4–20 mAPLCAI → PID → AOAO~~VFDgridMpumpESCALAFILTROPIDLÍMITEAOSPtpressureSPtransmitter measures, scales pressurethe PID compares with SP and sets the outputpressure settles at SPLoopTransmitterScaling and filterPIDDrive© tizagrp.com
FBD: scaling, filter, PID, and limit with 4–20 mA pressure transmitter and analog output to the drive. Location in the system and operating principle. Illustrative: real values come from the nameplate and the manufacturer's manual.
Short answer

FBD shows the program as blocks with inputs on the left and outputs on the right, joined by signal lines. It is natural for analog processing and control loops, and it lets you create your own blocks with memory that are reused per piece of equipment, such as a motor or a valve.

Short answer

The function block diagram (FBD) draws the program as a network of blocks. Each block performs an operation (compare, add, time, control) and connects to others with lines that carry signals from left to right. It is one of the five IEC 61131-3 languages and resembles an instrumentation loop diagram. That makes it natural for anyone coming from process control.

Anatomy of a block

A block has a type name (for example, TON), an instance name (for example, start_delay), inputs on the left, and outputs on the right.

PartDescription
TypeThe block’s function: comparator, timer, scaling, controller
InstanceThe name of that particular copy, with its internal data
InputsValues or signals it receives; can be constants or variables
OutputsResults; can be connected to other blocks or to output variables
NegationA small circle on an input or output inverts the Boolean value

The basic logic operations (AND, OR, NOT, XOR) are also drawn as blocks, with the same rectangular shape. The graphic gate symbols of electrical drawing standards may look different, but the function is identical.

Functions and function blocks

The standard separates two classes of elements:

  • Functions: without memory. ABS, MAX, LIMIT, or a type conversion are examples. With the same inputs they always give the same output.
  • Function blocks: with memory. Each one used creates an instance with its data. Timers, counters, flip-flops (latches), and PID controllers are function blocks.

A custom function block is defined once and used as many times as there are pieces of equipment: a MOTOR block with start, stop, overload, and feedback inputs, and contactor command, status, and alarm outputs. Each motor in the plant is an instance. This is the basic way to apply PLC programming best practices.

Execution: data flow

In FBD, the execution order follows the flow of signals: a block is calculated when its inputs are available. Within a program, environments show or allow editing of that order. Feedback loops (the output of one block enters an earlier one) require care: the fed-back signal arrives one cycle late, or in the order the programmer sets. A well-designed control loop already accounts for that delay.

Where FBD shines

  • Analog processing: scaling 4-20 mA to engineering units, filtering, upper and lower limits.
  • Control: the PID block receives process value, setpoint, and limits, and delivers the output to the actuator. It is the natural way to represent the control loop of a pump with a drive.
  • Visible combinational logic: a table of conditions that enable a command, like a set of permissives.
  • Transfer logic: selecting a source according to priority.

Illustrative example: pump speed control

Assumed data: a pump driven by a 15 kW, 400 V motor with a drive (variable frequency drive). The PLC reads system pressure with a 4-20 mA transmitter (assumed range of 0 to 10 bar) and must hold a setpoint pressure of 6 bar.

BlockInputOutput
Scalinganalog module countspressure in bar
Filterpressure in barfiltered pressure
PIDfiltered pressure, 6 bar setpoint, limitsspeed reference (percent)
Limitspeed referencespeed between the minimum and maximum allowed
Analog outputlimited speedsignal to the drive

The chain reads from left to right, just like a loop diagram. The PID gain values are not given here: they are tuned on the real process. The low-water protection does not appear either; it is separate, with its own permissives. See affinity laws and energy savings in pumps to understand why varying speed saves energy.

Advantages and limits

Advantages: it is visual, shows the signal flow, and reuses blocks easily. Limitations: large diagrams take up many screens, feedback loops can be confusing, and logic with many conditional branches is clearer in text. Some tools can export to other languages, with varying results.

Library elements worth knowing

Environments come with standard blocks that cover most signal processing:

FamilyExamplesUse
LogicAND, OR, XOR, NOTCombining conditions
BistablesSR, RSStoring a state with set or reset dominance
Edge detectionR_TRIG, F_TRIGTriggering an action only once
Timers and countersTON, TOF, TP, CTU, CTDSee timers and counters
Comparison and selectionGT, LT, EQ, SEL, MUXChoosing between values
Arithmetic and limitingADD, MUL, LIMIT, MAX, MINScaling and saturation
ControlPID and manufacturer variantsControl loops

The reset-dominant bistable is the block version of the start-stop seal-in: if the start command and the stop command arrive together, stop dominates. In a process where stopping is the safe action, that is the correct dominance.

Organizing a large diagram

A block diagram grows quickly. To keep it readable: one function per page, short signal lines without crossings, signal names visible at each connection, and custom blocks that encapsulate subsystems (a PUMP block instead of fifteen loose blocks). When reviewing, trace the output signal backward to the physical inputs. If the path jumps from one page to another more than twice, the structure needs a redesign.

Testing and debugging a diagram

Online, each connection shows its value, so the diagram becomes a diagnostic tool: you follow the signal backward from the output that does not respond, to the first block whose output does not match what its inputs justify. To test a custom block, you build a table of cases with inputs and expected outputs, run them in simulation, and record the result. A controller is tested first in manual mode: you check that the output follows the imposed value and that the limits act. Only then is it tested in automatic with the real process. The transfer between manual and automatic must be bumpless: the controller starts with the output value it had in manual mode.

Common mistakes

  • Drawing a monolithic diagram instead of blocks per piece of equipment.
  • Not naming the instances, so the diagram becomes a network of “TON_1”, “TON_2”.
  • Crossing lines so that the flow cannot be understood.
  • Feedback without handling the one-cycle delay.
  • Scalings with wrong limits that cause out-of-range readings with no alarm.
  • Controllers without an output limit or saturation protection.
  • Leaving inputs unconnected with unintended default values.
  • Mixing units (percent and engineering units) in the same calculation.

Checklist

  • Each piece of equipment has its own instance of its function block.
  • Descriptive instance and signal names.
  • Range and units of each analog input documented.
  • Broken-wire or out-of-range signal detection.
  • Execution order reviewed in feedback loops.
  • Controllers with output limits and manual mode.
  • Unconnected inputs removed or set on purpose.
  • The diagram fits on readable pages, one function per page.

Frequently asked technical questions

  • Is FBD the same as an instrumentation loop diagram? No, although they look alike. FBD is code that executes; the loop diagram documents the instrumentation.
  • Can custom blocks be created in FBD? Yes, and it is the greatest value of the language; they can be written in FBD, ladder, or text.
  • Is the PID the same across brands? No. Parameters, units, and modes vary by manufacturer; check the manual.
  • How does the PLC communicate with the drive? By analog signals or over a network, as explained in Modbus RTU and TCP.

How we help

Designing control loops and blocks per piece of equipment requires knowing the process, not just the language. At Tiza Group we do the control engineering and verify it with tests, then commission the system. See engineering design and studies and testing and commissioning, or write to us through contact.

References

  • IEC 61131-3, function block diagram (paid standard).
  • PLC Academy, introductory material on FBD.
  • Hugh Jack, Automating Manufacturing Systems with PLCs (CC BY-NC-SA 3.0 US).

Frequently asked questions

When is FBD better than ladder?

When the program is a signal flow: scaling, comparison, filtering, PID control. For discrete interlock logic and maintenance by electricians, ladder is usually clearer.

What is the difference between a function and a function block?

A function keeps no state: the same inputs always give the same result. A function block has its own memory in each instance, like a timer, a counter, or a controller.

In what order do the blocks execute?

By data flow: a block executes when its inputs have already been calculated. When there are feedback loops, the environment imposes an explicit order, which is found in the manufacturer's manual.

Can FBD be mixed with ladder in the same project?

Yes, as separate programs or blocks within the same project. A block written in one language can be called from another, depending on what the manufacturer's environment allows.

WhatsApp