Troubleshooting
Why WinCC Start and Stop buttons do not control an S7-300 output
Short answer
The Start and Stop buttons do nothing because E0.0 and E0.1 are S7-300 input image addresses: the CPU refreshes them from the input modules every scan, so an HMI write cannot survive. Step 7 simulation changes the simulated input state itself, which is why the LED follows it. Move the two commands to memory bits such as M0.0 and M0.1, latch them in the PLC, and let the program drive A4.0.
On this page
Your Start and Stop buttons do nothing because E0.0 and E0.1 are S7-300 input image addresses. The CPU refreshes the input image from the modules at the start of every scan, so a write that WinCC lands there is overwritten at the next update — at best your logic glimpses it for part of one scan. Step 7 simulation looks like it works because it changes the simulated input state itself, which the image then copies in; it proves your logic, never the write path. Move the two commands to writable memory bits such as M0.0 and M0.1, latch them in the PLC, and let the program alone drive A4.0. This is the same root cause as why an HMI toggle switch cannot write a physical PLC input, seen here on an S7-300 with a WinCC 6.0 runtime.
Why the LED follows simulation but not the buttons #
An S7-300 runs on process images. At the start of each cyclic scan the operating system copies the state of the input modules into the input image, and the program then reads and writes image addresses, not terminals. On the S7-300 and S7-400 you can assign each I/O address to the OB1 process image or to a partition, PIP 1 through PIP 15 — but every one of those images is filled from the modules, so none of them turns an input into something a panel can operate.
When WinCC writes E0.0, the value sits in the image copy until the next update restores whatever is on the terminal, which is 0 in your project because no field device drives those inputs. Simulation is a different path: changing the status of E0.0 in Step 7 simulation changes the input state the CPU then copies in, so the LED responds.
Direct peripheral access exists beside the image — reading a channel's live value, or writing an output ahead of the image — but it never makes an input writable from outside the CPU.
In the German notation this project uses, E marks inputs and A marks outputs; the same bits appear as I0.0, I0.1 and Q4.0 in English tools. Address syntax carries its own traps on the HMI side, which is the subject of how to address S7 PLC outputs in a WinCC Flexible tag.
Move the commands out of the input image #
On the WinCC side, make these changes:
- Create two writable command tags of type BOOL on the S7-300 connection the project already uses: M0.0 for Start and M0.1 for Stop, or two bits in a data block. Memory bits and DB bits are the only clean targets, because the CPU never refreshes them from hardware.
- Point the Start button's write at the Start tag and the Stop button's write at the Stop tag. For a start/stop pair, set the bit on press and clear it on release — momentary operation, with the run state held by a latch in the PLC.
- Leave the LED tag on A4.0 as a display tag, and make nothing on the panel write it.
- Set aside the suspicion that the external function setbitTag is not operating: whatever fires at the button, its target is an address the CPU overwrites, so swapping the function changes nothing. Check only that each button carries a write event at all, because a button with no event fails silently.
Drive A4.0 from the command bits in Step 7 #
Replace the logic that watched E0.0 and E0.1 with a latch: Start sets a run bit, Stop resets it, and the run bit drives A4.0. Put the reset after the set, so Stop wins on any scan where both commands are true, and treat that priority as a deliberate choice rather than an accident of rung order. The same two-command latch is what you build when the signals arrive as hardwired level switches instead of HMI bits; latching two level inputs for pump start and stop control covers that wiring-side version.
An HMI stop button is an operator command, not a safety function: emergency stop and protective interlocks stay in the controller and the hardwired safety chain, never behind a panel screen.
Worked example: moving Start and Stop from E0.0 and E0.1 to M0.0 and M0.1 #
Inputs:
- Start button tag: E0.0, from your project.
- Stop button tag: E0.1, from your project.
- LED output: A4.0, from your project, unchanged.
- Runtime: WinCC 6.0 against the S7-300, from your project.
- New command bits: M0.0 and M0.1, free choices under the rule below.
Rule in words: an HMI write survives only in memory the CPU does not refresh. Inputs are refreshed every scan, outputs are written by the program, and memory bits hold the last value placed in them.
Arithmetic, spelled out:
- E0.0 is bit 0 of input byte 0 and E0.1 is bit 1: 2 command bits in refreshed memory, so 0 writes survive an update.
- M0.0 is bit 0 of memory byte 0 and M0.1 is bit 1: the 2 commands move to static memory, leaving bits 2 through 7 of that byte free — M0.2 for the run bit if you keep the latch in the same byte.
- Edit count: 2 tag addresses in WinCC, 1 latch rung in Step 7, 0 changes at A4.0.
Result: press Start and M0.0 goes from 0 to 1 for the duration of the press, the latch sets, and A4.0 turns on; release, and M0.0 returns to 0 while the latch holds. Press Stop and M0.1 goes from 0 to 1, the latch resets, and A4.0 turns off.
Decision: the number of HMI command bits allowed in the input image is zero. Every bit a panel must set lives in M or DB memory, and the output stays owned by logic.
Prove the corrected path in runtime #
Test on the real PLC with the panel, because simulation changes input states and hides exactly the fault you are fixing:
- At start: M0.0 = 0, M0.1 = 0, run bit = 0, A4.0 = 0.
- Press Start: M0.0 = 1 while held, run bit = 1, A4.0 = 1. Release: M0.0 = 0, and the run bit and A4.0 hold at 1.
- Press Stop: M0.1 = 1 while held, run bit = 0, A4.0 = 0. Release: M0.1 = 0, and everything stays off.
- Press both together: Stop wins, because the reset is evaluated last.
Watch the two command bits and the run bit online in Step 7 while someone works the panel, and check the LED object in runtime for A4.0.
If the LED still does not respond #
Split the failure at the command bit:
- M0.0 never moves when you press: the button has no write event, the tag points at the wrong address or connection, or the runtime is not talking to this CPU. The newer WinCC generation has its own version of this failure, and why a WinCC Professional button does not write to the PLC walks the same checks.
- The command bits move but the run bit does not: another rung or block writes the same memory bit, the scan order puts a reset ahead of your set, or the WinCC address and the Step 7 operand do not match.
- The run bit sets and A4.0 = 1 in the program but the physical LED stays dark: the fault is downstream of the CPU — the output module mapping in the hardware configuration, the channel wiring, or the supply to the lamp.
Questions asked
Why does changing E0.0 in Step 7 simulation work when the WinCC button does not?
Forcing changes the input state that the CPU copies into the image, so the program sees it on every scan. A WinCC write lands in the image copy after an update and is erased by the next one. The two paths touch the same address, which is why they look interchangeable, but only one of them survives the scan.
Can I write A4.0 directly from the buttons instead?
You can write an output image bit from the panel, but do not build start/stop that way. The PLC logic and the HMI would fight over A4.0 every scan unless you delete the logic, and then the run state lives only as long as the panel and its connection do. Keep outputs owned by the program and give the panel command bits.
Should the buttons be momentary or maintained?
Momentary, with the latch in the PLC. Set the bit on press and clear it on release, and let the set/reset latch hold the run state between presses. Maintained buttons belong on functions that should follow the button itself, such as jog or lamp test, not on a start/stop pair where the machine must keep running after you let go.
Are DB bits better than Merkers for HMI commands?
Both work; choose by project structure. Memory bits need no extra block and are the quickest fix on an S7-300. DB bits group the commands with the rest of the machine data, which pays off as screens multiply. The rule does not change either way: the target must be a bit the CPU does not refresh, never an input image address.