⏱️ PLC & Ethernet ⏱ 10 min read • Updated 2026-10-26

PLC Timer/Counter Structures (.S, .C, .N) & High-Speed Multi-Block Polling Optimization

Engineering guide to polling PLC Timer (T/ST) and Counter (C/LC) structured sub-elements (.S coil, .C contact, .N current value) and optimizing SLMP batch/random packet coalescing for sub-50ms scan telemetry.
Interactive Workstation Available: Test the protocols and algorithms covered in this guide live in your browser using Melsec Monitor & PLC Studio.
Launch Melsec Monitor & PLC Studio ➔

In industrial PLC diagnostics, Timers (T, ST) and Counters (C, LC) are composite data structures rather than simple 16-bit registers. Every timer or counter instance consists of three distinct hardware primitives: an energizing Coil (.S), a completion Contact (.C), and an accumulating Current Value word (.N). Attempting to query a timer or counter by its parent symbol name alone—or polling hundreds of scattered tags via individual socket requests—is one of the most common causes of SLMP protocol errors and severe HMI lag.

1. Anatomy of MELSEC Timer & Counter Primitives

Whether addressing physical devices on a Q/FX series CPU or symbolic global labels on an iQ-R CPU, a timer or counter maps to three separate device codes in SLMP memory:

Primitive Role IEC / iQ-R Label Suffix Physical Device Symbol SLMP Binary Code Data Type & Operational Meaning
Coil (Energize Input) LabelName.S TC / STC / CC 0xC0 (TC)
0xC3 (CC)
BOOL (1-Bit). High (1) when the ladder rung energizing the timer/counter instruction is active.
Contact (Done Output) LabelName.C TS / STS / CS 0xC1 (TS)
0xC4 (CS)
BOOL (1-Bit). High (1) when the elapsed value reaches or exceeds the preset setpoint (PT / SV).
Current Value (Elapsed) LabelName.N TN / STN / CN 0xC2 (TN)
0xC5 (CN)
WORD (16-Bit) or DWORD (Long Counter LCN). Holds current elapsed ticks or count.

Critical Engineering Rule for Symbolic Labels (0x041C): If a global label tCycleWatchdog is declared as type TIMER in GX Works3, requesting the bare parent name "tCycleWatchdog" via SLMP 0x041C causes the PLC to reject the entire batch packet with an invalid specification error. Client software must explicitly expand or pinpoint the sub-property—requesting "tCycleWatchdog.C" for the timeout contact or "tCycleWatchdog.N" for the elapsed time word.

2. Why Naive Single-Tag Polling Fails at Scale

Suppose an engineer monitors 200 tags on a production line. If a naive monitoring loop dispatches 200 sequential TCP request-response cycles, and each PLC roundtrip takes just 4 ms (Ethernet latency + PLC END-processing service interval), a single update sweep requires $200 \times 4\text{ ms} = 800\text{ ms}$. Worse, opening multiple parallel TCP sockets to the same PLC port quickly exhausts the CPU's socket connection table, triggering ECONNRESET drops.

3. Three-Tier Packet Coalescing Architecture

To achieve deterministic 20–50 ms refresh rates across ratusan of registers over a single TCP connection, industrial communication engines employ a three-tier coalescing algorithm:

  1. Contiguous Block Merging (0x0401 Gap Allowance): Sort all requested physical word addresses by device type. If D100 and D115 are requested, reading a single 16-word contiguous block (D100–D115) in one 0x0401 frame is 10× faster than issuing two separate requests. Any gap of $\le 32$ unused words between target addresses should be merged into a single contiguous read span.
  2. Multi-Point Random Read Packing (0x0403): When addresses are widely scattered across different memory banks (e.g., D10, D5400, W1A0, TN5, M200), pack up to 192 word/dword points into a single 0x0403 Random Read frame. For scattered bit devices (e.g., M205), align the address down to a 16-bit word boundary (K4M192 or M192) so it can be fetched inside the same 0x0403 word payload and unpacked client-side.
  3. Chunked Symbolic Label Batching (0x041C): When polling symbolic global labels on iQ-R, group label names into batches of 20 labels per 0x041C frame. If one batch encounters an unexposed or deleted symbol, an automatic bisection fallback isolates the offending label without halting updates for the remaining 19 valid symbols.

4. PLC Scan-Cycle Service Processing Allocation

On MELSEC Q and iQ-R CPUs, SLMP requests are serviced either during the END processing phase at the conclusion of each ladder scan or asynchronously via dedicated communication time-slicing. In GX Works3 (CPU Parameter → Service Processing Setting), allocating at least 10% to 20% scan time (or a minimum time allocation of 1.0 ms) to external communication prevents large ladder scan times from starving real-time HMI and digital twin telemetry.

Frequently Asked Questions (FAQ)

Q. Why does polling a TIMER label by its base name fail in SLMP 0x041C?

A TIMER or COUNTER in GX Works3 is a composite structure without a single scalar representation. You must append .S (coil bit), .C (contact bit), or .N (elapsed word) to address a concrete memory primitive.

Q. What is the time base of TN (Timer Current Value) registers in MELSEC PLCs?

Standard timers (T) typically use a 100 ms or 10 ms time base, while high-speed timers (OUTH / HST) use 1 ms or 0.1 ms increments depending on CPU parameters. An elapsed value of TN=50 on a 100 ms timer equals 5.0 seconds.

Q. How can I poll scattered bit devices (X, Y, M) inside a word-only 0x0403 Random Read frame?

Floor the bit address to a multiple of 8 or 16 (e.g., M105 -> M96), request that base bit address as a 16-bit word point in 0x0403 (which returns 16 consecutive bits M96..M111), and extract bit offset (105 - 96 = 9) in software.

Q. Why should symbolic 0x041C requests be batched in groups of 20?

Batching 20 labels per frame keeps the UTF-16LE request payload well under the PLC Ethernet module's single-frame buffer limit while minimizing roundtrip latency and simplifying error isolation.

📘 Complete Engineering Guides Directory (16 Technical Articles)