Overview
This reference documents a field-proven method for implementing a 3-out-of-4 breaker interlock on a Siemens LOGO! logic module. The required behavior is non-trivial: at any moment no more than three of four breaker control outputs may be energized, but the operator must still be able to drop any one of the three active breakers and pick up the one that was previously disabled, without a controller reset or a power cycle. A simple latching relay approach fails this requirement because the latched output holds its state and blocks the swap. The solution described here uses the LOGO! Mathematical Instruction blocks and an Analog Threshold Trigger to count the active outputs and gate the fourth one in real time, while allowing any of the three to be released at will.
The technique scales beyond four outputs and works on the entire LOGO! family that supports math instructions: 0BA0, 0BA1, 0BA2, 0BA3, 0BA4, 0BA5, 0BA6, 0BA7, 0BA8, and 0BA9 (referred to collectively as the LOGO! 8 generation when applicable). The program shown in this article was originally developed on a 0BA3-class device and validated against the LOGO! 0BA3 Basic manual (PDF) parameter set.
Prerequisites
- Siemens LOGO! logic module (0BA3 or later recommended) with at least 4 digital inputs and 4 relay/transistor outputs.
- LOGO! Soft Comfort V8.x or later installed on a Windows PC, matching the firmware generation of the target LOGO! (e.g., Soft Comfort V8.3 for 0BA8 devices, V7.x for 0BA6/0BA7).
- USB or Ethernet PC cable (LOGO! 0BA7 and later support Ethernet, 0BA6 added Ethernet on BM modules, 0BA4/0BA5 use the LOGO! USB PC cable).
- Four pilot devices (pushbuttons or maintained selector switches) wired to inputs I1 through I4.
- Four breaker shunt-trip or close coils wired to outputs Q1 through Q4 through interposing relays, as appropriate for the breaker control voltage.
- Basic familiarity with FBD (Function Block Diagram) editing in LOGO! Soft Comfort.
Problem Definition
Define a control function f over four boolean outputs {Q1, Q2, Q3, Q4} such that:
-
Maximum-on constraint: at any instant, the count of energized outputs
sum(Q1..Q4) ≤ 3. - Operator-driven swap: if the operator releases any one of the currently active outputs, the previously disabled output must become available for immediate energization through the same input stimulus, with no controller reset, latching, or sequence-memory requirement.
- Signal type: the inputs are maintained (static) selector switches unless explicitly configured otherwise; the program must not require momentary (dynamic) edges unless the designer chooses to add them.
- Determinism: no race condition shall allow a fourth output to be energized, even during the scan cycle in which the third output transitions from OFF to ON.
A naïve implementation using four latching relays fails requirement (2): once Q1 is latched, opening the I1 switch cannot unlatch it through the same input path, so swapping Q1→Q4 requires the operator to press a separate reset button. The math-instruction technique described below removes this limitation by treating the outputs as combinational with respect to the inputs and using a global count to enforce constraint (1).
Why Mathematical Instructions?
The Mathematical Instruction block (function name Math, in older LOGO! documentation sometimes called Arithmetic or labeled B0xx in the program block list) takes two analog inputs A and B and computes a configurable function. The available operators on 0BA3 firmware are:
| Operator | Symbol | Output |
|---|---|---|
| Addition | A + B | Sum of A and B |
| Subtraction | A − B | Difference A − B |
| Multiplication | A × B | Product A × B |
| Division | A ÷ B | Quotient A / B |
By configuring each of four Math blocks to add a constant 0 + 1 when its associated output is energized, and 0 + 0 when it is not, the block produces a value of 1 on the energized path and 0 on the de-energized path. A fifth Math block then sums the four preceding outputs to give the live count of active breakers. An Analog Threshold Trigger compares this count to a fixed threshold and produces a logic 0 (block) whenever the count is greater than the threshold, which is wired as an inhibit on the fourth output's drive path.
Because every input feeds the corresponding output through pure combinational logic, opening any one input immediately removes that output from the count and releases the inhibit, allowing a previously blocked output to be energized on the very next scan cycle. This satisfies requirement (2) without latching.
System Topology
Step-by-Step Program Construction
The following procedure creates the complete 3-of-4 interlock in LOGO! Soft Comfort FBD. Block numbers (B001..B006) are illustrative; your program will auto-assign numbers in the order you place the blocks.
Step 1 — Create the project
- Launch LOGO! Soft Comfort, select File → New, and pick the device class matching your hardware (0BA3, 0BA4, … 0BA8).
- Switch the editor to FBD mode (the default). Ladder view will display the same logic but is not as compact for math instructions.
Step 2 — Place four Math instruction blocks
- From the toolbar choose Special → Math (older releases: Functions → Math) and drop four blocks B001 through B004 onto the workspace.
- For each block, open the properties dialog and configure:
| Block | Input A source | Input B value | Operator | Comment |
|---|---|---|---|---|
| B001 | Input I1 | 0 | + (addition) | "Count Q1" |
| B002 | Input I2 | 0 | + | "Count Q2" |
| B003 | Input I3 | 0 | + | "Count Q3" |
| B004 | Input I4 | 0 | + | "Count Q4" |
When I1 is ON, B001 outputs the constant 1; when I1 is OFF, B001 outputs 0. The same is true for B002..B004.
Step 3 — Add the summing Math block
- Place a fifth Math block B005.
- Set operator to
+(addition). - Connect input A to the output of B001 and input B to a chained addition: nest the outputs of B002, B003, and B004 by adding three further Math blocks (B005a, B005b, B005c) each configured for
+, or on LOGO! 0BA6+ use the four-input variant if available in your firmware release. The final output of the chain represents the countN = Q1 + Q2 + Q3 + Q4.
+ blocks. 0BA5 firmware and later permit a single block with a configurable number of inputs; check the LOGO! manual for your generation.Step 4 — Add the Analog Threshold Trigger
- From the comparator family, select Analog Threshold Trigger (block B006).
- Configure the trigger parameters:
| Parameter | Value | Meaning |
|---|---|---|
| On threshold | 2.5 |
Output = 1 when Ax ≥ 2.5 |
| Off threshold | 2.0 |
Output = 0 when Ax ≤ 2.0 |
| Gain | 1.0 | No scaling required |
| Sensor (input source) | Output of B005 | Live count of active breakers |
The hysteresis (2.0 / 2.5) prevents output chatter when the count hovers around 3. With the count at exactly 3, the trigger output is high; with the count at 2 or below, the trigger output is low.
Step 5 — Wire the outputs
- Assign Q1, Q2, Q3 directly to inputs I1, I2, I3 — these are always permitted because they cannot, by themselves, exceed the limit.
- Assign Q4 to the boolean expression
I4 AND NOT B006. The simplest way to express this in FBD is to use an AND block with inputs I4 and the inverted output of B006 (right-click B006, choose Negate). - Optionally, label the AND block as "Q4 enable" for clarity.
Step 6 — Compile and download
- Press F5 or click Tools → Compile. Soft Comfort will display the number of blocks used and the remaining program memory.
- Connect to the LOGO!, click Transfer → PC → LOGO!, and upload the program.
- Switch the LOGO! to RUN mode.
Mathematical Operation Walk-through
Let N be the number of energized outputs at scan k. The program computes:
N_k = (I1_k) + (I2_k) + (I3_k) + (I4_k) // 0 ≤ N_k ≤ 4
B006_out_k = 1 if N_k ≥ 3
0 if N_k ≤ 2
Q1_k = I1_k
Q2_k = I2_k
Q3_k = I3_k
Q4_k = I4_k · (1 − B006_out_k) // AND with inverted threshold
Truth table for selected states (1 = ON, 0 = OFF):
| I1 | I2 | I3 | I4 | N (count) | B006 | Q1 | Q2 | Q3 | Q4 | Comment |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | Single breaker |
| 1 | 1 | 1 | 0 | 3 | 1 | 1 | 1 | 1 | 0 | Three breakers, 4th blocked ✓ |
| 1 | 1 | 1 | 1 | 4* | 1 | 1 | 1 | 1 | 0 | 4th request denied ✓ |
| 1 | 1 | 0 | 1 | 3 | 1 | 1 | 1 | 0 | 0 | 4th blocked because N already 3 ✓ |
| 0 | 1 | 1 | 1 | 3 | 1 | 0 | 1 | 1 | 0 | Same — fourth blocked ✓ |
| 0 | 0 | 1 | 1 | 2 | 0 | 0 | 0 | 1 | 1 | Two breakers, swap succeeds ✓ |
* The simultaneous case (all four inputs ON in one scan) is handled correctly because the threshold is evaluated from the same B005 output that drives Q4; the count seen at the threshold is the count of inputs that closed the AND gate. As long as the LOGO! scan reads inputs, evaluates B005, then evaluates B006, then computes Q4, the fourth output is correctly suppressed on the same scan that the third output was already on.
Signal Type: Static Switch vs Dynamic Pushbutton
The block diagram above assumes static (maintained) switches. Each input is wired straight to its output through the AND gate, so the output follows the input directly. If the operator replaces a maintained switch with a momentary pushbutton, the output will drop the moment the button is released, which is rarely the desired breaker control behavior. To use momentary buttons, prepend each input with one of the LOGO! latching relay blocks (function name Latching relay, or use the RS flip-flop):
Set input = I1
Reset input = a separate "Trip Brk1" pushbutton wired to an unused input (e.g., I5)
Q (output) = feeds the Math block B001 input A
The swap operation then becomes: press the trip pushbutton to clear the latched output, which drops the count to 2, which releases the B006 inhibit, which permits the previously-blocked output to be latched on the next press of its own start button. This satisfies requirement (2) with momentary controls.
Scan-Cycle Timing and Race Conditions
LOGO! 0BA3 executes its program in cyclic scan mode. The default scan period is on the order of 1 to 10 ms depending on program complexity. Within a single scan, the LOGO! evaluates all function blocks in the order they appear in the program (i.e., B-number order). To guarantee that B006 sees the pre-switch count and not a transient overshoot, place B001..B005 and B006 before the AND block that drives Q4. Soft Comfort preserves this ordering automatically; however, if the user re-arranges the workspace manually, verify the order in Tools → Block Order.
For a more rigorous guarantee, add a small delay block (On-delay, 50 ms) on the inhibit path to debounce contact bounce on the input switches. This prevents a brief contact-bounce-induced fourth-count spike from causing a brief fourth-output pulse on Q4.
Expanding to N-of-M
The pattern generalizes cleanly. For an N-of-M interlock (any N of M outputs may be ON):
- Place M Math blocks, one per output, each adding
0 + I_n. - Chain the results with M−1 summation blocks.
- Set the Analog Threshold Trigger on-threshold to
N − 0.5and off-threshold toN − 1.0(hysteresis of 0.5). - AND each output (after the first N) with the inverted threshold.
For a 3-of-6 panel, the block count is approximately 2M + M + 1 ≈ 19 function blocks, well within the program memory of even a 0BA3 LOGO! (which supports up to 56 function blocks in BM version, 24 in the smaller variants). For systems above ~20 outputs, consider migrating to a LOGO! 0BA8 with 400 function-block memory or to a S7-1200 PLC.
Verification and Commissioning
- Open-circuit test: with all four inputs OFF, confirm Q1..Q4 are all 0 using the LOGO! online monitor (Tools → Online Test in Soft Comfort).
- Single-on test: energize I1 only; confirm Q1=1, Q2..Q4=0.
-
Three-on test: energize I1, I2, I3; confirm Q1=Q2=Q3=1, Q4=0. The B006 output in the monitor must read
1. - Fourth-on attempt: with I1..I3 still ON, close I4; Q4 must remain 0. Open I4; Q4 should now be ready to close.
- Swap test: with I1..I3 ON and I4=0, open I1. The count drops to 2, B006 transitions to 0, and closing I4 must energize Q4.
- Release test: open I2 and I3 simultaneously (count drops to 1); close I4. Q4 must close immediately.
- All-off test: open all inputs. All Q's drop, count returns to 0, system is ready for the next request.
Troubleshooting Matrix
| Symptom | Likely Cause | Diagnosis | Remediation |
|---|---|---|---|
| All four Q's turn on simultaneously | Threshold block configured for On < N instead of On > N, or the AND gate is missing | Inspect B006 in the online monitor; verify it goes high when N=3 | Re-configure B006 on/off thresholds; re-wire Q4 through an AND with inverted B006 |
| Only two breakers can be turned on at once | Off-threshold set too high (e.g., 2.5 instead of 2.0) | Read B006 output for various N values | Set off-threshold = N − 1.0 |
| Q4 chatters when count hovers around 3 | No hysteresis; contact bounce on the inputs | Watch B006 in the trace tool | Increase hysteresis (on = 2.5, off = 2.0 already gives 0.5 hysteresis; widen to 1.0 if needed) |
| Operator cannot swap Q1→Q4 | A latching relay was added in error | Look for RS/Latching blocks in the program list | Remove the latching block; outputs must be combinational with respect to inputs |
| Q4 turns on for 5–10 ms then drops | Threshold evaluated before the AND gate in the scan | Check Block Order in Soft Comfort | Drag B005 and B006 to appear before the Q4 AND block in the program list |
| Math block reports division-by-zero or invalid | Operator was changed to / by mistake |
Open each Math block properties | Set operator to + on every block |
| Outputs delayed by ~100 ms | On-delay or Off-delay block accidentally inserted | Search the program for time-function blocks | Remove the timer or move it to the inhibit path only |
Safety Considerations
- This interlock is a control interlock, not a safety interlock. It prevents four breakers from being commanded ON at once but does not protect personnel from arc-flash, over-current, or inadvertent re-energization.
- For protection-grade interlocking (e.g., to comply with NFPA 70E or IEC 60204-1 stop categories), use hard-wired electromechanical interlock contacts or a safety-rated logic module such as the Siemens LOGO! 0BA7 with the integrated Safety function library, or a S7-1500F with a F-CPU.
- Wire each breaker control circuit through an auxiliary contact of the other breakers, in addition to the LOGO! output, so that a LOGO! output failure cannot bypass the interlock.
- Apply a hazard label on the panel stating the maximum number of simultaneously closable breakers.
Memory and Resource Footprint
| Resource | 0BA3 BM | 0BA4 BM | 0BA5 BM | 0BA6/0BA7 BM | 0BA8 BM |
|---|---|---|---|---|---|
| Function blocks used (this program) | ~9 | ~9 | ~9 | ~6 | ~6 |
| Maximum blocks available | 56 | 130 | 200 | 200 | 400 |
| Rem blocks used | 0 | 0 | 0 | 0 | 0 |
| Digital inputs used | 4 | 4 | 4 | 4 | 4 |
| Digital outputs used | 4 | 4 | 4 | 4 | 4 |
Alternative Approaches
Other valid implementations include:
- Shift-register / queue approach: use the LOGO! Shift register block to maintain a 4-bit running history and the AND/NOT blocks to enforce the 3-of-4 rule. This adds memory of previous selections and is useful when the operator should not be allowed to swap arbitrarily.
- Counter-based approach: use the LOGO! Up/Down counter block on the four outputs and compare the count to a fixed value with a comparator. Functionally equivalent to the math-block technique but uses 3–4 function blocks instead of 5–6.
- External relay logic: if the LOGO! is unavailable, the same logic can be built with three DPDT interlock relays in a circular arrangement, but the implementation is bulky and harder to expand.
Related Documentation
- LOGO! 0BA3 Basic Devices Manual (PDF) — installation, programming, function-block reference for math, comparators, and logic blocks.
- LOGO! Soft Comfort Online Help (bundled with the software) — context-sensitive FBD and Ladder reference.
- Siemens Industry Online Support: search for "LOGO! 0BA8" or "LOGO! 8" for the latest generation manual set.
FAQ
What LOGO! firmware generations support the Math Instruction block?
The Math block has been present since the original 0BA0 series and is available in every generation since, including the current 0BA8. On 0BA3/0BA4 the block is two-input only and must be chained to sum more than two values, while 0BA5 and later allow a configurable number of inputs in a single block.
Can the program handle momentary pushbuttons instead of maintained switches?
Yes. Insert a latching relay (or RS flip-flop) between each input and the corresponding Math block, and wire a separate "trip" pushbutton to the reset input. The math-counter mechanism still enforces the 3-of-4 limit, while the latching block gives the operator a way to release a breaker with a momentary press.
Why are the on/off thresholds set to 2.5 and 2.0 instead of exactly 3 and 2?
Because the Analog Threshold Trigger requires hysteresis. With a clean integer count of 0–4, the block would chatter at the boundary. Setting on = 2.5 and off = 2.0 gives a 0.5-unit hysteresis band so that when the count reaches 3, the trigger latches to "blocked," and when the count falls to 2, it cleanly releases.
Will the fourth output ever flash ON for one scan cycle if all four inputs close simultaneously?
No, provided the function blocks are placed in the correct scan order: B001..B005 (the per-output counters and the sum) and B006 (the threshold) must be evaluated before the AND block that drives Q4. In Soft Comfort this is the default if you drop the blocks in the order described in this article. You can confirm in Tools → Block Order.
How do I scale this to 3-of-6 or 4-of-8?
Place one Math block per output, sum them with chained addition (or a single multi-input block on 0BA5+), and set the Analog Threshold Trigger to on = N − 0.5, off = N − 1.5 for an N-of-M rule. AND each of the last M − N + 1 outputs with the inverted trigger. A 3-of-6 program fits in roughly 19 function blocks, well within the LOGO! 0BA3 limit of 56.