Skip to content
Ladder logic (PLC) templates

Ladder - Packaging Line Fill and Cap

Ten rungs of a fill-and-cap machine frozen on the scan where the 1.2 s fill dwell has just timed out: the valve rung reads the timing bit and has already dropped, the capper fires off the done bit, and the batch CTU sits at 1,180 of 1,200 so the counter's done bit - and the batch lamp behind it - stay low.

Template previewLadder logic (PLC)
Packaging line - fill dwell, capper and batch countDECLARED INPUT STATEStart_PB = 0Stop_PB = 1EStop_OK = 1Guard_Closed = 1Product_Present = 1Cap_Present = 1Reject_Ack = 0Line_Run = 1L1N1Machine safe: E-stop healthy and every guard closedTRUEEStop_OK1Guard_Closed1Machine_Safe12Line run seals in through the stop buttonTRUEStart_PB0Line_Run1Stop_PB1Machine_Safe1Line_Run13Fill dwell - 1.2 s of valve open per containerTRUELine_Run1Product_Present1TONT_FillPRE 1200 msACC 1200 msDN4Fill valve is open only while the dwell is still timingFALSET_Fill.TT0Fill_Valve05Capper fires once the dwell is done and a cap is presentedTRUET_Fill.DN1Cap_Present1Capper16A missing cap at the end of the dwell latches a rejectFALSET_Fill.DN1Cap_Present1SReject_Flag07Operator acknowledgement clears the reject latchFALSEReject_Ack0RReject_Flag08Reject pusher sweeps the flagged container off the beltFALSEReject_Flag0Reject_Pusher09Batch counter - 1200 packs to the palletTRUET_Fill.DN1CTUC_BatchPRE 1200 packsCV 1180 packsDN10Batch-complete lamp on the counter done bitFALSEC_Batch.DN0Batch_Lamp010 rungs solved in one scan: 5 true, 5 false. 21 tags, 8 declared as inputs.4 outputs are never energised in this state: 'Fill_Valve', 'Reject_Flag', 'Reject_Pusher' +1 more.

Make it your own.

title "Packaging line - fill dwell, capper and batch count"
state: Start_PB=0, Stop_PB, EStop_OK, Guard_Closed, Product_Present, Cap_Present, Reject_Ack=0, Line_Run

rung "Machine safe: E-stop healthy and every guard closed"
  xic EStop_OK
  xic Guard_Closed
  ote Machine_Safe

rung "Line run seals in through the stop button"
  branch
    --] [--Start_PB
    --] [--Line_Run
  --] [--Stop_PB
  --] [--Machine_Safe
  --( )--Line_Run

rung "Fill dwell - 1.2 s of valve open per container"
  xic Line_Run
  xic Product_Present
  ton T_Fill preset: 1200 accum: 1200 unit: ms

rung "Fill valve is open only while the dwell is still timing"
  xic T_Fill.TT
  ote Fill_Valve

rung "Capper fires once the dwell is done and a cap is presented"
  xic T_Fill.DN
  xic Cap_Present
  ote Capper

rung "A missing cap at the end of the dwell latches a reject"
  xic T_Fill.DN
  xio Cap_Present
  otl Reject_Flag

rung "Operator acknowledgement clears the reject latch"
  xic Reject_Ack
  otu Reject_Flag

rung "Reject pusher sweeps the flagged container off the belt"
  xic Reject_Flag
  ote Reject_Pusher

rung "Batch counter - 1200 packs to the pallet"
  xic T_Fill.DN
  ctu C_Batch preset: 1200 accum: 1180 unit: packs

rung "Batch-complete lamp on the counter done bit"
  xic C_Batch.DN
  ote Batch_Lamp