Boolean Logic & Latches Logic
Every control sequence is full of sentences: run the fan only if every
safety is proved and the schedule says occupied. Light the alarm if any
trouble contact closes. Once the freeze stat trips, keep the unit off until
someone resets it. The boolean blocks — AND, OR,
NOT, XOR, and the SR latch — are how
those sentences become logic on a wiresheet. This page is one question, start
to finish: how do TRUE/FALSE blocks turn equipment rules — interlocks,
permissives, safeties — into logic, and how does a latch remember?
This page assumes you can already read a sheet at the block level — what a block and its pins are, what the wires carry, and how a scan evaluates. That's Function-Block Basics, the opening lesson of this chapter; start there if a wiresheet is new to you. Everything below lives inside one block family: the true/false logic that makes equipment decisions.
The permissive chain: AND, OR, NOT
Start with the sentence you'll meet on almost every unit: the fan may run
only when every safety is proved, the building is occupied, and the outdoor
air won't freeze the coil. Every "only when … and" in that sentence is an
AND. Chain the conditions into one AND and its
output is the run permit — TRUE only while every single
input is TRUE. That structure has a name in the field: a
permissive chain. It's deliberately unforgiving. One FALSE
anywhere — one safety not proved, one contact open — and the permit drops. A
permissive chain is a chain of proofs, and a proof you don't have counts
against you.
OR is the opposite sentence: any one of these is enough.
Three trouble contacts — filter, condensate overflow, smoke — into one
OR gives a common alarm that lights when any of them
trips. And NOT is the word "isn't": it flips TRUE to FALSE and
back. Those three cover most of the logic you'll ever read on a sheet.
Textbooks present these blocks as truth tables — every input
combination and its output, laid out as a grid. The grid below is worth one
look, but don't memorize it as a grid. Read each column as a
sentence instead, because the sentence is how you'll actually
use it standing in front of a live sheet: AND is TRUE only
when every input is TRUE. OR is TRUE when at least one
input is TRUE. XOR is TRUE when the inputs
disagree. NOT is the opposite.
| A | B | A AND B | A OR B | A XOR B | NOT A |
|---|---|---|---|---|---|
| F | F | F | F | F | T |
| F | T | F | T | T | T |
| T | F | F | T | T | F |
| T | T | T | T | F | F |
T = TRUE, F = FALSE. Read the columns as sentences, not rows of a grid.
NOT earns a longer look, because it's tied to how safeties are
wired in the first place. A hardwired safety — a freeze stat, a high-static
switch — is almost always normally closed: the contact is
closed while the device is healthy, so the binary input reads TRUE when
everything is fine. That's a deliberate fail-safe choice. If a wire
breaks or the device dies, the circuit opens and the point reads FALSE — the
same as a trip — so a failed safety circuit stops the equipment instead of
silently promising it protection. A healthy safety proves itself
every scan; silence is treated as a trip.
Wired that way, the "OK" signals feed the permissive AND
directly. But not every point arrives in the OK sense. An alarm-style contact
or a software point often reads TRUE when tripped — the opposite
polarity — and that's what NOT is for: flip the trip-sense signal
to OK-sense before it enters the chain. Getting a signal's sense wrong (or
dropping the NOT that fixes it) is a classic day-one
commissioning bug: every device healthy, and the fan still won't start,
because the chain is reading a healthy FALSE as a standing trip.
Here's the chain drawn as a sheet. Three safety proofs feed the
AND; two are proved, one isn't — and the wire colors tell the
story at a glance, the same way a live editor would. (This AND is
drawn with three inputs. Production palettes usually offer multi-input
AND/OR blocks; a palette that only has two-input
blocks — like this site's
Function-Block Editor — chains them instead, and an AND of
ANDs is still an AND.)
Green wires carry a TRUE digital signal, grey wires carry FALSE — the same coloring the editor uses live. (Analog values ride blue wires; this sheet has none.)
The SR latch: how logic remembers
Everything above is combinational logic: the output is a pure function of what the inputs are right now. The high-static switch closes again and the permit comes right back, automatically, with no memory that anything happened. For comfort logic that's usually what you want — the zone got warm, the zone cooled off, move on. For a safety it is exactly wrong.
Walk the freeze-stat case through and you'll see why. The stat trips on a near-freezing coil, the permit drops, the fan stops. But with no airflow across it, the coil drifts back toward room temperature — so the freeze stat clears itself. If the trip were plain combinational logic, the permit would come right back, the fan would restart, cold air would slam the coil, and the stat would trip again. The unit short-cycles through its own safety, over and over, and nobody ever finds out why the coil was freezing in the first place. The fault clearing is not the same thing as the problem being fixed. A safety trip must stand — visible, holding the equipment off — until a person acknowledges it and goes looking for the cause.
That's the job of the SR latch — the one block
in the boolean family with memory. It has two inputs and a story: a TRUE on
S (set) drives the output Q TRUE,
and Q then stays TRUE on its own — the input can drop, the latch
holds. A TRUE on R (reset) drops Q back to FALSE.
Wire the freeze trip to S and you get the behavior the story above demands:
the trip is remembered after the stat clears, and only a deliberate reset
releases it.
One question the block has to answer that a truth table can't dodge: what if S and R are both TRUE on the same scan? The latch in this site's editor is set-dominant — S wins, Q stays TRUE. Read that in equipment terms and it's the right answer for a safety: while the fault is still standing, you cannot reset your way past it. Hold the reset button all day; nothing happens until the freeze stat itself clears. The reset only works once the fault is gone. (Palettes vary — some vendors ship a reset-dominant flavor too, where R wins. It matters: behind a maintained reset switch, a reset-dominant latch never holds the trip at all. Check which one your palette gives you before you trust it with a safety.)
Together, that's the latch + manual-reset idiom: the fault sets, an operator resets. S comes from the safety; R comes from a person — a reset button on a graphic, a software point the BMS writes, a physical switch. The timeline below is the whole life of one trip, on all four signals at once — and it's the same drawing you'd assemble in your head watching the live sheet.
Read the four traces against each other. The trip and the latch rise
together; the fan — Q through a NOT — drops the same scan. The
first reset pulse changes nothing, because the fault is still standing and
set wins. Then the stat clears and nothing on the sheet moves:
that flat stretch of Q, TRUE with both inputs FALSE, is the memory — the
whole reason the block exists. Only the second reset, arriving after the
fault is gone, drops Q and restores the fan.
Small idioms: XOR and the feedback wire
Two smaller moves round out the family. First, XOR
— TRUE when its inputs disagree — which makes it the sheet's
disagreement detector. The classic use is command versus
status: wire the fan's command and its proof contact into an XOR
and the output goes TRUE exactly when the two don't match — commanded on with
no proof (a broken belt, a tripped overload), or proved running with no
command (a welded contactor, a hand switch left in HAND). The same shape
checks any pair of states that must never read alike: the open and closed end
switches on a two-position damper should always disagree, so
XOR TRUE is health and FALSE means a switch — or the actuator —
is lying. In practice a real mismatch alarm waits a few seconds before
sounding, so the equipment has time to actually move; delays and debounce are
their own upcoming lesson in this chapter.
Second, a one-sentence version of something you'll notice the first time you stare at a latch: it's secretly a loop — the block's output feeds back into its own decision — and a sheet resolves any feedback wire by letting it carry last scan's value, which is exactly the one-scan memory that lets a latch hold (how a wiresheet runs covers the scan itself). That single sentence will carry you a long way; reading whole sheets end to end — loops, feedback, and all — is its own lesson coming later in this chapter.
See it hold
Everything on this page is running, right now, in the
Function-Block Editor —
load its freeze-stat shutdown example and you're looking at this
lesson as a live sheet: a freeze binary input sets an SR latch,
a NOT drops the fan output, and an alarm output lights. Trip the
freeze stat and watch the latch catch it. Then clear the stat — and watch the
latch not care. The fan stays off, the alarm stays lit, and the only
way back is the reset input. While you're there, hold the reset TRUE with the
freeze stat still tripped: the latch ignores it until the fault clears,
set-dominance live on the wire.