MFG-INDU16-06 · Lesson 6 · 15 clock hours · lab
Timers and Counters in Ladder Logic
Objective. Students configure and test TON (timer-on delay), TOF (timer-off delay), and CTU (count-up) instructions to control a simulated conveyor start-delay, motor run-time limit, and part-count reject sequence.
⚠ Pending professional review
This lesson, its worked examples and its practice questions has not yet been verified by a licensed engineer or certified journey-level tradesperson or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
Timers and Counters in Ladder Logic
Why Timers and Counters Matter
Most industrial processes depend on time and quantity. A conveyor must not lurch into motion the instant an operator presses START — a short start delay protects personnel and equipment downstream. A pump motor must not run indefinitely without supervision — a run-time limit prevents overheating. Parts must be counted accurately so a reject gate opens at exactly the right moment. Programmable Logic Controllers (PLCs) handle all three tasks using built-in timer and counter instructions that execute every scan cycle.
The PLC Scan Cycle and Timing Accuracy
A PLC executes ladder logic by scanning rung by rung, top to bottom, then updating outputs and repeating. This scan cycle typically completes in a few milliseconds. Timer instructions measure elapsed time by comparing accumulated counts against a preset value, incrementing the accumulator each time the rung evaluates as true for one time-base interval. Because scan time is very short compared with the time bases used in most applications (0.01 s or 0.1 s), PLC timers are highly accurate in practice. Always verify accuracy with a calibrated stopwatch during commissioning — this lab requires accuracy within ±0.5 seconds.
TON: Timer On-Delay
The TON (Timer On-Delay) instruction begins counting when its rung condition goes TRUE and holds that count as long as the rung stays TRUE. When the accumulated value reaches the preset, the timer's Done (DN) bit turns ON, and that bit can energize downstream outputs.
Key parameters:
- Preset (PRE): The target count, in time-base units, that the timer must reach before the DN bit sets.
- Accumulator (ACC): The running count of elapsed time-base intervals. Resets to zero when the rung goes FALSE.
- Time base: The interval per count — commonly 0.01 s (10 ms) or 0.1 s (100 ms), depending on the PLC family and firmware version.
Conveyor start-delay example: Set PRE = 500 with a 0.01 s time base. The conveyor output energizes 5.00 seconds after START is pressed, protecting workers near the infeed. If START is released before 5 s elapse, the accumulator resets and the conveyor never starts — a built-in safety feature.
TOF: Timer Off-Delay
The TOF (Timer Off-Delay) instruction works the opposite way. The DN bit is ON while the rung is TRUE. When the rung goes FALSE, the timer begins counting. When the accumulator reaches the preset, the DN bit turns OFF.
TOF is useful for run-time limits in combination with reset logic. In this lab, you will chain a TON to a TOF-reset sequence so the conveyor shuts off after 30 continuous seconds of running, protecting the motor from overheating during unattended operation.
Important: TOF resets its accumulator and re-energizes DN the moment the rung goes TRUE again. Build your logic to latch the stop condition if you want a hard shutdown that requires a deliberate reset.
CTU: Count-Up Counter
The CTU (Count-Up Counter) instruction increments its accumulator by 1 each time its rung transitions from FALSE to TRUE (a rising edge). When the accumulator equals the preset, the Done (DN) bit sets. CTU keeps counting beyond the preset unless a reset (RES) instruction clears the accumulator.
Key parameters:
- Preset (PRE): The count target that sets the DN bit.
- Accumulator (ACC): The running part count. Does not reset automatically.
- CU bit: The enable coil that responds to each rising edge.
Part-count reject example: A proximity sensor detects each part passing on the conveyor. Every rising edge from the sensor increments CTU.ACC. When ACC reaches the preset (for example, 10 parts), the DN bit opens a reject gate pilot light. A RES instruction tied to an operator RESET button clears ACC so the next batch can be counted.
Wiring and Safety Before You Power Up
Before working on the PLC trainer:
1. Inspect the trainer for damaged wiring, loose terminals, or cracked enclosures. Report defects to your instructor before proceeding.
2. Lockout/Tagout (LOTO): This trainer operates at low control voltage, but industrial PLCs control high-voltage machinery. Practice LOTO discipline now — apply the program and verify logic before enabling outputs.
3. PPE: Safety glasses are required in the lab at all times. Do not defeat or bypass any trainer interlock.
4. Never force outputs (writing directly to output bits) while a machine or actuator is connected and energized unless your instructor has cleared the area.
Entering, Downloading, and Monitoring the Program
1. Open a new project in the programming software and select the correct PLC model on the trainer.
2. Enter your ladder rungs in order: TON rung for start delay, TOF/reset chain for run-time shutoff, CTU rung for part counting.
3. Verify addresses match the trainer I/O wiring diagram provided in the lab log.
4. Save, compile (verify), and download to the PLC.
5. Switch the PLC to RUN mode. Use the online monitor to watch PRE, ACC, and DN bit status in real time.
6. Record actual elapsed times from your stopwatch and compare with preset values. A discrepancy greater than ±0.5 s means you must review your time-base setting or preset value before the instructor check-off.
Reading the Online Monitor
In online monitor mode, the programming software shows each timer and counter instruction with live ACC and PRE values displayed inside the rung. A highlighted (energized) rung is shown in green or bold, depending on the software. Watch the ACC count upward during a TON — if it is not counting, check that the rung conditions feeding the timer are all TRUE.
Key terms10
TON (Timer On-Delay)A PLC timer instruction that begins accumulating time when its rung goes TRUE and sets the Done bit when the accumulator reaches the preset value; resets when the rung goes FALSE.
TOF (Timer Off-Delay)A PLC timer instruction whose Done bit is ON while the rung is TRUE; when the rung goes FALSE the timer counts, and the Done bit turns OFF when the accumulator reaches the preset.
CTU (Count-Up Counter)A PLC counter instruction that increments its accumulator by one on each rising edge of the rung input and sets the Done bit when the accumulator equals the preset.
Preset (PRE)The target value programmed into a timer or counter instruction; when the accumulator equals the preset, the Done bit changes state.
Accumulator (ACC)The register inside a timer or counter instruction that holds the current elapsed-time count or part count; compared against the preset each scan.
Time baseThe fixed time interval added to a timer accumulator each scan cycle that the rung is TRUE; common values are 0.01 s and 0.1 s.
Done (DN) bitA status bit associated with a timer or counter that changes state when the accumulator reaches the preset; used as a contact in other rungs to control outputs.
Rising edgeThe transition of a signal from FALSE (0) to TRUE (1); CTU instructions increment their accumulator on each rising edge of their rung condition.
Online monitorA mode in PLC programming software that displays live rung status, accumulator values, and bit states while the PLC is running, allowing real-time troubleshooting.
Scan cycleThe repeating sequence in which a PLC reads all inputs, executes all ladder rungs in order, and then updates all outputs before starting again.
Worked examples4
1. Calculate the preset value for a TON instruction that must produce a 5-second start delay, using a time base of 0.01 s.
- Identify the required delay: 5 seconds.
- Identify the time base: 0.01 s per count.
- Divide the required delay by the time base: 5 s ÷ 0.01 s/count = 500 counts.
- Enter 500 as the Preset (PRE) value in the TON instruction.
Answer: PRE = 500. The timer accumulator increments by 1 every 0.01 s; after 500 counts the accumulator equals the preset and the Done bit energizes, starting the conveyor at exactly 5 s.
2. Calculate the preset value for a TON instruction that must shut off a motor after 30 seconds of continuous run, using a time base of 0.1 s.
- Identify the required run time: 30 seconds.
- Identify the time base: 0.1 s per count.
- Divide the required time by the time base: 30 s ÷ 0.1 s/count = 300 counts.
- Enter 300 as the Preset (PRE) value.
Answer: PRE = 300. When ACC reaches 300 the Done bit energizes, and the control logic uses that bit to de-energize the motor output.
3. A CTU counter has PRE = 10 and is connected to a proximity sensor. After 7 parts pass, what is the ACC value and is the Done bit ON or OFF? After 10 parts pass?
- The CTU increments ACC by 1 on each rising edge from the sensor.
- After 7 parts: ACC = 7. The Done bit sets only when ACC equals the preset (10), so DN = OFF.
- After 10 parts: ACC = 10. ACC equals PRE, so DN = ON.
Answer: After 7 parts: ACC = 7, DN = OFF. After 10 parts: ACC = 10, DN = ON. The reject gate pilot light energizes when DN turns ON.
4. A technician measures the conveyor start delay with a stopwatch and records 5.7 seconds. The TON preset is 500 and the time base is 0.01 s. Identify whether this passes the ±0.5 s tolerance and state the likely cause of the error.
- Calculate the programmed delay: 500 × 0.01 s = 5.00 s.
- Calculate the deviation: 5.7 s − 5.0 s = 0.7 s.
- Compare to tolerance: 0.7 s > 0.5 s, so the measurement FAILS.
- Consider causes: The programmed preset and time base appear correct; the most likely cause is a mismatch between the time base selected in the software and what the PLC firmware actually uses (for example, the instruction was set to 0.01 s but the PLC defaulted to 0.1 s, giving 500 × 0.1 s = 50 s — that would be a larger error). A 0.7 s over-run at 0.01 s/count suggests possible scan-cycle overhead, an incorrect time-base entry (such as a 0.014 s effective rate), or operator stopwatch reaction time. Instruct the student to verify the time-base parameter in the instruction properties and re-test.
Answer: The result of 5.7 s fails the ±0.5 s tolerance (deviation = 0.7 s). The student must review the time-base parameter in the TON instruction properties, confirm it matches the trainer's supported time base, re-download, and retest.
In class: Instructor demonstrates timer instruction parameters (preset, accumulator, time base) using an animated scan-cycle diagram and times the response with a stopwatch to confirm accuracy. · Students write a program segment that starts a conveyor output 5 seconds after a START pushbutton is pressed (TON), shuts it off after 30 seconds of continuous run (TOF reset chain), and counts parts detected by a proximity sensor (CTU); they enter and download the program. · Students run the sequence on the trainer, recording actual timer and counter values at each event in their lab log and verifying them against preset values; any timing error greater than ±0.5 seconds triggers a program review.
Materials: PLC trainer, programming laptop, stopwatch, proximity sensor, pilot lights representing conveyor and reject gate, lab log sheet with data table
Check: Conveyor start delay must be 5 s ±0.5 s, run-time shutoff at 30 s ±0.5 s, and counter increment correctly on each sensor pulse — all three criteria checked by instructor in online monitor; all must pass.
Practice check8
Answer each question, then check it. Nothing is recorded; this is your own practice.
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.