Troubleshooting
Why PC-polled remote I/O cannot count encoder pulses for SCADA
Short answer
A 100 PPR quadrature encoder on a line at 200 m/min produces 333 Hz on channel A, about 1.3 kHz once the counter decodes quadrature at 4x. No PC poll, and no 4 ms discrete input, can follow that rate. Count the pulses in a PLC high-speed counter input and let the SCADA sample the accumulated register.
On this page
- What a polled remote I/O head actually delivers
- Check the pulse rate against the input before wiring anything
- Worked example: 100 PPR encoder on a line at 200 m/min
- Quick fixes that fail on a PC-mastered link
- The fix: count in PLC hardware, sample registers from SCADA
- Keep the count alive and leave control in the PLC
- Questions asked
A PC polling remote I/O over Ethernet collects snapshots of input bits and never sees the transitions between them. On a coating line monitored through a PC-mastered remote I/O head, a 100 PPR quadrature encoder running at up to 200 m/min delivers roughly 333 Hz on channel A, and about 1.3 kHz once a counter decodes the quadrature at 4x. No poll interval and no 4 ms discrete input can follow that train, so length totals come out short and speed readings jump around. The fix is an ownership split: count in a PLC high-speed counter input, do the length and speed math in the PLC, and let SCADA read ordinary registers at whatever pace the screens need. The checks below run the pulse-rate arithmetic, rule out each PC-side shortcut in turn, and settle who owns the encoder, the operator link and any future control.
What a polled remote I/O head actually delivers #
An Ethernet remote I/O head with no control scan of its own is a slave: it holds an image of its input points and hands that image to the PC master when asked. Each response is the bit state at one instant. A 333 Hz input toggles more than three times between two polls taken 10 ms apart, and the head reports none of that — only whether the bit happened to be ON at the moment of the poll. Desktop scheduling and Ethernet retries jitter the interval on top. The loss is built into sampling: it is not a driver setting, a timeout or a client configuration problem, so no amount of tuning recovers the pulses.
Check the pulse rate against the input before wiring anything #
Three rates decide the design, and the first two are properties of your machine:
- pulses per metre = encoder PPR ÷ metres of line travel per encoder revolution
- channel A frequency in Hz = (line speed in m/min ÷ 60) × pulses per metre
- count rate at 4x decode in Hz = 4 × channel A frequency, because a 4x decoder counts on every A and B state change, four counts per encoder cycle
Compare the count rate against two ceilings. A discrete input with a 4 ms OFF-to-ON response needs every pulse to hold ON for at least 4 ms, so it follows at most 1 s ÷ (4 ms + 4 ms) = 125 Hz of square wave. A standard input read by the scan counts at most one pulse per scan, so a 10 ms scan caps it near 100 Hz. Both ceilings fail long before the network matters.
Worked example: 100 PPR encoder on a line at 200 m/min #
Inputs, each with its source:
- Encoder: 100 PPR per channel, quadrature output — the monitor project's selected encoder.
- Line speed: 200 m/min maximum — the monitor project's specification.
- Drive ratio: 1.000 m of line per encoder revolution — assumed, as a 1 m measuring wheel or wrap roll. The project does not state the wheel size, so this is the declared assumption; every result scales by PPR ÷ metres per revolution.
- Decode: 4x quadrature — the documented mode whose count changes on every A and B state transition.
- Comparison input: a standard 24 V DC discrete input with a 4 ms OFF-to-ON response.
Rule in words: divide the line speed by 60 for metres per second, multiply by pulses per metre for the channel A frequency, and multiply channel A by four for the count rate.
Arithmetic:
- 200 m/min ÷ 60 s/min = 3.33 m/s
- 3.33 m/s × 100 pulses/m = 333 Hz on channel A
- 4 × 333 Hz ≈ 1333 Hz, about 1.3 kHz counted at 4x
- Discrete input: 1 ÷ 333 Hz = 3.0 ms pulse period, so at the nominal 50% duty each pulse is ON about 1.5 ms — under half the 4 ms the input needs, so it misses most pulses outright
- 125 Hz ceiling: 333 Hz sits 2.7 times above it, and staying under that ceiling would take a 3.33 m/s × 100 ÷ 125 Hz ≈ 2.7 m circumference wheel
Result: a 1.3 kHz count rate that no sampled input, polled or scanned, can follow.
Decision: the count moves to hardware. Select inputs the controller's own high-speed counter specification rates at 20 kHz or more — more than ten times the 1.3 kHz count — and set the documented quadrature mode. Compact PLC high-speed inputs are commonly specified from 100 kHz upward; one documented small controller accepts 0 to 250 kHz, nearly 190 times this count. A standard counter instruction is not a fallback: scan-driven counters are rated near 10 Hz, thirty times below channel A alone.
Handoff numbers for the same case: latch the accumulator every 1.000 s and the PLC holds about 1333 counts per latch. 1333 ÷ 400 counts/m = 3.33 m per second, × 60 = 200 m/min. Two constants — 400 counts per metre and the 1 s latch interval — turn the raw count into the length and speed registers the SCADA reads.
Quick fixes that fail on a PC-mastered link #
Each one gets proposed because the symptom looks like a configuration problem. None survives the numbers:
- Poll the remote I/O head faster. A shorter interval is still a snapshot rate. Against a 3 ms pulse period even 1 ms polls miss edges, and desktop scheduling jitter drops and duplicates transitions at random.
- Count edges in a custom client from polled input bits. Any pulse shorter than the poll interval is invisible, so the missing count grows with line speed; a link that looks acceptable at commissioning speed fails at production speed.
- Wire the encoder to a plain discrete input. The response-time check fails at speed before any program runs; the worked example above is that failure in numbers.
- Rely on scan time. With a 3 ms pulse period against a 10 ms scan, the program sees the input ON in one scan out of several and counts one pulse where more than three arrived.
- Keep the accumulator in the PC. A reboot or a frozen screen stops the count, and the metres produced during the outage never reach the history.
A polled remote I/O head behind an OPC server remains a sound way to move slow discrete and analog values into a client. The pulse train is the one signal on that link that cannot be sampled, and it does not belong there.
The fix: count in PLC hardware, sample registers from SCADA #
Wire channels A and B to the inputs the controller's manual documents as high-speed counter inputs, set the documented quadrature mode, and confirm the rated maximum input frequency clears your count rate with margin — the 20 kHz selection floor from the example. The PLC then does the only real-time work on the job: latch the accumulator on a fixed timer, convert each delta to metres with counts per metre, and divide by the latch interval for speed. Everything downstream reads results, not pulses.
The SCADA client and the operator panel then sample ordinary registers, which is safe at any poll rate because no pulses exist between polls to lose; only the freshness of the number changes. Structuring that read — address map and update rate against a small controller — is the same job as in how a SCADA client reads a small PLC over EtherNet/IP. If the client machine lives at the line instead of in an office, spec it as an industrial panel PC for the SCADA client alongside the cabinet switch, and leave the controller's serial ports free for programming.
Keep the count alive and leave control in the PLC #
Put the communication alarm in before commissioning so a dropped link raises an alarm instead of showing a frozen value; the setup is the one in how to create a SCADA PLC communication alarm for link loss. With the count in the PLC, a PC reboot costs a gap in the trend, not metres: the accumulator keeps counting and the client re-reads the register on reconnect.
Future control is the same ownership decision. A PC-mastered remote I/O link closes outputs only while the PC, its operating system and the network are all up, so before running any control that way, verify on the bench what the head's outputs do when the Ethernet cable is pulled under load — if that state is not a safe state for the line, the logic belongs in a PLC. For monitor-only duty, offline from the process, a polled remote I/O head is a sound choice for slow points. For a line that will be controlled one day, the PLC owns the I/O and the PC stays a supervisor.
Questions asked
How fast can the SCADA poll the accumulated count register?
As fast or as slow as the screens need. Sampling an accumulator loses nothing between polls because the PLC counts every pulse in hardware; only the freshness of the number changes. If the PLC latches and computes speed once per second, a poll every five seconds shows the same value a poll every second would. At 200 m/min a one-second latch holds about 1333 counts, so one count of jitter is about 0.075 percent of the reading.
What happens to the length total when the SCADA PC reboots?
Nothing, provided the count lives in the PLC: the high-speed counter accumulates through the reboot and the client re-reads the register on reconnect. The trend shows a gap, so annotate it, but the length total itself stays continuous even though the time axis does not. If instead the count lives in the PC or a PC-mastered remote I/O head, counting stops at the freeze and the metres run during the outage never reach the history.
What length resolution does a 100 PPR encoder give?
At 4x decode the encoder yields 400 counts per metre with a 1 m wheel, which is 2.5 mm per count — ample for production length totals. At 1x decode the same encoder gives 100 counts per metre, or 10 mm per count. Add resolution only if the process needs better than 2.5 mm; raising it raises the count rate with it, so it never fixes a rate problem.
Below what line speed could a standard discrete input follow this encoder?
With a 4 ms OFF-to-ON response the ceiling is 125 Hz, which at 100 pulses per metre is 1.25 m/s or 75 m/min, and the scan read caps reliable counting nearer 60 m/min. Those numbers describe the input only. A PC poll samples bit states rather than counting, so even at low speed the pulse train belongs in a hardware counter.
Can a data acquisition card in the PC count the encoder instead?
Yes, if the card counts in its own hardware, as a counter or high-speed data acquisition card does, and the software reads its count register. Software capture of input bits timed by the operating system fails for the same reason a poll fails. Weigh it against ownership: the card counts pulses, but a PLC keeps counting through a PC reboot and holds the control logic in the same cabinet.