Count units per cycle on a PLC when jobs run 2-up to 4-up

6 min read · Published November 11, 2026

Keep the cycle counter at one increment per cycle. On each accepted cycle-complete event, add the operator's units-per-cycle value, 1 to 4, from a data register into a separate unit-total register. The total records the value each cycle ran at, so a mid-run change from 4-up to 2-up leaves the units already counted correct.

A machine that completes one cycle per event needs no new pulses, no second sensor and no different counter setting to count 2-up through 4-up production. Leave the cycle counter at one increment per cycle. Hold the units-per-cycle selection, 1 to 4, in a data register the operator sets from the panel, and on every accepted cycle-complete event run one add instruction: unit total = unit total + selection. The total then records the value each cycle actually ran at, so an operator who drops from 4-up to 2-up partway through a job leaves every unit already counted correct. Recomputing cycles x current setting does the opposite: it applies the newest value to cycles that finished under the old one, which is why the multiply shortcut miscounts mixed runs. The setup below uses one counter rung, two registers, one math instruction and one bounded panel entry.

What you need

  • The existing cycle-complete signal and the counter rung that records machine cycles, left exactly as they are.
  • One free integer data register for the units-per-cycle selection. The rungs below use DS10.
  • One more free integer data register for the running unit total.
  • One math instruction. The math instruction solves a user-defined equation, so the add runs in the register and touches no output card, relay or machine wiring.
  • A numeric entry field on the operator panel with a minimum of 1 and a maximum of 4. Panel numeric entry objects are built for this: the operator types a value on the panel screen and the object writes the register inside the range you set.
  • A place where operators can watch the running total. The presentation pattern is in how to display a PLC counter value where operators can see it.

Keep the cycle counter exactly as it is

Cycle-complete is one event per cycle, whatever the die layout. A counter instruction increments each time its count input goes true and turns on its done bit when the accumulated value reaches the preset, so it already responds once per event even if the input stays on for several scans. Leave its preset, reset and done-bit logic alone. The difference between 1-up, 2-up, 3-up and 4-up work is data about the job, so the correction belongs in the math after the counter rung. A pulse multiplier, or an encoder wired up to manufacture 2, 3 or 4 pulses per cycle, adds signal hardware and still leaves the operator with nothing to set; the units figure comes from the register, and the missing pulses were never the problem.

Add the selection once per cycle

  1. Confirm the event. Watch the cycle-complete input through 10 full cycles on a known job: the counter must gain exactly 10. If a false event slips in, fix that first, because every unit figure downstream inherits it.
  2. Reserve the selection register. DS10, initial value 1, defined as good units per completed cycle.
  3. Reserve the total register. A second free data register, initial value 0, defined as units produced since the last job reset.
  4. Add on the event. On the same cycle-complete condition that advances the counter, execute the add once: unit total = unit total + DS10. Tie the add to the same one-shot condition as the counter so it runs one time per cycle and never on every scan.
  5. Bound the panel entry. Put a numeric entry object on DS10 with minimum 1 and maximum 4. Handing the operator the job value in a panel field follows the same reasoning as letting an HMI change a PLC timer preset instead of a constant.
  6. Leave the counter rung untouched. Cycles and units stay separate figures: the counter keeps cycles for maintenance, the register keeps units for production.

The add reads whatever is in DS10 at the moment its rung executes. If a panel write and a cycle event land in the same scan, the cycle counts with the value the add saw. Make 'change the selection between cycles' the standing rule on the floor and the question never comes up.

Enter what the die cuts, not what the layout prints

Set the entry from the cavities that cut good parts. A 3-across layout on a die with two usable cavities yields two good units per cycle, so the entry is 2. Change it when a cavity starts producing scrap or a die is retooled, before the next job is counted.

Die condition at job start Entry Added per cycle
1 usable cavity 1 1 unit
2 usable cavities 2 2 units
3 usable cavities 3 3 units
4 usable cavities, all cutting good parts 4 4 units
3-across print, 2 usable cavities 2 2 units

Printed-across and usable are different numbers. The entry always follows the cavities, so label the panel field for what it means: good units per cycle.

Example: a job that changes from 4-up to 2-up

The die runs 4-across with all four cavities cutting good parts. The operator enters 4 and the machine completes 1000 cycles. The add has executed 1000 times: unit total = 1000 x 4 = 4000 units. Cavity 3 then starts producing scrap. The operator sets the entry to 2 between cycles, and the machine completes another 1000 cycles. The total rises by 1000 x 2 = 2000, to 4000 + 2000 = 6000 units, matching the bench count of good parts. The cycle counter reads 1000 + 1000 = 2000 and stays correct as a cycles figure.

The multiply shortcut cannot produce this number. Recomputing at the end of the job gives 2000 cycles x 2 = 4000 units, which is 6000 - 4000 = 2000 short, because it applies the newest entry to cycles that ran at 4. The add records each cycle at the value it ran at. One accepted cycle at an entry of 3 raises the unit total by 3 and the cycle counter by 1, and that pair of movements is the method in miniature.

Keep the total valid on long runs and after power cuts

A 16-bit signed register tops out at 32,767. At an entry of 4, 8,191 cycles fill it to 8,191 x 4 = 32,764 units, and the 8,192nd add reaches 32,768 and overflows. Plan the reset, or move the total to a wider register, before a campaign approaches that many cycles; a 32-bit register carries the same count to 2,147,483,647. Power cuts are the second limit. Where the model clears data registers at power-up, hold the total the way PLC run hours are kept through a power loss: retentive storage, copied into the working register at startup.

Check it worked

Make the checks at the bench with the machine in a safe stopped state under your site's lockout procedure.

  1. Set DS10 to 2 and jog 5 accepted cycles. The unit total must read 5 x 2 = 10 and the cycle counter 5.
  2. Change DS10 through 1, 2, 3 and 4 with the machine stopped. The panel display and DS10 must agree each time, and the unit total must stay at 10 until the next accepted cycle.
  3. Type 5 into the panel entry. The object must refuse it; if it accepts, the minimum and maximum were not saved.
  4. Power the PLC down and up. On a model with retentive registers the total reappears unchanged; on a model that clears, the startup copy must restore it.

Recommendation: keep the cycle counter at one increment per cycle, add DS10 to a separate unit-total register inside the same once-per-cycle event, and bound the panel entry to 1 through 4. Use cycles x setting arithmetic only for reports of runs whose entry never changed; on any job where the entry can change mid-run, the running add total is the only count that stays right.

Questions

When is multiplying cycles by the row setting safe?

When the entry cannot change during the counted run. A job that runs entirely 3-up gives 2000 cycles x 3 = 6000 units, identical to adding 3 on each of 2000 cycles. The moment one cycle runs at a different entry, the single multiplication misstates the run. Use the running add total for anything production counts on, and keep the multiply formula for flat reports where the entry never moved.

Does the unit total survive a power cut?

That depends on the model. The memory-retention table in the PLC documentation lists which register ranges hold their values through power loss and which clear at power-up. Keep the total in a range that holds, or use the startup-copy pattern described above. Zero the unit total and the cycle counter deliberately at each job change; never let a power cycle do the resetting.

What stops a wrong entry from corrupting the count?

Two bounds. Set the panel entry's minimum to 1 and maximum to 4 so the object refuses anything else at the panel. Then gate the add rung on the value being 1 to 4 and switch on a fault bit when it is not, so a stray write from a program download or another device halts the count and shows a fault instead of quietly adding a wrong number.

Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.

Keep reading

Build your signAsk for a quote