Siemens LOGO! Sequence Control: Latch Q2, Mask I3 with Q3 State

David Krause17 min read
HMI ProgrammingSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

Siemens LOGO! mini-PLCs routinely run fill-and-drain, pump-down, and wash-cycle sequences in which a single digital sensor must hand off control between two outputs without re-triggering during the second output's run window. The recurring question "How do I keep sensor I3 from disturbing the program after Q2 has switched off and Q3 is running?" is fundamentally a state-machine masking problem: I3 is only allowed to act during the PUMP state, not during the DRAIN or BLINK states.

This reference walks through a clean implementation on a LOGO! 8 base module using the FBD library in LOGO! Soft Comfort V8.3 or V8.4. The same logic ports to LOGO! 6 and LOGO! 7 with only minor catalog-number substitutions. The solution uses two RS flip-flops (latching relays), one AND/NOT pair to mask the sensor, an on-delay timer for the Q3 run time, and an asynchronous pulse generator for the blink phase. The same pattern extends directly to any "start → level-trigger → timer → blink" cycle.

Field rule: "Mask the sensor with the output that just took over." Tie the sensor through an AND with the inversion of the new active output. This single rule resolves ~90% of bounce/retrip issues in fill/drain logic on LOGO! hardware.

Prerequisites

  • LOGO! 8 base module — for example 6ED1052-1MD08-0BA0 LOGO! 24CE (24 V DC, transistor outputs, Ethernet) or 6ED1052-1HB08-0BA0 LOGO! 12/24RCE (mixed-voltage, relay outputs, Ethernet). Firmware ≥ 8.3 recommended for full Soft Comfort V8.4 compatibility.
  • LOGO! Soft Comfort V8.3 or V8.4 engineering software, downloadable from Siemens Industry Online Support.
  • Ethernet cable for program download (LOGO! 8) or microSD card for program transfer on legacy units.
  • I1 wired to a normally-open START pushbutton (PNP source for 24 V DC variants).
  • I3 wired to a high-level sensor, PNP NO recommended for 24 V DC LOGO! variants. Mechanical float switches need an external debounce or an on-delay block.
  • Q2 wired through an interposing relay (Finder 55.34 or equivalent, 24 V DC coil) to a pump contactor — relay-output LOGO! variants (RCE) can switch contactor coils directly up to 8 A on a single output.
  • Q3 wired to a drain valve solenoid or drain-motor contactor.
  • Q4 wired to a 24 V indicator lamp or LED beacon for the blink phase.

I/O Mapping and Module Selection

Address Type Function Wiring
I1 DI START pushbutton +24 V → PB → I1 (sink module)
I2 DI Thermostat OK (interlock) +24 V → TH → I2
I3 DI High-level sensor PNP NO → I3, brown = +24 V, blue = 0 V
I4 DI Low-level sensor (optional) PNP NO → I4
I5 DI STOP / abort (NC) NC pushbutton to I5 (see Edge Cases)
Q1 DO Reserved (cycle-complete beacon) Lamp load via interposing relay
Q2 DO Pump contactor Pump coil ≤ 8 A (RCE) or via interposing relay (24CE)
Q3 DO Drain valve / drain pump Solenoid ≤ 8 A
Q4 DO Blink lamp (pulsed) Indicator LED or 24 V beacon

State Machine Specification

The cycle has four discrete states. Transitions are driven by digital inputs and a single timer. The masking requirement appears at the PUMP→DRAIN boundary: once Q3 asserts, I3 must be ignored even if the water re-enters the sensor range due to splash, drip, or backflow.

IDLE PUMP (Q2=1) DRAIN (Q3=1) BLINK (Q4) I1=1 I3=1 (masked) T1 done T2 done → cycle complete

Transition Table

Current State Condition (truth expression) Next State Action
IDLE I1 = 1 PUMP Set B01 (Q2 latches), Reset B02 (Q3 forced LOW)
PUMP (I3 = 1) AND (Q3 = 0) DRAIN Reset B01, Set B02 (Q3 latches)
DRAIN — (I3 ignored) DRAIN Maintain Q3, accumulate T1
DRAIN T1 ≥ T_drain (e.g., 30 s) BLINK Reset B02, Enable B07 pulse generator
BLINK T2 ≥ T_blink (e.g., 10 s) IDLE Disable B07, all outputs LOW

FBD Block List

Six blocks implement the entire cycle. The sensor mask uses one AND gate plus one NOT gate; both are in the GF (general functions) palette of LOGO! Soft Comfort.

Block # Function Library Symbol Inputs Output →
B01 RS flip-flop (Pump latch) SR (Latching relay, RS variant) S = I1, R = Q3 Q2 (pump), also feeds back into B03 mask
B02 RS flip-flop (Drain latch) SR (Latching relay, RS variant) S = M1, R = T1.Q Q3 (drain)
B03 AND (sensor mask) & I3, NOT(Q3) via B04 M1 (masked I3)
B04 NOT ¬ Q3 (feeds B03)
B05 On-delay (drain timer) On Trg = Q3, T = 30 s T1.Q
B06 AND (blink enable window) & T1.Q, NOT(T2.Q via B08) B07.En
B07 Clock generator (blink) Bl En = B06 output Q4 (blink output)
B08 NOT ¬ T2.Q (feeds B06)
B09 On-delay (blink window) On Trg = T1.Q, T = 10 s T2.Q

The Key Insight: Sensor Masking with Q3 Inversion

The mask is implemented with one AND gate and one NOT gate. The signal that is allowed to advance the cycle is:

M1 = I3  AND  NOT(Q3)

Translation in Boolean form:

  • During PUMP state, Q3 = 0 → NOT(Q3) = 1 → M1 = I3. The sensor is allowed to set B02.
  • During DRAIN state, Q3 = 1 → NOT(Q3) = 0 → M1 = 0 regardless of I3. Sensor chatter, splash, drip, or backflow cannot retrigger B02.
  • During BLINK and IDLE states, Q3 = 0, but I3 is not pressed (or is ignored by the operator), so the system stays put.
Why mask on NOT(Q3) and not NOT(Q2)? The mask must be on the output that took over from the sensor. Q3 is the new active driver; Q2's transition is a one-shot event. Tying the mask to Q3 ensures that even if the pump briefly cycles back due to plumbing backflow, I3 cannot re-set the drain latch. Tying it to Q2 would only mask during the brief overlap when both outputs are changing.

Walking Through Each Block

B01 — Pump Latch (RS Flip-Flop)

Drag "Latching relay" from the SF (special functions) palette into the FBD editor. Set its variant to RS (reset dominant). Connect:

  • S input → I1 (START pushbutton)
  • R input → Q3 wire (B02 output). The instant Q3 latches HIGH, the pump is forced OFF — even if I1 is still pressed.
  • Q output → Q2 terminal driver (and route to physical output Q2).

Parameters: Remanence = OFF (volatile). Variant = RS for fail-safe behavior on power recovery; choose SR if you want auto-restart after power-fail.

B03 + B04 — Sensor Mask

Place an AND gate (B03) with two inputs: I3 and the inverted Q3. Place a NOT block (B04) with input wired to the Q3 net. The AND output is marker M1, a virtual flag internal to the LOGO! program. Markers (M1–M64 depending on LOGO! version) are free internal bits that do not require a physical terminal.

B02 — Drain Latch (RS Flip-Flop)

Second "Latching relay" SF block. Connect:

  • S input → M1 (the masked sensor)
  • R input → T1.Q (drain timer done)
  • Q output → Q3 terminal driver

B05 — On-Delay Timer (Drain Duration)

Use the "On-delay" SF block so that Q3 stays on for the configured drain time:

  • Trg → Q3
  • T → 30 s (adjust per application; range 0.01 s to 99:59 h depending on time base)
  • Q → T1.Q

While Q3 remains continuously HIGH for 30 s, T1.Q goes HIGH, which resets B02 and drops Q3, ending the DRAIN state.

B07 — Asynchronous Pulse Generator (Blink)

Use "Asynchronous pulse generator" (also labeled "Bl" in older Soft Comfort palettes). This block outputs a continuous square wave at its Q terminal while the Enable input is HIGH. Parameters:

Parameter Value Meaning
En (Enable) B06 output Blink while in BLINK state only
T_h (high time) 500 ms Lamp ON duration
T_l (low time) 500 ms Lamp OFF duration
Full period 1.0 s 1 Hz blink, 50% duty
Remanence OFF Resets to T_h on enable

B06 + B08 + B09 — Blink Window

To stop the blink after N seconds, the enable line of B07 must drop. This is done with an on-delay timer B09 wired in parallel with B07 enable:

  • B09 On-delay: Trg = T1.Q, T = 10 s, Q = T2.Q.
  • B08 NOT: in = T2.Q.
  • B06 AND: in1 = T1.Q, in2 = B08 output. Output = B07.En.

Equivalent logical expression: B07.En = T1.Q AND (NOT T2.Q). As soon as T2.Q goes HIGH (10 s after T1.Q), the blink enable drops and Q4 stops pulsing.

FBD Topology Diagram

I1 I3 Q3 B01 RS(pump latch) B03 AND(sensor mask) B04 NOT¬Q3 B02 RS(drain latch) B05 On-delayT1 = 30 s Q2 pump Q3 drain B06 AND(blink gate) B07 Bl(pulse gen) B09 On-delay T2 Q4 blink

RS vs SR Latching Relay — When to Use Each

Variant Behavior when S=1 and R=1 simultaneously Use case
RS (reset dominant) Q = 0 (reset wins) Safety-style stop, fault override
SR (set dominant) Q = 1 (set wins) One-way progression, auto-restart

For the pump latch (B01), RS is preferred: if Q3 happens to be HIGH at the same moment I1 is pressed (e.g., at startup), the pump must remain OFF until Q3 drops. For the drain latch (B02), RS is also preferred so that T1.Q reliably overrides any residual masked-sensor activity.

Wiring for 24CE vs RCE Variants

LOGO! 24CE (6ED1052-1MD08-0BA0) — Transistor Outputs

  • Inputs I1–I8 are 24 V DC sinking. Wire PNP sensors so that the signal line drives +24 V to the input.
  • Outputs Q1–Q4 are 24 V DC sourcing transistors, rated 0.3 A continuous per channel. Group derating: max 3 A total per group of 4 outputs.
  • For pump contactor or solenoid > 0.3 A, use an interposing 24 V DC relay (e.g., Finder 55.34, 24 V DC coil, 10 A contacts).

LOGO! 12/24RCE (6ED1052-1HB08-0BA0) — Relay Outputs

  • Outputs are volt-free SPDT relays rated 10 A / 240 V AC or 10 A / 30 V DC. Pump contactor coils (typically 24 V DC or 230 V AC at < 1 A) can be switched directly.
  • Mechanical life: ~105 cycles at full load. For high-cycle applications, derate to 50% of rated current.

Commissioning Procedure

  1. Connect the LOGO! module to your PC via Ethernet. Open LOGO! Soft Comfort and select "PC → LOGO!" transfer. Verify the firmware version of the connected module matches the Soft Comfort project.
  2. Download the program in STOP mode. Verify parameters transferred without errors in the LOGO! system log.
  3. Switch LOGO! to RUN. With all inputs LOW, Q2, Q3, and Q4 should all be LOW. Open the online monitor in Soft Comfort and confirm markers M1, T1.Q, T2.Q are all LOW.
  4. Press I1. Q2 should latch ON (verify in online monitor and on the physical output LED). Release I1 — Q2 should remain ON.
  5. Force I3 HIGH (jumper from +24 V to I3). Q2 should drop and Q3 should latch ON. Q4 should remain LOW.
  6. Toggle I3 multiple times (press the start button if I1 is wired to a button, then jump I3 again). Q3 must not change state. This is the masking test.
  7. Wait 30 s (or the configured T value). Q3 should drop; T1.Q should go HIGH; Q4 should start blinking at 1 Hz.
  8. Wait 10 s. T2.Q should go HIGH; blink should stop; the program returns to IDLE.
  9. Press I1 again. The cycle repeats.

Troubleshooting Matrix

Symptom Likely Cause Diagnostic Step Fix
Q2 never latches S and R both active simultaneously Monitor B01 inputs in online mode Verify R is not stuck HIGH; check the Q3 wire is not back-driven through the B02 output
Q2 drops as soon as I1 is released AND used in place of RS latch Inspect B01 in FBD editor Replace the AND block with the Latching Relay SF block
Q3 retriggers during drain Mask missing or wrong input Trace M1 in online test while toggling I3 Confirm B03 inputs are I3 and NOT(Q3); confirm B04 input is the Q3 net, not Q2
Q4 blinks during PUMP state B07 Enable wired to Q2 or T1.Q directly Inspect B07 En input Wire En through B06 so that it equals T1.Q AND NOT T2.Q
Blink never stops T2.Q reset path open Check B09 → B08 → B06 wiring Verify T2.Q drives B08, B08 output drives B06, B06 drives B07.En
Pump chatter at the level sensor Sensor hysteresis too narrow or float bouncing Measure I3 with a scope or Soft Comfort trend Add a 100–200 ms on-delay on I3, or replace the mechanical sensor
No outputs after power cycle Remanence not set Check block parameter /R boxes Enable Remanence on B01, B02, B05, B06, B07, B09 if state must survive power loss
Q4 LED inverted (lights when output is LOW) Sink-vs-source confusion Verify output type in module catalog number For PNP LED wiring on NPN transistors, swap the LED polarity
Cycle starts spontaneously Remanence on B01 plus noise on I1 Add a 50 ms debounce on I1 Insert an On-delay SF on I1 with T = 50 ms
Drain timer never expires T value set to 0 or units misread Open B05 parameter dialog Confirm the time base (s vs min) and value

Compatible LOGO! Modules and Catalog Numbers

Module Catalog # Inputs Outputs Notes
LOGO! 24CE 6ED1052-1MD08-0BA0 8 × DI 24 V 4 × DQ 24 V / 0.3 A Transistor, Ethernet
LOGO! 12/24RCE 6ED1052-1HB08-0BA0 8 × DI (4 AI) 4 × R relay 10 A Mixed voltage, relay outputs
LOGO! 230RCE 6ED1052-1FB08-0BA0 8 × DI 230 V AC 4 × R relay 10 A Mains voltage inputs
LOGO! DM8 24R 6ED1055-1HB00-0BA0 4 × DI 24 V 4 × R relay 5 A Digital expansion
LOGO! DM16 24R 6ED1055-1NB10-0BA0 8 × DI 24 V 8 × R relay 5 A Digital expansion
LOGO! AM2 6ED1055-1MA00-0BA0 — 2 × AO 0–10 V / 4–20 mA Analog expansion

Always cross-check the catalog number against the latest Siemens Industry Online Support catalog before ordering; module revisions are issued periodically.

Edge Cases and Field-Proven Caveats

1. Sensor Debounce

Mechanical float switches can chatter at the trip point, producing 20–50 ms of oscillation. Insert a 100–200 ms on-delay (SF block "On-delay") on I3 before feeding it into the mask AND gate. This adds no perceptible lag to a 30-second cycle but eliminates contact bounce.

2. Power-Fail Recovery

If a power loss occurs during DRAIN (Q3 = 1), the default volatile latches release. On power-up, the program sits in IDLE. Pressing I1 restarts the cycle from scratch. If you need the cycle to resume where it left off, enable Remanence on B01, B02, B05, B06, B07, and B09 — but be aware that the asynchronous pulse generator (Bl) resets its phase on enable, which may cause an apparent glitch in the blink timing.

3. Operator Lockout / Abort

To allow the operator to abort mid-cycle, wire a normally-closed STOP button (e.g., I5) into the R input of both B01 and B02. Pressing the button forces both latches OFF regardless of state. For added safety, route I5 through a "Window monitor" SF that requires the button to be held for ≥ 1 s before aborting — preventing accidental stop from a brush of the panel.

4. Hysteresis on Level Sensor

If the same I3 input must also detect low level for refilling (a wash-machine drum typically needs to refill mid-cycle), do NOT tie the low-level condition to I3 — use a separate I4 input and add a small hysteresis SF block (set/reset difference of at least 5 cm on a 50 cm tank). Sharing I3 produces oscillation at the boundary because the mask can release prematurely when Q3 drops.

5. Output Group Derating on Transistor Variants

On LOGO! 24CE (transistor outputs), Q1–Q4 share a common 24 V supply and thermal budget. Total continuous current per group of four outputs is 3 A, with a per-channel max of 0.3 A. Pulse-driven loads (LEDs, blink lamps) draw low average current; for incandescent blink lamps, use a relay expansion (DM8 R, 5 A per contact).

6. Why Not Use the Latching Relay as a Pulse Source?

Beginners sometimes try to wire the blink to a "Retentive on-delay" cycling the output. While this works, the asynchronous pulse generator (Bl) is purpose-built and survives power cycles cleanly. It also runs without a separate enable flag in many applications — just connect En to the state where blinking should occur (here, T1.Q AND NOT T2.Q).

7. Avoiding the "Output Race" Between B01 and B02

If I3 is pressed at the exact moment I1 is released, there is a one-cycle race between B01 (which wants to drop) and B02 (which wants to set). Because B01 reset is wired directly to Q3, and Q3 only becomes HIGH after B02 sets, there is no real race in this topology — Q3 cannot exist before B02's set input is acknowledged. If you observe a race, the most common cause is a slow B02 update; check that you are using SF blocks with their default setting "Standard" and not "High-speed" counters which can introduce a sub-millisecond skew.

8. Migrating to LOGO! 8.3 BM (Basic Modules)

LOGO! 8.3 BM variants (catalog 6ED1052-1xxxxx-0BA3) include additional analog inputs and faster scan times (typically 0.4 ms per block). The same FBD transfers with no changes. Note: marker count is still 64 (M1–M64) on BM variants; if you need more, use a DM16 expansion or upgrade to a LOGO! 8.4 variant which supports 256 markers.

Verification Checklist

  • [ ] Q2 latches on I1 press and stays latched after I1 release.
  • [ ] Q2 drops the instant Q3 latches.
  • [ ] I3 transitions after Q3 is ON have zero effect on Q3 state (mask works).
  • [ ] Q3 stays on for the configured T_drain seconds, then drops.
  • [ ] Blink begins the instant Q3 drops (no delay).
  • [ ] Blink stops after T_blink seconds.
  • [ ] Cycle is repeatable on next I1 press (no latched residual state).
  • [ ] No floating outputs in IDLE: Q2, Q3, Q4 = LOW.
  • [ ] Power-cycle restores safe IDLE state.
  • [ ] STOP button aborts mid-cycle.

How This Pattern Generalizes

The Q3-inversion sensor mask is the same pattern used in pump-down control, dosing pumps, lubrication cycles, and HVAC damper sequencing. The general recipe is:

  1. Define a state machine with explicit states and transitions.
  2. Latch each actuator with an RS flip-flop.
  3. For every sensor that triggers a state transition, AND it with the inversion of the destination state's output.
  4. Use timeouts as state-exit conditions.
  5. Use the asynchronous pulse generator for any periodic indicator.

Apply this template to any "fill → level-trigger → drain → timer → indicator" sequence, and the retrigger problem disappears.

FAQ

How do I stop sensor I3 from re-triggering Q3 once the drain valve opens?

Gate I3 through an AND with the inversion of Q3: M1 = I3 AND NOT(Q3). This single mask forces I3 LOW during the DRAIN state, so splash, drip, or sensor bounce cannot retrigger the cycle. In LOGO! Soft Comfort, place one AND block and one NOT block; connect I3 and the inverted Q3 into the AND inputs.

Which LOGO! special function replaces a "pulsing relay" for blinking an indicator?

Use the "Asynchronous pulse generator" (labeled "Bl" or "Clock generator" in older palettes). Set T_h (high time) and T_l (low time) on its parameters dialog — for example 500 ms ON / 500 ms OFF for a 1 Hz blink — and wire its Enable input to the state where blinking should occur.

What is the difference between RS and SR latching relay variants on LOGO!?

RS is reset-dominant: if both S and R are HIGH simultaneously, Q stays LOW. SR is set-dominant: if both are HIGH, Q stays HIGH. Use RS for safety-style stops where a fault must override the start signal; use SR for one-way progression where the start must latch even if a stop briefly toggles.

Can the cycle survive a power failure and resume where it left off?

Yes — enable Remanence on the latching relays (B01, B02) and on the timers (B05, B09) by checking the /R box in each block's parameter dialog. Without remanence, all volatile blocks reset on power-up and the program returns to IDLE, which is usually the safest behavior.

My Q3 output is the inverse of what I expect — what is wrong?

Check whether your LOGO! variant has relay outputs (R suffix, e.g., 6ED1052-1HB08-0BA0) or transistor outputs (no R, e.g., 6ED1052-1MD08-0BA0). Relay outputs are dry contacts and are not inverted — Q3 directly drives the contact when HIGH. Transistor outputs source +24 V when HIGH. Also verify in Soft Comfort's online monitor that the SF block's Q output is wired to the terminal driver, not accidentally fed back into its own S input.

Back to blog