Resetting LOGO! 8.4 Analog Counter and MUX Chains to Zero
You build a chain of Siemens LOGO! Numeric Instruction (NI) blocks and analog multiplexer (MUX) blocks, press an input, and the value increments by 10 on every press. So far, so good. The instant you try to add a "reset to zero" input, the chain stops behaving. The output will not collapse back to 0, the inhibit input only switches the analog output off while the internal state remains, and copy-pasting a section of the program into a test rig makes the problem look like it has been solved even though the full project still misbehaves.
This reference walks through the exact reset logic used on the LOGO! 8.4 platform (6ED1052-xxx08-0BA2 modules) under LOGO! Soft Comfort V8.4, why the NI chain does not respond to a direct "clear" signal, and how to wire a digital input through an edge detector and a counter reset to drive every downstream block in a cascade back to zero simultaneously. It targets hobbyists building their first analog program and integrators who have inherited a half-finished project where the previous engineer relied on an obscure connection to hold the value at 0.
1. Why the Chain Will Not Reset by Itself
An NI block in LOGO! is a stateless function. It performs the configured arithmetic (add, subtract, multiply, divide, AND, OR, ABS, etc.) on whatever values appear on its inputs at scan time and writes the result to its output tag. The block has no reset input and no internal accumulator; if you stop driving the input, the previous output is simply held because the upstream block (the counter, the analog MUX, or the AI) keeps supplying the last value. This is the central reason why tying an input to the NI does not clear the chain.
To clear the chain you must attack the source of the value, not the NI that displays it. There are three common sources that need to be reset:
| Source block | What holds the value | Reset mechanism |
|---|---|---|
| Up/Down Counter (B002, B094, B104, ...) | Internal CV that persists across scans | Drive the R input high for at least one scan |
| Analog Multiplexer (MUX) | Last selected channel value at the output | Change SEL to a channel that holds 0, or short the upstream counter |
| NI cascade (NI17, NI18, NI20, NI21, NI22) | Stateless, just reflects inputs | No direct reset; reset every upstream counter and the MUX |
The NI blocks in the user's chain (NI17, NI18, NI20, NI22 adding; NI21 subtracting 5) are not the bug. They are the victim. They keep showing a non-zero value because the counter that feeds them keeps the count, and the MUX that switches between operating modes keeps selecting the same channel.
2. Prerequisites
- LOGO! 8.4 Logic Module (6ED1052-1MD08-0BA2 with display, or 6ED1052-2MD08-0BA2 without) installed and powered with 24 V DC or 115/230 V AC per the device label.
- LOGO! Soft Comfort V8.4 (or later 8.x in the same family) installed on a Windows PC. Open the device in Tools > Select Device > LOGO! 8.4 to make sure the program and target match.
- Ethernet or USB cable between PC and LOGO! to transfer the project and run Online Test.
- Free digital input on the base module or a connected DM16 expansion (6ED1055-1CB00-0BA2 for 24 V DC, 6ED1055-1NB10-0BA2 for 115/230 V AC).
- One normally-open pushbutton wired to that input, or a free bit from the HMI flag area if you prefer to clear from the LOGO! TD/LOGO! TDE display.
Confirm the firmware revision by going to LOGO! > Diagnostics > Device Information in LOGO! Soft Comfort. The firmware should read 0BA2 / FS 02 or newer to support the full NI instruction set used here.
3. Anatomy of an Analog Counter Chain
The chain discussed in the original program has the following topology. Each press of I5 clocks the up/down counter through a rising-edge And(Edge) block. The counter output (CV) drives NI17, which adds 10 and feeds NI18, NI20, and NI22 in cascade. NI21 subtracts 5 in parallel and is OR'd into the same accumulator through NI20. NI19 is an inhibit gate that enables or disables the final analog output (AQ) on the LOGO! 8.4 base module.
The diagram marks three logical stages: the add-pulse stage (top), the subtract/inhibit stage (middle), and the output stage (bottom). The reset signal must reach all three to bring AQ1 to 0 V.
4. Step-by-Step: Adding a Reset Input to the Counter
- Pick a free digital input. The original program uses I1. Reserve it as a true zero / clear input. Do not reuse it for any other function, including the inhibit path, or you will clear the count whenever the inhibit is asserted.
- Wire the I1 terminal directly to the
Rinput of the up/down counter B094 (and B104 if you are cascading two counters). In LOGO! Soft Comfort, drag the connector from the I1 input pin to the R pin at the top of the counter block. - Open the counter block properties. Confirm that Retentivity is OFF if you want a power cycle to also clear the value. Set Threshold to a value at or above the maximum count you expect (e.g., 9999) so the reset does not accidentally clamp a legitimate count.
- Save the project and transfer it to the LOGO! 8.4. Use PC > LOGO! in the menu bar. Online Test will display the CV of the counter; pressing I1 should now drop CV to 0 and the cascade of NI blocks downstream should collapse to 0 within one scan cycle.
5. Step-by-Step: Resetting the MUX Output
The Analog Multiplexer in LOGO! (block category Analog > Multiplexer) selects one of up to four analog values based on a digital SEL input. There is no RESET pin on the MUX, so two engineering patterns are common.
| Pattern | When to use | Reset wiring |
|---|---|---|
| Channel-zero trick | One MUX input is permanently tied to a constant 0 (NI block configured as "constant 0") | Force SEL to that channel during reset by OR-ing I1 with the existing select logic |
| Counter zeroing | The MUX is fed entirely by a counter chain (as in the original program) | Reset the upstream counter; the MUX output then propagates 0 from the cleared CV |
| NI override | You need a hard 0 even when the counter is held at some retain value | Add a parallel NI path that subtracts CV from itself (NI: A - B) gated by I1 |
The cleanest solution is the second pattern: when I1 resets the source counter, every MUX input collapses to 0, and the selected output is 0 regardless of which channel SEL is pointing to. This is the same wiring that works on a physical analog MUX IC such as the TI TMUX6208 - clear the source, and the output follows - and it carries over unchanged into the LOGO! soft-MUX.
6. Edge-Detection Reset with And(Edge)
Sometimes the application requires a reset only on the rising edge of I1 so that a held button does not continuously clamp the chain. Insert an And(Edge) block between I1 and the R input of the counter. The block produces a 1-cycle pulse on the rising transition of I1 and is silent while I1 stays high.
I1 -----+----------> R (Counter B094)
|
+--> And(Edge) --> R (Counter B104)
The And(Edge) block has two inputs: the trigger and an optional enable. Configure the trigger as I1 and the enable as a high constant (M29 flag). The output is a single-scan pulse that resets both counters simultaneously, then drops low so that I1 can be released and a new add-pulse from I5 is registered cleanly.
7. Verification: Online Test on Real Hardware
Online Test in LOGO! Soft Comfort V8.4 is the only reliable way to validate reset behavior, because LOGO! simulation cannot catch severed connections hidden inside a larger program.
- Connect to the LOGO! 8.4 via Tools > Connect or press F2.
- Switch to Online Test mode (the magnifying-glass icon). The screen should turn dark grey; live values appear on every block.
- Press I5 five times. Observe that the CV of B094 increments by 1 on each press and the analog value displayed at AQ1 climbs in steps of 10 V / 1000 (the default 0-10 V range mapped to 0-1000 internal units).
- Press I1 once. Within one scan (< 50 ms typical for a LOGO! 8.4 with a small program), the CV of every counter drops to 0, the MUX output collapses to 0, and AQ1 returns to 0 V.
- Press I1 and hold it for 5 s. The chain must remain at 0 the entire time. Release I1 and press I5: a new count should accumulate from 0, proving the reset did not latch a hidden flag.
- Cycle power on the LOGO! 8.4 with Retentivity = OFF. The CV must start at 0. If it does not, open the counter block and clear the Retentivity bit for the CV.
8. Common Pitfalls: Severed Connections and Hidden Sources
The single most common cause of "the cut-and-paste works but the real program does not" is a connection that was severed when a sub-block was duplicated. The original poster traced the issue to multiple severed wires that were quietly feeding the MUX from intermediate logic that was still holding a non-zero value even after the counter had been reset.
| Symptom | Likely root cause | Fix |
|---|---|---|
| Counter CV goes to 0 on reset, but AQ1 stays at the old value | A second MUX or NI block is fed by a constant instead of the counter | Trace the AQ1 input back through every NI in the path; delete the constant branch |
| Reset works in Simulation but not Online Test | A real digital input is shorted low or driven by a sourcing sensor that is also feeding another block | Disconnect the wire on the LOGO! terminal and test I1 in isolation |
| Reset works once, then has no effect | Retentivity is ON for the counter or for an upstream shift register | Disable retentivity on every block in the chain |
| Reset works but the inhibit gate NI19 still passes a value | NI19 was configured as OR instead of inhibit; the chain has a parallel path | Replace NI19 with a controlled gate that uses the reset signal as an enable |
| Reset pulses fire continuously at power-up | I1 is wired to a sensor that is high at rest | Use a normally-closed button or invert the input with a NOT block before the And(Edge) |
Best practice is to always upload the full program to the LOGO! 8.4 before debugging, never a section of it. Partial uploads break cross-references and will produce a chain that simulates one way and runs another way. The Siemens LOGO! 8 System Manual, section 4.5 explicitly recommends debugging on the live device with Online Test rather than relying on simulation alone.
9. Advanced: Synchronous Reset of Cascaded Stages
For installations with more than two cascaded counters, drive every R input from a single reset flag (e.g., a marker bit M30) that is set by I1 through an And(Edge) and is also used as a global "program_zero" signal. This avoids the wiring mess of a fan-out from one input pin to dozens of blocks, and it gives you a single point of control if you later add an HMI button, a remote SCADA clear, or a watchdog timeout that needs to bring the chain back to a known state.
I1 --> And(Edge) --> SET (RS latch) --> M30 = 1
|
+--> R (Counter B094, B104, B204, ...)
+--> SEL = 0 (Analog MUX)
+--> Inhibit (NI19 = 0)
M30 auto-reset after one scan via pulse relay
This pattern is also useful when the analog value is being driven by a feedback loop, because the reset path bypasses the integrator and forces a known state, which is the same technique that is applied in analog MUX hardware (clock the counter, sync-reset it after 256 clocks, then read the analog input on the other wire) and documented in the Analog Devices MT-088 tutorial on analog switches and multiplexers for the electrical side of the same problem.
10. Frequently Asked Questions
Why does my NI block not reset to zero when I drive an input low?
NI blocks are stateless mathematical functions. They hold no memory; they only reflect the values on their inputs. To get an NI to read 0, every block feeding it (counter, MUX, AI) must itself be at 0. Drive the R pin on the source counter, not on the NI.
My reset works in Simulation but fails on the real LOGO! 8.4. What is wrong?
Most often a connection was severed when a section was cut and pasted, or a second hidden source is still feeding the chain. Upload the full program, switch to Online Test, and click the connector from the MUX to AQ1; it should highlight every block in the path. Any block that is not at 0 after reset is a suspect.
How do I reset a retentive counter on power-up?
Open the counter block, set Retentivity = OFF for the CV, or wire I1 (or a power-on flag M8) through an And(Edge) into the R pin so the first scan of every cold start begins with CV = 0.
Can I reset the Analog MUX block directly?
No, the MUX has no reset input. Either change the SEL lines to point to a constant-zero channel during reset, or reset the upstream counter that feeds every channel so the MUX output naturally collapses to 0.
What is the correct block to use for a one-shot reset pulse?
Use And(Edge) (rising edge) or And(Edge neg) for falling-edge. Drive the trigger with the input button and the enable with a high constant flag such as M29. The output is a one-scan pulse suitable for clocking the R input of any counter without latching.