1. Problem Overview
The reported symptom occurs on a Siemens LOGO! 8 modular logic relay (firmware ES8 or ES9) configured in TIA Portal V16 or later, paired with a touch-only 4-inch HMI panel (the user describes it as a "TP400 keyless"; in practice this is a SIMATIC KTP400 Basic mono PN or color PN, since Siemens does not market a panel literally named TP400). The functional requirement is:
- The operator presses an HMI button to start a machine.
- The button must remain logically active in the LOGO! until a configured wall-clock time (e.g., 21:00 local).
- After that time, the LOGO! must stop the machine and visually disable the HMI button so the operator sees the system is no longer allowed to run.
The reported symptom: after the LOGO! writes a logical "0" to a network output (NQ) intended to disable the HMI button, the corresponding network input (NI) in the LOGO! stays HIGH. From the operator's perspective the button is "stuck on" in the LOGO!, even though the LOGO! has reported the machine is OFF and the button has visually greyed out on the screen.
2. Affected Hardware and Firmware
| Component | Catalog Number | FW Version | Notes |
|---|---|---|---|
| LOGO! 8.3 base module (12/24 RCE) | 6ED1052-1MD08-0BA1 | ES8 (≥ V1.08.x) | 24 V supply, 8 DI / 4 DO relay |
| LOGO! 8.3 base module (24 CE) | 6ED1052-1AD08-0BA1 | ES8 | 24 V supply, transistor outputs |
| LOGO! 8.4 base module (230 RCE) | 6ED1052-1FB08-0BA2 | ES9 (≥ V1.09.x) | 230 V supply, relay outputs |
| LOGO! 8.4 base module (12/24 RCEo) | 6ED1052-2MD08-0BA2 | ES9 | No display, Ethernet |
| LOGO! TDE text display | 6ED1055-4MH08-0BA1 | n/a | External display, Ethernet |
| KTP400 Basic mono PN | 6AV2123-2DB03-0AX0 | ≥ V14.0.x | 4" mono touch-only, no keys |
| KTP400 Basic color PN | 6AV2123-2DS03-0AX0 | ≥ V14.0.x | 4" color touch-only, no keys |
| KTP400 Comfort | 6AV2124-1DC01-0AX0 | ≥ V15.1.x | 4" wide-screen touch-only |
3. System Architecture and Tag Mapping
The LOGO! 8 exposes its I/O to the Ethernet network as virtual tags called Network Inputs (NI) and Network Outputs (NQ). The HMI reads/writes these tags through a LOGO! 8 connection in TIA Portal. The default address space for a base module is:
| Symbolic Tag | Range | Type | Direction |
|---|---|---|---|
| Network Input BOOL | NI1 … NI64 | BOOL | HMI → LOGO! |
| Network Output BOOL | NQ1 … NQ64 | BOOL | LOGO! → HMI |
| Network Input Word | NIW1 … NIW32 | INT | HMI → LOGO! |
| Network Output Word | NQW1 … NQW32 | INT | LOGO! → HMI |
| Network Input Analog | NIA1 … NIA16 | REAL / INT | HMI → LOGO! |
| Network Output Analog | NQA1 … NQA16 | REAL / INT | LOGO! → HMI |
The exact byte and bit layout is configured per project in TIA Portal under LOGO! device → Properties → Network Inputs / Network Outputs. Each LOGO! 8 base module supports up to 64 NIs and 64 NQs; the HMI references these tags symbolically as LOGO!_1.NI1, LOGO!_1.NQ1, and so on, in the HMI tag table. Expansion modules add physical I/O only; they do not enlarge the NI/NQ pool unless explicitly mapped via UDFs.
4. Root Cause: Bidirectional Tag Loop
The "stuck HIGH" symptom has a single, deterministic cause: the HMI button is configured as a maintained (latching) switch that writes its own state back to the same network input that the LOGO! uses to monitor the request. The data flow on every PLC scan looks like this:
- The operator presses the HMI button.
- The HMI tag StartCmd (BOOL) is set TRUE by the HMI button's Press event.
- The same tag is wired to LOGO!
NI1(StartCmd → NI1). - LOGO! reads NI1 = TRUE, sets internal latch B001 TRUE, drives NQ1 (Status) TRUE, and starts the time check.
- After 21:00 the LOGO! sets B001 FALSE and drives NQ2 (ButtonEnable) FALSE.
- The HMI receives NQ2 = FALSE and visually greys the button (the Disable animation works correctly).
- BUT: the HMI button is configured as a "Switch", so its internal Pressed flag is still TRUE because the operator never released it (or because the tag's last-written value persists in the HMI tag table).
- On every acquisition cycle the HMI continues to write the held TRUE value back to NI1.
- LOGO! sees NI1 = TRUE again on the next scan and re-asserts B001.
The result is a logical short-circuit: the LOGO! can turn its outputs off via NQ, but it has no authority over the NI because the NI is sourced from the HMI. The disable signal (NQ2) only controls appearance, not value. The HMI has no reason to write 0 because no Release event has occurred.
5. Diagnostic Procedure
Before changing any program, confirm the loop is present using TIA Portal's online functions:
- Go online with the LOGO! project in TIA Portal.
- Switch the LOGO! program editor to Monitor mode.
- In the LOGO! online test table, force NQ2 (the disable signal) to TRUE.
- Observe NI1 in the same online table. If NI1 remains TRUE while NQ2 = TRUE, the loop is confirmed.
- Disconnect the HMI Ethernet cable at the switch. If NI1 drops to FALSE immediately, the HMI is the source of the held HIGH.
- Reconnect the cable and place the LOGO! into STOP mode. NI1 must drop to FALSE; if it does not, check the HMI's PLC tag table for a forced or initial value.
Verify the HMI button configuration:
- In WinCC (TIA Portal), open the screen containing the Start button.
- Open the button's Properties → Events.
- A "SetBit" tag with no corresponding "ResetBit" on the Release event is a maintained write.
- Under Properties → General → Mode, a value of "Switch" with only Switch on press enabled behaves as a latched write.
6. Solution A — Decouple the Press Pulse from the Enable Bit
The recommended fix splits the HMI tag space into three independent tags: a momentary press tag, a status display tag, and an enable tag driven by the LOGO! time check.
6.1 New Tag Map
| HMI Tag (LOGO! symbol) | Direction | Type | Purpose |
|---|---|---|---|
| HMIBtnPress → NI1 | HMI → LOGO! | BOOL | Single-cycle pulse on button press |
| MachineStatus ← NQ1 | LOGO! → HMI | BOOL | 0 = OFF, 1 = ON (indicator lamp) |
| BtnEnable ← NQ2 | LOGO! → HMI | BOOL | 1 = button operable, 0 = button greyed |
| TimeRemain ← NQA1 | LOGO! → HMI | REAL | Minutes remaining until shutdown |
6.2 LOGO! Program (FBD)
- Insert B001 (RS flip-flop, Reset dominant). Set = NI1 (positive-edge-detected). Reset = B005.Q.
- Insert B002 (RS flip-flop, Reset dominant). Set = B004.Q. Reset = B005.Q.
- Insert B003 (OR gate). Inputs: B001.Q and NOT B002.Q. This is the master "machine running" signal.
- Insert B004 (Weekly Timer). Configuration: Mo, Tu, We, Th, Fr, Sa, Su all ON. ON time = 00:00:00. OFF time = 20:59:59. This defines the legal-run window.
- Insert B005 (Weekly Timer, pulse). Configuration: same days. ON time = 21:00:00. OFF time = 21:00:30. This gives a 30-second shutdown pulse.
- Drive NQ1 = B003.Q (status to HMI). Drive NQ2 = B002.Q (enable to HMI). Drive NQA1 from a Math block that subtracts the LOGO! RTC hour from 21.
The key is that NI1 is treated as a momentary event. After B001 latches ON, NI1 can return to 0 without affecting state. B002 latches itself OFF at 21:00 and forces B003 low, which forces NQ1 and NQ2 low. Because B002's reset is dominant, any stray NI1 pulse after 21:00 cannot restart the machine.
6.3 HMI Configuration
- Select the Start button in WinCC.
- Under Properties → General → Mode, set Mode = Button (not "Switch").
- Under Events → Press, add a SetBit function on tag HMIBtnPress (i.e., NI1).
- Under Events → Release, add a ResetBit function on the same tag. This guarantees the tag returns to 0 even if the operator slides off the screen.
- Under Properties → Animations → Appearance, bind the "Disable" property to tag BtnEnable. The button greys when BtnEnable = 0.
- Under Properties → Animations → Color on a separate lamp object, bind the fill color to MachineStatus: green for 1, grey for 0.
With this wiring the HMI never holds NI1 high after the operator releases the button. The LOGO! owns the run-state latch and overrides any subsequent press by ignoring it once BtnEnable = 0.
7. Solution B — Single-Tag Latch with Edge Detection Only
If splitting tags is undesirable (e.g., the HMI project is locked under version control and cannot be re-tagged), keep a single tag and force the LOGO! to interpret only the leading edge as valid:
- Wire NI1 directly to the Set input of a reset-dominant RS flip-flop B001.
- Wire the Q output of B001 to a positive-edge detector block (LOGO! B007, parameter "Edge" = Rising).
- Wire the Q output of the edge detector through a 100 ms ON-delay (B008) and OR it back to the Set input of B001. This gives a 100 ms re-trigger window so the HMI always sees the button as a momentary write.
- Wire the Reset input of B001 to the 21:00 timer pulse (B005).
This approach keeps the tag count to one but creates a 100 ms re-trigger window during which a stuck HMI write could re-arm the latch. It is suitable only for non-critical loads (lighting, ventilation, signage). Do not use it for machinery where repeated re-trigger is a safety hazard.
8. Configuration Reference Tables
| LOGO! Block | Function | Parameter Setting | Notes |
|---|---|---|---|
| B001 | RS flip-flop (Reset dominant) | Set = NI1 (edge), Reset = B005.Q | Holds machine run state |
| B002 | RS flip-flop (Reset dominant) | Set = B004.Q, Reset = B005.Q | Holds enable state |
| B003 | OR (with inverter) | Inputs = B001.Q, NOT B002.Q | Master "running" signal |
| B004 | Weekly Timer | Mo-Su ON, 00:00:00 – 20:59:59 | Legal-run window |
| B005 | Weekly Timer (pulse) | Mo-Su ON, 21:00:00 – 21:00:30 | 30-second shutdown pulse |
| B006 | Analog Arithmetic | Inputs = RTC hour, Const 21.0 | Hours remaining |
| B007 | Edge detector | Edge = Rising | Cleans bounce on NI1 |
| B008 | On-delay | TH = 100 ms | Re-trigger window |
| HMI Object | Property | Binding | Effect |
|---|---|---|---|
| StartButton | Mode = Button | — | Press sets, Release clears |
| StartButton | Events → Press | SetBit(NI1) | Triggers leading edge |
| StartButton | Events → Release | ResetBit(NI1) | Ensures 0 after release |
| StartButton | Animations → Disable | NQ2 = 0 | Grey-out after 21:00 |
| StatusLamp | Animations → Color | NQ1 | Green = ON, Grey = OFF |
| TimeLabel | Output field | NQA1, format "%.0f min" | Shows shutdown ETA |
9. Verification Procedure
- Download the modified LOGO! program and the modified WinCC project to the devices.
- Set the LOGO! internal RTC to a time 30 minutes before 21:00 via LOGO! Soft Comfort → Tools → Set Clock (or via the LOGO! menu if the base module has a display).
- Press the Start button on the HMI. Confirm:
- NI1 pulses TRUE once and returns FALSE on Release.
- B001.Q latches TRUE.
- NQ1 (MachineStatus) is TRUE; NQ2 (BtnEnable) is TRUE.
- The machine output (e.g., Q1 physical relay) is energized.
- Set the LOGO! RTC to 21:00:31 (past the shutdown pulse). Confirm:
- B005.Q pulses for 30 s, then goes low.
- B002.Q resets to FALSE.
- B003.Q drops to FALSE.
- NQ1 = FALSE, NQ2 = FALSE.
- The Start button greys on the HMI.
- Pressing the button has no effect on B001.Q (the reset-dominant latch holds).
- Set the LOGO! RTC back to 12:00. Confirm NQ2 returns TRUE and the button becomes operable again.
- Disconnect and reconnect the HMI Ethernet cable. Confirm NQ1, NQ2, and the LOGO! outputs retain their last values (the LOGO! retains state across short comms loss; the HMI re-syncs on reconnect).
- Cycle power on the LOGO! (with battery installed). Confirm B001 retains its last state. Without a battery the state resets; verify behavior matches the safety case.
10. Troubleshooting Matrix
| Symptom | Likely Cause | Diagnostic Step | Remediation |
|---|---|---|---|
| NI1 stays HIGH after operator release | HMI button is configured as a maintained switch | Inspect button properties in WinCC | Change Mode = Button; add Release event with ResetBit |
| Button greyed but machine still runs | B003 wired as OR instead of OR-with-inverted-reset | Monitor B003 inputs online | Use OR with inverted B005.Q on the second input |
| Button operable but no machine start | LOGO! is in STOP or has a fault | Check LOGO! display for "STOP" or red error LED | Switch to RUN; clear fault via menu |
| Time does not advance | LOGO! RTC battery low or never set | Tools → Set Clock in LOGO! Soft Comfort | Replace CR2032 battery; re-set time and date |
| HMI shows "Connection Failed" | Wrong IP or subnet mask | Verify IP in HMI Control Panel → Network | Set HMI to 192.168.0.10/24, LOGO! to 192.168.0.20/24 |
| BtnEnable toggles randomly | B004 weekly timer has wrong day mask | Open B004 in Monitor; check Q bit | Set Mo, Tu, We, Th, Fr, Sa, Su all to ON |
| Machine restarts at midnight | B005 pulse window is inverted (covers 21:00 – 23:59) | Verify B005 ON/OFF times | Set B005 to pulse only at 21:00 for 30 s, not later |
| HMI shows stale values after cable re-plug | HMI tag update rate is too low | Check PLC tag acquisition cycle in HMI tags | Set acquisition mode = "Cyclic continuous", cycle = 500 ms |
| Browser and HMI both write NI1 | LOGO! web server is read/write-enabled | Check Tools → Web Server Access | Set web server to read-only or use distinct NIs per client |
| B001 does not survive power cycle | Latch not marked retentive | Open B001 properties | Set "Retentive = ON" for B001 and B002 |
11. Edge Cases and Field Notes
Daylight Saving Time: The LOGO! RTC does not auto-adjust for DST. After the spring or autumn clock change, the 21:00 trigger will occur at the wrong wall-clock time for one day. Either compensate in B004/B005 by adjusting the configured times twice a year, or add an offset block fed by a calendar pulse. Refer to the LOGO! 8 system manual for RTC behavior details.
Power loss: The LOGO! 8 retains the RS latch state across short power outages only if the optional CR2032 battery is installed in the base module. Without a battery, all NIs and NQs default to 0 on power-up. If you need the machine to restart automatically after a brownout, mark B001 retentive (Properties → Retentive = ON) and verify the safety case permits unattended restart.
Multiple operators: If more than one HMI or web client is configured, ensure all clients write to the same NI tag; otherwise NI1 will receive simultaneous writes and the edge detector will see a race condition. Use a single master HMI, or implement a token-passing scheme via NQ tags where only the client holding the token can write.
LOGO! 8.2 vs 8.3 / 8.4: The number of weekly timers increased from 4 to 8 between firmware ES7 and ES8. The program above uses only 2 weekly timers, 2 flip-flops, and 2 auxiliary blocks, well within the limits of every LOGO! 8 variant.
Web server: The LOGO! 8 built-in web server (port 80) exposes the same NI/NQ tags via HTTP. If the operator uses both an HMI and a browser, both will write to NI1. Set the web server to read-only mode under Tools → Web Server Access to prevent the browser from competing with the HMI, or use separate NIs per client.
LOGO! Soft Comfort version: Projects using the UDF (User-Defined Function) feature require LOGO! Soft Comfort V8.3 or later to compile. Plain FBD as shown in Section 6 compiles on V8.0+. Online help for the editor is in the LOGO! Soft Comfort documentation.
KTP400 Basic limitations: KTP400 Basic panels (firmware V14.x) do not support VBScript or C scripts. All logic must be implemented through tag animations and event-triggered tag writes in the HMI configuration, and any state-holding logic must live in the LOGO!. The KTP400 Comfort does support scripts but is not required for this fix. See the KTP400 Basic operating instructions for the supported event list.
Alternative HMI panels: If the project later moves to a TP700 Comfort, TP900 Comfort, or TP1200 Comfort, the same NI/NQ tag bindings work unchanged. Only the screen designer and the available animation set differ. The decoupling architecture in Section 6 is portable across the entire SIMATIC HMI Comfort and Basic range.
Why does my LOGO! network input stay HIGH after the HMI button is "disabled"?
Because the HMI is the source of the input. A LOGO! network output only changes the HMI's display or animation; it cannot write back to its own network input. If the HMI button is a maintained switch, the HMI keeps writing 1 to NI. Fix by configuring the button as a momentary (Mode = Button) and adding a Release event with ResetBit, or by having the LOGO! latch the state internally on a leading edge.
What is the difference between Mode = Switch and Mode = Button in WinCC?
Switch toggles a tag on every press and writes the same value back (maintained). Button writes 1 only while the finger is on the screen; if you add a Press and Release event pair, the tag is set on press and reset on release (momentary). For LOGO! inputs that need a controlled leading edge, always use Button mode with explicit Press and Release events wired to the same NI.
How many network inputs does a LOGO! 8 expose to the HMI?
A LOGO! 8 base module exposes 64 BOOL network inputs (NI1–NI64), 64 BOOL network outputs (NQ1–NQ64), 32 INT network input/output words, and 16 REAL network analog inputs/outputs. The exact range visible to the HMI is configured under the LOGO! device properties in TIA Portal and may be reduced for acquisition-bandwidth reasons.
Can a KTP400 Basic run scripts to solve this without changing the LOGO! program?
No. KTP400 Basic panels (firmware V14.x) do not support VBScript or C scripts. All logic must be implemented through tag animations and event-triggered tag writes in the HMI configuration, and any state-holding logic must live in the LOGO!. The KTP400 Comfort does support scripts but is not required for this fix.
How do I retain the machine state across a power outage?
Install a CR2032 backup battery in the LOGO! 8 base module and set the run-state RS flip-flop to retentive (parameter "Retentive = ON" on B001). Without a battery, all latches and the RTC reset to 0 on power-up, and the machine will require a manual restart after any power loss. Verify the safety case permits unattended restart before enabling retentive behavior on machinery.