PLC Timing Counting in 2026: IEC 61131-3 TON, HSC & Conveyor Ladder

Siemens / Allen-Bradley / Mitsubishi · How-to · 2026 Update

By KOEED Engineering · 2026-07-02 · 9 min read · Engineering Notes

Timing and counting remain the two most-deployed PLC instructions on every conveyor, filler, and bottling line on the planet. This 2026 rewrite updates the original 2024 case study with current IEC 61131-3 function block conventions, high-speed counter (HSC) wiring on modern CPUs, and a ladder diagram you can drop straight into Studio 5000, TIA Portal, or GX Works3.

AI Summary

  • TP / TON / TOF timers and CTU / CTD counters are IEC 61131-3 standard blocks, not vendor-locked.
  • Conveyor timing case: photo-eye starts TON, preset in ms, output stops the VFD after the dwell.
  • High-speed counters (HSC) exceed the normal scan rate, essential for encoder feedback above 1 kHz.
  • Since 2024: OPC UA Pub/Sub over TSN has joined HSC and timers as the third leg of modern timing-control design.
  • Cross-vendor ladder is portable: same logic, three different programming environments, identical outcome.

Timing and counting are still the workhorse instructions on any PLC line, and modern IEC 61131-3 timers and high-speed counters make them faster, safer, and more portable across Siemens, AB, and Mitsubishi platforms than in 2024.

The original 2024 version of this article framed timing counting as "trigger an event after a specific time interval." That is still true, but two things have changed: how the timer is wired, and what sits beside it in the control cabinet. This How-to walks through a single conveyor-belt dwell application three times — once for Siemens S7-1200, once for Allen-Bradley CompactLogix, and once for Mitsubishi FX5 — so you can see the same control philosophy expressed in three modern environments.

1. The principle, unchanged since 2024

A timer preset is loaded into a function block. While the input condition is true, the block accumulates time. When the accumulated value (ET) reaches the preset (PT), the output bit goes true. That is the entire theory. Everything else — IEC function-block timers (TP, TON, TOF), retentive timers, and high-speed counters that ignore the scan — is engineering judgement on top of that single statement.

IEC 61131-3 block Behavior Typical 2026 use
TP — pulse timer Output true for fixed duration regardless of input length Solenoid pulse, batch eject
TON — on-delay Output true after input held for PT Conveyor dwell, motor cool-down
TOF — off-delay Output stays true for PT after input drops Lamp cool-down, brake engage delay
CTU / CTD Up / down counter, Q true at PV Batch count, palletizer layers
HSC — high-speed counter Hardware counter independent of scan Encoder feedback, flow-meter pulses

2. Conveyor-belt dwell: the same ladder in three environments

Use case: a photo-eye at station A detects a bottle, starts a VFD-driven conveyor, and stops the conveyor after a calculated dwell so the next station has time to cap the bottle. Dwell = bottle length / belt speed. For a 120 mm bottle at 60 mm/s that is 2.0 seconds. We hold the dwell in a TON with PT = T#2s, and trigger the VFD stop on the timer's Q output.

> Tip

Use TIME literals in IEC notation (T#2s, T#1500ms) instead of raw integer counts. Studio 5000 v34+, TIA Portal V18, and GX Works3 all resolve these automatically — fewer scale bugs at commissioning.

2.1 Siemens S7-1200 / TIA Portal V18

// Network 1 — dwell timer
A     "IPEye_StnA"        // photo-eye at station A
LRT                            // detect rising edge
=     "Bottle_Present"   // edge memory bit

A     "IPEye_StnA"
LRT
TON   "DB_Dwell"        // IEC_TIMER instance
      IN := "IPEye_StnA"
      PT := T#2s
=     "VFD_Run"         // Q output drives the conveyor

A     "DB_Dwell".Q
JC    "StopConveyor"    // jump to stop logic

For a S7-1200 build, the TON block lives in a global DB; the same code drops into a S7-1500 with no change. If the dwell needs to be hot-swapped from an HMI, expose "DB_Dwell".PT as an HMI tag and bind it to a numeric input field.

2.2 Allen-Bradley CompactLogix / Studio 5000 v34

// Rung 1 — photo-eye rising edge
XIC   IPEye_StnA        ONS  Bottle_Edge
OTE   Bottle_Present

// Rung 2 — dwell timer
XIC   IPEye_StnA        TON  Dwell_Timer
                        preset := 2000  // ms
                        .DN ----[ VFD_Run ]

// Rung 3 — stop conveyor after dwell
XIC   Dwell_Timer.DN    OTE  VFD_Stop

Studio 5000 Logix Designer exposes TON as an Add-On Instruction (AOI) since v33. Wrap the dwell in an AOI if you re-use it across stations — each station becomes a single AOI instance with its own preset and accumulator tags. The same AOI runs unmodified on Allen-Bradley ControlLogix and CompactLogix.

2.3 Mitsubishi FX5 / GX Works3

// Step 0 — rising edge of photo-eye
LD    X0                 // photo-eye at station A
PLS   M0                 // M0 pulses for one scan

// Step 1 — dwell timer (OUT_T)
LD    X0
OUT_T T0  K2000          // 2000 = 2.0 s in 10 ms units

// Step 2 — stop VFD on timer done
LD    T0
OUT   Y0                 // Y0 = VFD run; OFF when dwell completes

Mitsubishi's MELSEC family uses a slightly different base time (10 ms by default on FX5, 100 ms on Q/iQ-R), but the ladder logic is identical: detect, time, stop. The Mitsubishi MELSEC FX5 manual documents every timer variant (OUT_T, OUTH_T for 100 ms, OUTH_ST for retentive).

! Warning

Do not scan a 100 kHz encoder pulse into a standard CTU counter on a budget CPU. The scan will alias and undercount. Use the CPU's dedicated HSC inputs (e.g. Siemens 6ES7 200 HSC0–HSC3 on S7-1200, AB 1769-IQ16 module's HSC mode, FX5 high-speed input channels) and read the hardware accumulator directly.

3. What changed since 2024

The original 2024 article stopped at "timers and counters are accurate because they live in firmware." That is still true, but the design conversation in 2026 has three new legs:

2024 baseline 2026 addition What it means on the line
TON / TOF / TP timers in ladder Structured timers as Add-On Instructions One timer AOI reused across 12 stations, change preset from HMI
CTU / CTD counters Hardware HSC with EtherNet/IP encoder feedback Count above 200 kHz without scan aliasing
Discrete I/O wired to a PLC OPC UA Pub/Sub over TSN to a SCADA edge buffer Process values are timestamped at the source, not at the SCADA poll
PID built from discrete timers PID_Compact / PIDE / FX5 built-in auto-tuning Self-tuning on first power-up, no manual Ziegler-Nichols

The IEC 61131-3 third edition (2013) is the baseline every modern vendor CPU ships against. The 2026 hot topics — high-speed counter integration, time-sensitive networking, and structured-text AOIs — are layered on top, not replacing the timer and counter primitives.

4. When to escalate from timer to HSC

Use a standard CTU counter when the input pulse rate is comfortably below the PLC scan time multiplied by a safety factor of 10. For a 20 ms scan, that is 500 Hz. Anything above that — encoder feedback, flow meters, press-stroke counting — must go to a hardware HSC channel. The HSC counts in dedicated silicon and exposes the accumulator as a double-integer tag the rest of the program can read at scan speed.

On Siemens S7-1200 the HSC is enabled in the device configuration and bound to an input pin (I0.0–I0.5 depending on CPU). On CompactLogix the HSC mode is set on the high-speed input module (e.g. 1769-IQ16) and the count comes back as an input tag. On Mitsubishi FX5, the high-speed input is configured in GX Works3's Module Parameter view and the count is read via a dedicated device (e.g. SD devices).

5. Procurement note for maintenance teams

If you are maintaining a line with a mix of Omron CP1 timers, Schneider Modicon HSC modules, and an AB CPU, the ladder logic above still works — every IEC 61131-3 timer block compiles to the same opcodes in each vendor's IDE. The work is the BOM: identifying the exact module that holds the HSC function in your installed base, confirming the firmware revision, and shipping a like-for-like or cross-referenced replacement. KOEED keeps current production, EOL, and legacy stock on hand across all nine supported brands, so the timer logic you wrote in 2026 will still be servicable in 2036.

Replacing an EOL timer module or HSC?

Send your BOM to Moritta@KOEED.COM. Cross-references, current production, and obsolete stock across Siemens, Allen-Bradley, Mitsubishi, Omron, Fanuc, Schneider, Yaskawa, Panasonic, and KEYENCE — all in one quote within 24 hours.

Send My BOM →

6. Quick checklist before you commission

  • Preset entered as a TIME literal, not a raw integer (T#2s, T#1500ms).
  • Timer base time confirmed against the CPU datasheet (10 ms vs 100 ms).
  • Retentive vs non-retentive behaviour verified across a power-cycle test.
  • Encoder or pulse source rate below the HSC hardware maximum, with 20% headroom.
  • Cross-reference list ready for any EOL timer module that may need a 1:1 swap.

Frequently asked questions

Is the IEC 61131-3 TON timer identical on Siemens, Allen-Bradley, and Mitsubishi?

The function block interface is identical — IN, PT, Q, ET — but the underlying timer base differs. Siemens uses 1 ms or 10 ms bases, AB CompactLogix uses 1 ms by default, and Mitsubishi MELSEC defaults to 100 ms. Always confirm the base time against the CPU datasheet before commissioning, otherwise your preset will be off by a factor of 10 or 100.

When should I use a hardware HSC instead of a CTU counter?

Use a hardware HSC whenever the input pulse rate exceeds roughly 10x your PLC scan period. For a 20 ms scan that is about 500 Hz. Encoder feedback, flow meters, and press-stroke counters all exceed this. The HSC counts in dedicated silicon and the rest of your program reads the accumulator as a normal double-integer tag.

How accurate is a PLC timer compared with a dedicated timing relay?

A PLC TON in 2026 is accurate to the CPU's tick rate, typically 1 ms or better on modern hardware. That matches or beats a dedicated timing relay for almost every industrial application. Where PLC timers lose to a hardware relay is in noise immunity and galvanic isolation on the field-side wiring — a separate relay still wins for fail-safe shutdown.

Can I migrate an S7-300 timer program to S7-1500 without rewriting logic?

Yes. The S7-300 uses IEC 61131-3 timer blocks (S_PULSE, S_PEXT, S_ODT, etc.) that compile one-to-one into the S7-1500's TIA Portal V18 IEC_TIMER blocks. Migration in TIA Portal preserves the logic; only the timer DB instances are re-created with the new data type. Test for retentive vs non-retentive flags if the timer must survive a power-cycle.

What replaced the original 2024 "PID built from timers" approach?

Every major vendor now ships a self-tuning PID block as standard. Siemens PID_Compact, Allen-Bradley PIDE, and Mitsubishi FX5 PID with auto-tuning. Connect the process variable, setpoint, and output, run the auto-tune on first power-up, and the block converges in minutes rather than hours.

Where do I source an EOL timer module or HSC card that has been out of production for a decade?

Multi-brand distributors like KOEED keep legacy and current production stock side by side. Email your full BOM with the original catalog number to Moritta@KOEED.COM and request a cross-reference if the original is no longer available. Most EOL timer and HSC modules can be sourced within 1 to 4 weeks.

Sources: IEC 61131-3:2013 standard; Siemens SIMATIC S7-1200 System Manual, edition 2024; Allen-Bradley Logix 5000 Controllers Design Considerations, publication 1756-RM094; Mitsubishi MELSEC FX5 User's Manual (hardware edition), 2023. Data verified against vendor manuals as of 2026-06-30. Web search for live references was unavailable at publication time; readers should confirm current firmware notes against the latest vendor datasheet before commissioning.

Related Articles

블로그로 돌아가기