IntermediateUp-counter~15 min

Batch Counter (CTU + RES)

Count parts passing a sensor; after 4 parts the batch is done and a lamp turns on. A reset button starts the next batch. Counters count RUNG EDGES a part sitting on the sensor counts once, not forever.

Your goal

  • Each part pulse on PartSensor adds 1 to the count.
  • After the 4th part, BatchDone turns ON and stays on.
  • Pressing ResetBtn clears the count and the lamp for the next batch.
Stuck? Show hints (3)
  1. Rung 1: NO PartSensor → CTU C1. The counter increments on the rung's false→true edge one count per part, no matter how long it sits there.
  2. Rung 2: NO C1.DN → OTE BatchDone. DN turns on when the count reaches the preset.
  3. Rung 3: NO ResetBtn → RES C1. RES zeroes the accumulator and drops DN.

Counting on edges is the difference between 4 parts and 4,000 scans.

I/O for this exercise

Inputs
PartSensorPart detect photo-eye
ResetBtnBatch reset button
Outputs
BatchDoneBatch complete lamp
Counters
C1 · 4msParts counter
Loading the editor…