ABB PLC Lab Manual · Lab 11 of 20 · Ladder Programming for Machines

ABB PLC Timers and Counters in Ladder Logic (TON, TOF, CTU)

Add time and counting to the conveyor. Sound a 3-second warning horn before the motor starts, count parts at the exit sensor and stop after a batch of five, all with standard IEC timers and counters you can run right here.

2,500+ engineers trained 4.9/5 Google rating 21+ years, Chinchwad, Pune Real AC500-eco + ACS580 trainer kits
Lab 11 of 20 · 60 minutes · Level: Beginner
Quick answer

Automation Builder uses the IEC 61131-3 timer and counter blocks. TON switches its output Q on after the input IN has been TRUE for the preset PT (for example T#3s); TOF keeps Q on for PT after IN goes FALSE; TP gives a fixed pulse. CTU counts rising edges on CU, sets Q when the count CV reaches PV and is cleared by RESET. Each block needs its own instance variable.

  • Every timer and counter needs its own instance (T_Warn : TON;)
  • Time presets use IEC literals: T#3s, T#500ms, T#1m30s
  • CTU counts rising edges, so a sensor held on counts once
  • Name instances after their job: T_Warn, T_RunOn, C_Parts
HardwareKit with exit sensor and buzzer
SoftwareProject from Lab 7
Time60 minutes

Real machines rarely just start and stop. They warn before moving, keep running to clear a part, and count what they produce. These three jobs cover TON, TOF and CTU, the blocks you will use most.

Step 1: Choose the Right Timer or Counter

IEC standard blocks 10 minutes
BlockInputs → outputsBehaviourConveyor use
TON on-delayIN, PT → Q, ETQ TRUE after IN has been TRUE for PT3 s warning horn before motor start
TOF off-delayIN, PT → Q, ETQ TRUE with IN, stays TRUE for PT after IN fallsRun 5 s after the exit sensor clears
TP pulseIN, PT → Q, ETFixed-length pulse on rising IN1 s pulse to a reject flap
CTU up counterCU, RESET, PV → Q, CVCV +1 per rising edge; Q when CV ≥ PVBatch of 5 parts
CTD down counterCD, LOAD, PV → Q, CVCV −1 per edge; Q when CV ≤ 0Parts remaining in an order
CTUD up/downCU, CD, RESET, LOAD, PVBoth directionsBuffer conveyor fill level
Declaration
VAR
    T_Warn   : TON;   (* pre-start warning *)
    T_RunOn  : TOF;   (* run-on after exit *)
    C_Parts  : CTU;   (* batch counter *)
    Start_Req, Warn_Done, Batch_Done : BOOL;
END_VAR

Step 2: Pre-start Warning with TON

Ladder: Motor_Logic 15 minutes
  1. Change the start rung so Start sets Start_Req (seal-in) instead of the motor output.
  2. Insert a TON block (instance T_Warn), IN = Start_Req, PT = T#3s, Q → coil DO_Motor_Run.
  3. Add a rung: Start_Req AND NOT T_Warn.Q → DO_Buzzer.
  4. Stop resets Start_Req, which resets the TON and stops the motor.

Timer and counter simulator

Press Start: the buzzer sounds for 3 s, then the motor runs. Pulse the exit sensor 5 times to finish the batch. Reset clears the counter.

Inputs (click / hold)
Outputs
%QX0.5 Buzzer
%QX0.0 Motor run
Batch done
T_Warn.ET: 0C_Parts.CV: 0Start_Req: 0
001 Start request with seal-in, dropped by Stop or batch doneDI_Start_PB%IX0.1DI_Stop_PB%IX0.2Batch_DoneStart_ReqStart_Req002 3 s pre-start warning, then motorStart_ReqTONINQPT T#3sT_WarnDO_Motor_Run%QX0.0003 Buzzer while warning time runsStart_ReqWarn_DoneDO_Buzzer%QX0.5004 Count parts at exit; Q when 5 reachedDI_Exit_Sensor%IX1.3CTUINQPV 5C_PartsBatch_Done

Green contact = passing power. Orange moving wire = rung is true and the output is energised.

Step 3: Run-on with TOF and Batch Count with CTU

Ladder 15 minutes
RungLogicNotes
Run-onTOF T_RunOn: IN = DI_Exit_Sensor, PT = T#5s → keeps Cmd_RunOn TRUEOR Cmd_RunOn into the motor command so the conveyor clears the part
CountCTU C_Parts: CU = DI_Exit_Sensor, RESET = DI_Reset_PB, PV = 5Rising edge only: a part sitting on the sensor counts once
Batch doneC_Parts.Q → Batch_DoneUsed as NC contact in the start rung
DisplayC_Parts.CV → HMIShow count on the CP604 in Lab 12
Retentive counts

A normal CTU counts from 0 after a power cycle. If production counts must survive power off, declare the count in a RETAIN area and copy it, rather than relying on the block instance.

Step 4: Test on the Kit

Online 15 minutes
0 of 5 checks recorded
IDCheckHow to checkPass criterionResult
Timers and counters
T-01WarningPress StartBuzzer 3 s, then motor; T_Warn.ET counts to 3 s
T-02Stop during warningPress Stop within 3 sBuzzer stops, motor never starts
T-03CountPass 5 parts past exit sensorC_Parts.CV = 5, motor stops
T-04Held sensorHold part on sensorCounts once only
T-05ResetPress ResetCV = 0, start possible again

Practice Exercise

Exercise

Add a TP block that pulses DO_Reset_Lamp for 1 s each time a part is counted, and a second counter for total parts that is never reset by the batch reset.

Troubleshooting

SymptomLikely causeFix
Timer never finishesIN not held TRUE (pulse instead of level)Drive IN with a sealed bit like Start_Req
Two timers behave the sameSame instance used twiceDeclare one instance per timer
Counter counts many times per partBouncing sensor or CU driven by a pulse trainCheck sensor, add input filter
Count lost after power offNon-retain variableStore count in a RETAIN variable

Frequently asked questions

How do I use a TON timer in ABB Automation Builder?

Declare an instance (T1 : TON;), insert the TON block in ladder, connect IN to the start condition, set PT such as T#3s and use Q where you need the delayed signal.

What is the difference between TON and TOF?

TON delays switching ON: Q comes on PT after IN. TOF delays switching OFF: Q goes off PT after IN falls.

How does a CTU counter work?

Each rising edge on CU adds 1 to CV. When CV reaches PV, Q becomes TRUE. RESET sets CV back to 0.

How do I write a time preset in Automation Builder?

Use IEC time literals: T#500ms, T#3s, T#2m, T#1h30m.

Reviewed by Bhawesh Kumar SinghIndustrial Automation Trainer and Industry 4.0 Consultant · Softwell Automation · 21+ years industry experience

Get the full ABB PLC syllabus + free demo class

Share your details. A Softwell training advisor will call you within 24 hours with batch dates, fees and AC500 hardware access options.

No spam. Used only to share course details for this enquiry.

Practise every lab on real ABB hardware

AC500-eco PLC, ACS580 drive and HMI trainer kits: live online, Pune classroom or corporate in-plant training.

Request Course Details
Verified learning pathway

Discuss This Technical Course

Explore practical curriculum, software, hardware and batch options for this technology.

Content reviewed: 14 October 2026

ABB PLC & Automation Builder Learning Path

Follow the full 20-lab ABB AC500-eco practical series in order, or start from the ABB PLC Lab Manual hub.

  1. Lab 1: Automation Builder Installation & AC500-eco Setup
  2. Lab 2: Connect AC500-eco PLC via Ethernet
  3. Lab 3: Create a New Automation Builder Project
  4. Lab 4: AC500-eco IO Configuration
  5. Lab 5: Digital Input Mapping
  6. Lab 6: Digital Output Mapping
  7. Lab 7: First Ladder Program: Start/Stop
  8. Lab 8: Download a Program to AC500-eco
  9. Lab 9: Upload a Program from AC500-eco
  10. Lab 10: Online Monitoring, Force & Write
  11. Lab 11: Timers & Counters in Ladder
  12. Lab 12: Network & Tag Mapping
  13. Lab 13: Alarm Mapping & Fault Latching
  14. Lab 14: Tower Lamp Logic
  15. Lab 15: Emergency Stop & Interlocks
  16. Lab 16: Manual Mode Logic
  17. Lab 17: Auto Mode Sequence Logic
  18. Lab 18: Structured Text (ST) Programming
  19. Lab 19: AC500-eco to ACS580 Modbus RTU Setup
  20. Lab 20: Control ACS580 via Modbus RTU
  21. ABB AC500 PLC Selection Guide
☎ Call WhatsApp ✉ Email Enquire Now