PLC Playground guide cover: PLC counter double counting

PLC Counter Counts Twice per Part? Prove the Edge Before Adding a Delay

A double count can come from two real signal transitions, duplicate counting logic, or an unexpected reset and recount. Adding a delay immediately may hide the symptom while rejecting legitimate closely spaced parts. First establish what the counter actually sees for one physical event.

Logix CTU transition behavior; high-speed counting requires separate hardware-specific analysis.

What is happening?

The referenced Logix CTU increments on a false-to-true rung transition. A sensor that briefly clears and retriggers can therefore produce two valid instruction events for one part. Shared counter storage, repeated instruction use, and application resets introduce other possible paths to an unexpected total.

Check these five things

  1. Capture the raw sensor state and the exact Boolean expression feeding the counter at an appropriate sample rate.

  2. Cross-reference the counter instance and accumulator. Find every count, reset, move, and initialization affecting it.

  3. Compare sensor placement and target geometry with the observed transitions. A hole, reflective surface, or vibration may create a genuine second edge.

  4. Check task and input-update timing before choosing debounce. The filter must preserve the fastest legitimate event the design requires.

  5. Test representative slow, fast, and closely spaced events in a safe test environment, recording expected and actual totals.

Worked example

A simulated sensor sequence for one part is 0, 1, 0, 1, 0 because the target briefly leaves the sensing zone. A rising-edge counter can correctly count two. The repair may involve sensing geometry or a validated event-state model rather than an arbitrary long timer.

Quick diagnostic reference

Evidence Investigation
Two raw edges Sensor behavior and event definition
One raw edge; two increments Logic ownership and instance use
Count returns then rises Reset and initialization paths

The mistake to avoid

A debounce setting chosen without considering minimum part spacing can solve double counts by creating missed counts.

How to verify the fix

Run a known number of representative events and reconcile the count, including startup, pauses, and rejected parts. Record the accepted maximum event rate.

Field-work boundary: These are educational diagnostic guides. Use the exact equipment manuals and approved site procedures. Electrical testing and machinery changes belong to qualified, authorized personnel; control hazardous energy and validate affected functions before release.

Technical reference

Rockwell Automation: Count Up (CTU). The examples and diagnostic tables above are original teaching material; they do not replace the product manual.

Continue troubleshooting

Previous Post Next Post