Skip to content
PLCampus
All examples

08Level 3

Conveyor belt with box counter

A sensor counts the passing boxes. When a batch of 6 boxes is complete, the belt stops and a light turns on until the operator starts a new batch.

The simulator is designed for computers (screens 1024 px or wider).

Virtual plant

I0.2 · SensorQ0.1Boxes delivered: 0Q0.0

Boxes delivered: 0

Shown at rest. In the simulator the plant moves according to your program's outputs.

Inputs and outputs

AddressNameDescription
I0.0STARTStart push button (NO)
I0.1STOPStop push button (NC: 1 at rest)
I0.2BOX_SENSORPhotocell that detects the boxes (plant)
I0.3NEW_BATCHPush button to start a new batch (NO)
Q0.0BELTBelt motor
Q0.1BATCH_READYBatch complete light
C0BOXESBox counter of the batch

Program

Ladder diagram (LD)

  1. Rung 1 — Counts the boxes; NEW_BATCH resets the count. The output means batch complete.

    BOX_SENSORI0.2CTUBOXESPV 6BATCH_READYQ0.1
  2. Rung 2 — Belt with seal-in; it stops when the batch is complete.

    STARTI0.0BELTQ0.0STOPI0.1BOXESC0BELTQ0.0

Step by step

  1. 1Press ▶ Run (F5) and press START: the belt moves and the BOXES counter adds one for each box that passes the sensor.
  2. 2Watch the counter's CV value in rung 1. The counter counts edges: a box adds only once, even if it takes a while to pass.
  3. 3At 6 boxes, the counter output turns on BATCH_READY and its NC contact in rung 2 stops the belt.
  4. 4Press NEW_BATCH to set the count to zero and then START to begin another batch.