Overview
A three-position selector (OFF / AUTO / MANUAL) is one of the most common operator interfaces on a heating, ventilation, irrigation, or pump control panel. On a Siemens LOGO! 8 (6ED1052-1xx08-0BA0 series) the standard hardware approach is a 3-position cam switch wired to two digital inputs. That gives unambiguous position decoding and survives a wire break because the controller reads the state as INVALID and forces the load off.
This reference documents the alternative demanded when only a single input is physically available: a momentary push-button that cycles OFF → AUTO → MANUAL → OFF on each press. A counter block, an on-delay debounce, and three exclusive state flags implement the state machine. A second implementation shows the two-input safe selector. Both are written in FBD inside LOGO!Soft Comfort V8.3 / V8.4 and download to LOGO! 8.3 firmware 1.82.x or later. The remote visibility portion uses the LOGO! Web Editor / LOGO! App and a single-line Message Text so the operator sees one stable line: Mode: AUTO.
Prerequisites
| Item | Specification |
|---|---|
| Controller | Siemens LOGO! 8 BM, e.g. 6ED1052-1MD08-0BA0 (LOGO! 8.3 12/24 RCE) |
| Firmware | LOGO! 8.3 ≥ 1.82.x; 8.4 (6ED1052-2xx08) recommended |
| Engineering | LOGO!Soft Comfort V8.3 (6ED1058-0BA08-0YA1) or V8.4 |
| Display option | LOGO! TDE 6ED1055-4MH08-0BA0 or onboard BM display |
| Push-button | 1 NO contact, mechanical or capacitive, IP65 minimum |
| Load switching | Q1 relay output, 10 A resistive / 3 A inductive at 240 V AC |
| Remote view | LOGO! App for iOS / Android, or any browser pointing at the LOGO! Web Editor |
Refer to the LOGO! 8 system manual (Siemens entry ID 109751654) for electrical specifications and to the LOGO!Soft Comfort V8.3 online help (entry 109751655) for block parameter details.
State Machine: One Input, Three States
The single push-button is wired to digital input I1. Each falling edge of I1 increments an Up/Down counter. The counter modulus is 3, so the values cycle 0 → 1 → 2 → 0. Three comparators decode the counter value into mutually exclusive flags S_OFF, S_AUTO, S_MAN. Because the flags are decoded from one integer, exactly one is true at any time, which is the property required to drive a single text line without flicker.
| Counter value | Flag | Operator meaning | Q1 (heater) |
|---|---|---|---|
| 0 | S_OFF | Load forced off, no automatic regulation | 0 |
| 1 | S_AUTO | Thermostat input I2 drives the load | = I2 |
| 2 | S_MAN | Load forced on, operator override | 1 |
Decoding arithmetic uses the integer counter CV directly. Comparator B001 fires when CV = 0 (OFF), B002 when CV = 1 (AUTO), B003 when CV = 2 (MANUAL). The Q output of the matching comparator latches for the entire time the counter holds that value.
Counter / Debounce Wiring in FBD
The full network fits in a single diagram page of LOGO!Soft Comfort. The blocks required are: one Up/Down counter (B004 in the local block address space), one On-delay (B005), three Analog comparator / Threshold trigger blocks (B001, B002, B003), and one OR gate to build the heater output.
Network 1 — Debounce and count
I1 ──[ B005 On-delay 1.0 s ]──(edge)──┐
├──> B004 Cnt (Up, threshold = 0)
I2 (clear, optional) ─────────────────┘──> B004 R
Network 2 — Decode state
B004.CV ──┬─> B001 thr= 0 ──> S_OFF
├─> B002 thr= 1 ──> S_AUTO
└─> B003 thr= 2 ──> S_MAN
Network 3 — Build Q1 (heater)
S_AUTO AND I2 ──┐
├──> Q1 (relay output)
S_MAN ──────────┘
The On-delay B005 enforces a 1.0 s minimum spacing between valid button presses. The same timer serves as a debouncer for contact bounce (typical 5–20 ms) and as a guard against accidental double-taps. The internal block address B005 is shown here because it is the convention used in LOGO!Soft Comfort when the user does not rename blocks; the address is not significant to the logic and may be reassigned by the compiler.
Converting Counter Value to Output
The user's original sticking point — "I hit a wall when I tried to convert a counter value into an output" — is solved by recognising that the Up/Down counter block already exposes its current value on CV. The output conversion is therefore not an arithmetic step but a decoding step: do not try to write the integer 0/1/2 directly to a digital output. Instead, route the value through comparators so that one comparator per state becomes a boolean flag. Boolean flags drive boolean outputs without type mismatch.
| Common mistake | Why it fails | Correct alternative |
|---|---|---|
| Wire counter CV directly to Q1 | CV is an integer, Q1 is a boolean — LOGO!Soft Comfort throws a type error or coerces to a 24 V analog signal | Decode CV with three threshold comparators and AND the chosen flag with the actual load condition |
| Use a single comparator with adjustable threshold | The threshold is a global parameter; the program cannot change it from another block | Use three fixed comparators or a single analog multiplexer feeding one comparator |
| Drive Q1 from the counter pulse output | The pulse is one cycle wide; the load drops as soon as the next PLC scan starts | Latch the comparator output in an RS flip-flop, or — as in the network above — let the flag persist while the counter holds the value |
Single-Line Text Display
The complaint that the three states "move around" comes from a layout mistake: three separate Message Text blocks, each enabled by its own flag, are stacked at the same Y-position in the display editor and shift position when the active one changes. The fix is to keep three Message Text blocks but anchor them at three different Y-positions, or — preferred — use one Message Text block whose enable condition is a priority encoder that activates exactly one message at a time.
Network 4 — Priority encoder for one stable line
S_OFF ──> M1 enable (text = "Mode: OFF ")
S_AUTO ──> M2 enable (text = "Mode: AUTO ")
S_MAN ──> M3 enable (text = "Mode: MANUAL")
M1, M2, M3 share the same Y-line on the LOGO! TDE
Because the three flags are decoded from a single counter, the priority encoder is implicit: only one enable is ever high. The TDE / on-board BM shows the active message on a single line; the line does not shift. For visualisation, place the line at Y = 2 of the TDE (counted from the top) and add a bar graph on Y = 4 showing 0 %, 50 %, 100 % corresponding to OFF / AUTO / MANUAL. The bar graph uses a single Message Text with bar block driven by the integer counter CV multiplied by 50 to give the 0 / 50 / 100 % range.
State: AUTO as a string — set the variable display format to Bar + Text in the project's variable table.Wire-Break Detection and Safety
A break in the I1 conductor is electrically indistinguishable from the button being open. With a 24 V DC input the simplest detector is a 10 kΩ pull-down resistor in parallel with the contact, and a 1.5 kΩ pull-up to 24 V through a 4.7 kΩ current-limiting resistor; the resulting analog voltage at I1 is monitored by an AI in the LOGO! 8 base module (AI1 on the 12/24 RCE variant). Configure AI1 in the LOGO!Soft Comfort variable table as 0–10 V. A wire break drops the analog reading below 0.3 V, well below the 1.0 V threshold comparator B010, which then forces S_OFF and asserts the system fault flag F_WIRE. The fault flag is latched and must be cleared by a deliberate key press on the TDE or via the LOGO! App.
For installations where the analog input is already in use, an alternative is to add a second digital input I3 wired in parallel through a 100 kΩ resistor. A closed contact pulls both I1 and I3 high; a wire break pulls neither. A NOR of I1 and I3 yields F_WIRE. The disadvantage is that the operator can no longer claim a "single input" topology — at that point, switch to the two-input safe selector described next.
Alternative: Two-Input Three-Position Selector
The two-input topology is the recommended baseline. Wire a 3-position cam switch with the common pole to 24 V and the OFF / AUTO / MANUAL throws to I1 and I2. Three input combinations are valid, the fourth is reserved as the fault state.
| I1 (OFF contact) | I2 (AUTO contact) | Decoded state | Q1 (heater) | F_INVAL |
|---|---|---|---|---|
| 1 | 0 | S_OFF | 0 | 0 |
| 0 | 1 | S_AUTO | = thermostat I3 | 0 |
| 0 | 0 | S_MAN | 1 | 0 |
| 1 | 1 | INVALID | 0 (forced off) | 1 — latched |
The decoded state is built from a 2-to-4 line decoder built from a single LOGO! AND + OR network, or more concisely by routing (I1, I2) through a custom UDF that returns the state as an integer 0/1/2/3. With this topology a wire break manifests as 0/0 and the operator sees a permanent MANUAL state with the fault flag asserted, which the dispatcher should treat as a fail-safe condition. The Q1 output is forced off whenever F_INVAL is high, regardless of the decoded state, satisfying SIL-1 style behaviour for non-critical loads.
Mobile App and Remote Visibility
The LOGO! 8 base module ships with an integrated Ethernet port and a built-in Web Editor. The LOGO! App for iOS / Android is configured by scanning the QR code shown on the TDE or by entering the controller's IP address. The mode variable S (an integer 0/1/2) is exposed in the project's variable table and can be assigned a custom name Mode with a custom string list. The App renders the value as a drop-down; selecting AUTO remotely writes the integer 1 to the variable, and the state machine increments the counter on the rising edge of Mode_remote_changed. The remote write and the push-button share the same counter, so the operator on site and the operator on the phone see identical state.
For full remote control rather than just remote view, expose the push-button function as a Network Input NI1. The App dashboard widget Pulse button writes a one-cycle pulse to NI1, which is then OR'd with the physical I1 inside the LOGO!. The counter increments identically for a local press or a remote press.
Commissioning and Verification
- Power the LOGO! with the I1 input open. The TDE should display
Mode: OFFand Q1 should measure 0 V at the load terminals. - Press and release the push-button once. After 1.0 s (B005) the display must change to
Mode: AUTO. Apply 24 V to I2 (thermostat). Q1 should track I2 with the same polarity. Remove I2 — Q1 must drop to 0. - Press the button a second time. Display changes to
Mode: MANUAL. Q1 must read 230 V (or 24 V depending on the BM variant) at the load terminals, independent of I2. - Press a third time. Display must return to
Mode: OFFand Q1 must drop. Confirm there is no flicker between modes by holding the button for 5 s; the debounce timer must keep the state stable. - Disconnect the I1 wire. Display stays on the last valid state and
F_WIREshould assert within one scan (≤ 100 ms on a 0.0 cycle time). Q1 must drop immediately if the system is configured fail-safe, or hold the last state if the operator has acknowledged the fault. - From the LOGO! App, send a remote pulse to NI1. The display should advance by one state and the App dashboard should reflect the new Mode value within 500 ms.
- Run the panel for 24 h on a chronometer to confirm no spurious state changes. A correctly debounced design shows zero state changes without operator action.
Troubleshooting Matrix
| Symptom | Likely root cause | Corrective action |
|---|---|---|
| State advances twice on a single press | Contact bounce faster than B005 debounce (rare on quality switches, common on 24 V reed switches) | Increase B005 to 1.5 s; add a hardware RC filter 100 Ω + 100 nF at the input terminal |
| State does not advance at all | Counter configured as Down, or threshold value forces reset | Open the B004 properties in LOGO!Soft Comfort and set Count direction = Up, threshold = 0 (infinite count) |
| Display flickers between two messages | Two Message Text blocks anchored at the same Y-position, both enabled | Use the priority encoder network, or place the three texts at three different Y-positions and accept the layout shift |
| Counter resets to 0 on power cycle | Remanence not enabled on the Up/Down counter block | Open B004 → Remanence → enable CV = 0 retains across power cycles. Available on LOGO! 8 only; LOGO! 6 and 7 require a battery option |
| Q1 chatters when I2 toggles in AUTO | AUTO state is not gated by the thermostat flag; the comparator fires while the counter is in transition | Insert a 200 ms On-delay between the S_AUTO flag and the Q1 AND gate, or use S_AND = S_AUTO AND NOT(transition_pulse) |
| LOGO! App shows stale Mode value | Variable Mode not declared as a Network Output, or polling interval set to > 5 s | Open variable table → set Access = Network read/write, reduce App polling to 1 s |
| Wire-break fault does not assert | Analog input configured as digital in the variable table, threshold comparator not enabled | Reconfigure AI1 as 0–10 V, add threshold trigger B010 with on=1.0 V, off=0.3 V |
Specifications and Limits
| Parameter | Value |
|---|---|
| Debounce time B005 | 0.5 – 2.0 s recommended; 1.0 s default |
| Counter range | 0 – 999,999 (16-bit signed in CV) |
| State cycle time (one full revolution) | 3 button presses, minimum 3 × 1.0 s = 3.0 s |
| Scan cycle on LOGO! 8.3 | typ. 0.6 ms / 200 blocks, max 8 ms with 400 blocks |
| Wire-break detection threshold | 0.3 V (release) / 1.0 V (trigger), AI1 configured 0–10 V |
| Number of Message Text blocks supported | 50 on LOGO! 8 (was 32 on LOGO! 6/7) |
| Web Editor concurrent users | 3 read, 1 write |
| LOGO! App polling | 250 ms minimum, 5 s default, 1 s recommended for state feedback |
| Operating temperature | 0 – 55 °C (BM), 0 – 50 °C (TDE) |
| Approvals | CE, UL 508, cUL, FM Class I Div 2, ATEX zone 2 (6ED1052-1MD08-0BA0) |
For a complete list of block counts, remanent flags, and program-size limits, see the LOGO! 8 system manual (Siemens support entry 109751654). For firmware release notes and known issues affecting counter and Message Text blocks, consult the LOGO! 8 firmware update history (entry 109972551).
FAQ
Can a single digital input really select three stable states on a LOGO! 8?
Yes. Wire a momentary NO push-button to I1, debounce with an On-delay (B005, 1.0 s), and feed the rising edge into an Up/Down counter (B004). Decode the counter value 0/1/2 with three threshold triggers (B001, B002, B003) to obtain the OFF, AUTO, MANUAL flags. The flags are mutually exclusive because the counter value is, so exactly one state is always active.
Why does my text display "move around" between the three modes?
Three Message Text blocks anchored at the same Y-position on the TDE will overwrite each other on the same line and appear to shift as the enable condition changes. Either move the three texts to three different Y-positions, or — preferred — use a priority encoder so only one Message Text is enabled at a time, then place the line at a fixed Y. Verify the enable condition is the decoded state flag, not the raw counter output.
How do I detect a broken wire on the single push-button?
Add a 1.5 kΩ pull-up from I1 to 24 V and a 10 kΩ pull-down to 0 V. Read the voltage on AI1 (0–10 V mode). With the button open the reading sits at about 1.4 V, with the button closed at 22 V (saturated). A wire break drops AI1 below 0.3 V. Configure a threshold trigger B010 with on-threshold 1.0 V and off-threshold 0.3 V to flag F_WIRE and force Q1 off.
Is there a safer alternative that still uses one input from the operator?
Yes. Replace the single push-button with a 3-position cam switch wired to two digital inputs (I1, I2). Three input combinations are valid, the fourth (1, 1) is a fault state. The state machine simplifies to a 2-to-4 line decoder and a fault flag is free. This is the recommended topology for any load that must be guaranteed off on cable damage, such as electric heating or three-phase motor starters.
Can the LOGO! App change the mode remotely as well as display it?
Yes. Expose the push-button function as a Network Input NI1 in the variable table and OR it with the physical I1 inside the LOGO!. Configure the App dashboard with a Pulse button widget bound to NI1. The App then increments the counter on each pulse and the state is shared between local and remote operators. Set polling to 1 s for sub-second feedback on the dashboard.