Function-Block Basics Logic
Open a modern building-automation controller — Niagara, EBO, Distech, almost any of them — and the control program isn't lines of code. It's a sheet of little boxes joined by wires. That sheet is a function-block program, and learning to read one is most of what it takes to understand what a controller is actually doing. If you came up on PLC ladder logic, or from the IT side, or you've just never had anyone walk you through it, this page is the walk-through: what a block is, what the wires mean, and why the whole industry builds sequences this way.
Blocks and wiresheets
A function block is a small box that does one job. Values come
in on the left, the block does something with them, and a result leaves on the
right. The connection points are called pins: input pins on the left
edge, output pins on the right. An AND block takes two
true/false inputs and outputs TRUE only when both inputs are TRUE. An
ADD block takes two numbers and outputs their sum. A block doesn't
run once and finish — it is re-evaluated continuously, many times a second, so
its output always reflects whatever its inputs are right now.
A wiresheet (the term comes from Niagara; other tools just call it the program or the function diagram) is a page full of these blocks with their pins joined by wires. A wire carries one block's output to another block's input. Signals come in two flavors, and a tool won't let you cross them: digital (also called binary or boolean — a plain true/false) and analog (a number — a temperature, a percent, a setpoint). The data flows left to right across the sheet, from the inputs that read the real world, through the logic, to the outputs that command equipment.
Why controls people work this way
Graphical programming isn't the only way to write a sequence — PLCs have ladder and structured text, and plenty of controllers can be scripted. But function blocks won the building-automation world for reasons that matter on a job site:
The diagram is the program. There's no gap between the
documentation and the code, because the wiresheet is both. A tech
who has never seen this particular controller can still open the sheet and
follow the wires. You can watch it run. A live wiresheet
shows the current value on every wire — you see the freeze-stat go true, you
see the setpoint arrive at the comparator, you watch the loop output climb.
Troubleshooting becomes follow the wire back from the wrong output until
the value stops making sense. The vocabulary travels.
An AND, a comparator, a PID block, an on-delay timer — these mean
the same thing on every platform. Learn the blocks once and you can read a
sheet on a controller you've never touched.
The block families
A controller's block palette can run to dozens of types, but they sort into a handful of families. Name the families and almost any block you meet is a variation on one you already know.
Inputs & outputs · the real world
The sheet's connection to physical points and to constants. An analog or binary input brings in a sensor or a contact; an analog or binary output commands a damper, a valve, a relay. A constant is a fixed number typed into the sheet — a setpoint, a deadband, a limit.
Boolean logic · true / false
AND, OR, NOT, XOR combine true/false signals; an SR latch remembers a state — once set, it stays set until something resets it. This is the family that makes interlocks, permissives, and safety chains.
Comparators · number → true / false
Greater-than, less-than, equal. A comparator is the bridge from the analog world to the digital one: it watches a number against a threshold and outputs a true/false the logic blocks can use. Most production palettes also bundle a deadband (hysteresis) comparator — one block with a gap between its on and off thresholds — so you get chatter-free on/off without wiring two comparators into a latch by hand.
Math · compute a value
Add, subtract, multiply, divide, min, max. Math blocks build a setpoint from a base value and an offset, average a pair of sensors, or compute a reset — the everyday arithmetic of a sequence.
Timers · delay and hold
An on-delay (TON) waits before passing a true signal through; an off-delay (TOF) holds a signal true for a while after it drops. Timers debounce noisy inputs, enforce minimum run times, and stop short-cycling.
Control · the loop
The PID block is a whole control loop in one box: feed it a setpoint and a measurement, and it outputs a 0–100 % command that drives the measurement toward the setpoint. PID Basics covers what's inside it.
How a wiresheet runs
The controller evaluates the whole sheet over and over on a fixed cycle — a scan. Each scan it reads the inputs, works through the blocks, and writes the outputs; then it does it again. Scan rates vary, but think of it as several to ten times a second.
Within one scan, a plain chain of logic settles all at once: a comparator's
result reaches the AND downstream of it in the same scan, because
the controller evaluates blocks in dependency order — sources first, then
whatever depends on them. The interesting case is feedback — a wire
that loops a block's output back into its own chain, which is exactly what an
SR latch is. A controller handles this by letting the feedback
wire carry the previous scan's value: the latch reads where it was
last scan, decides where it is now, and the loop resolves cleanly instead of
chasing itself. That one-scan memory is why a latch can hold a state and why a
sheet with a loop in it never freezes.
The economizer sheet below is a pure feed-forward chain, so there's no loop in
it to show this off. To actually watch the one-scan memory hold tick to tick,
open the Function-Block
Editor and load its freeze-stat example: an SR latch trips the
unit on a freeze and keeps it tripped on its own previous-scan value until a
reset clears it — the feedback behavior running, not just described.
A worked sheet — economizer enable
Here's a small real sequence. An air handler should use outdoor air for free
cooling, but only when two things are true at once: the outdoor air is cool
enough to actually help, and the unit is calling for cooling in the
first place. That's a sentence with an "and" in it — so the sheet has an
AND block at its heart.
Reading the diagram below left to right: the outdoor-air temperature (an
analog input, 55 in this example) and a changeover setpoint (a constant, 60)
feed a less-than comparator — is it cool enough? The comparator's
true/false answer feeds one input of the AND. The cooling-mode
signal (a digital input) feeds the other. Only when both are TRUE does the
AND output go true and enable the economizer. Outdoor air at 55 is
below the 60 changeover point and the unit is calling for cooling, so both
inputs are satisfied and the economizer is enabled. (That less-than block is a
dry-bulb changeover — the simplest version of a decision with real
subtlety in it. What the enabled economizer actually does, and when a
temperature-only comparison gets it badly wrong, is the
Economizers lesson.)
Green wires carry a TRUE digital signal (a FALSE one reads grey in the editor); blue wires carry an analog value.
That's the whole idea. Every sequence you'll meet — a freeze-stat (a coil-temperature safety that latches the fan off if the coil gets near freezing), a staging routine, a reset schedule (sliding a setpoint with outdoor temperature) — is the same move: real-world signals in on the left, blocks doing one small job each, commands out on the right. A big sheet is just a lot of small, readable steps.
Build one yourself
Reading about wiresheets only goes so far — the thing clicks when you wire one up and watch it run. The Function-Block Editor is a sandbox for exactly that: drag blocks onto a sheet, wire them, and watch the values move. It ships with the economizer above already built, plus a freeze-stat shutdown, a pair of thermostats, and a PID loop — load one, poke at the inputs, and see the logic respond.
Open the Function-Block Editor →