Marcio Cunha

Industrial Network Monitoring: Collecting Jitter and Packet Loss Metrics in PLCs

Learn how to monitor jitter and packet loss in Programmable Logic Controllers to prevent unexpected industrial automation shutdowns.

Marcio Cunha•4 min
Also available in:PortuguêsEspañol
Summary
  • Severe latency variations in industrial networks cause silent synchronization failures between controllers.
  • Packet loss corrupts real-time data flow and deactivates devices due to safety timeouts.
  • Python telemetry scripts running on dedicated servers allow collecting metrics directly via the Modbus TCP protocol.
  • Continuous jitter analysis helps predict physical faults in shielded cables and network switches before production stops.
  • Centralized dashboards transform raw network data into clear indicators for maintenance and engineering teams.

The Silent Challenge of Industrial Networks

In the world of industrial automation, every millisecond counts. While traditional information technology handles minor delays gracefully when loading a web page, the factory floor relies on surgical precision. Programmable Logic Controllers (PLCs), which act as the electronic brains of machines, talk to each other and to sensors through dedicated networks. When these cables and signals begin to fail subtly, the production line suffers unexplained interruptions that challenge traditional engineering.

To understand the problem in practice, imagine an orchestra where every musician must play at the exact same instant. If the conductor loses the rhythm due to interference, the harmony collapses. In industry, the equivalent of this delay is called jitter, which is the variation in the delivery time of data packets. When combined with packet loss, where vital information simply disappears along the way, the system enters a silent collapse, triggering emergency stops for no apparent reason.

Understanding the Impact of Jitter and Packet Loss on PLCs

Jitter and packet loss directly affect determinism, a fundamental concept ensuring that a mechanical action occurs precisely at the planned moment. In modern industrial protocols like PROFINET, EtherNet/IP, or Modbus TCP, data travels in rigorous cycles called bus cycles. If a command packet suffers variable delays, the controller may interpret this as a loss of connection and cut power to a motor for safety.

In practice, this means a beverage bottling machine might stop mid-cycle because the PLC stopped receiving confirmation that the valve closed. Packet loss is not just a number on a monitoring screen; it represents thousands of dollars in wasted raw material and hours of halted machinery. Investigating these failures requires going beyond the traditional 'ping' and analyzing the internal behavior of the controller under network stress.

Metrics Collection Architecture in Automation Systems

Implementing an effective monitoring strategy requires an architecture that does not interfere with critical factory traffic. Placing heavy network scanning tools directly onto core switches can overload the hardware and cause the exact problem we are trying to avoid. The ideal approach uses passive probes or lightweight polling routines directly targeting the diagnostic registers of the PLCs.

This collection is handled by local servers that periodically converse with the controllers, extracting CRC (cyclic redundancy check) error counters, discarded packets, and average response times. In practice, we create an invisible observer that notes network behavior in the background, recording every fluctuation for subsequent analysis by reliability engineers.

Practical Collection Implementation with Python and Modbus

To illustrate the collection of network and performance metrics concretely, we can use a Python script that connects to a Modbus TCP compatible PLC. The code below demonstrates how to query internal communication error registers and calculate request response times, simulating continuous telemetry collection.

import time
from pymodbus.client import ModbusTcpClient

PLC_IP = '192.168.1.50'
PLC_PORT = 502
ERROR_REGISTER = 2000

client = ModbusTcpClient(PLC_IP, port=PLC_PORT)

def collect_metrics():
    if not client.connect():
        print('Error: Could not connect to PLC.')
        return
    
    start = time.time()
    try:
        response = client.read_holding_registers(ERROR_REGISTER, count=2)
        end = time.time()
        
        latency_ms = (end - start) * 1000
        comm_errors = response.registers[0]
        lost_packets = response.registers[1]
        
        print(f'Latency: {latency_ms:.2f} ms | Errors: {comm_errors} | Lost: {lost_packets}')
    except Exception as e:
        print(f'Failed to read registers: {e}')
    finally:
        client.close()

if __name__ == '__main__':
    while True:
        collect_metrics()
        time.sleep(5)

The script above runs a safe infinite loop, measuring the exact interval the PLC takes to respond to a register read. If response times spike or error counters rise, the technical team receives an early warning before a catastrophic failure occurs on the production line.

Interpreting Data and Predicting Machine Stops

Collecting raw numbers is only the first step; the true value lies in the ability to turn this data into operational decisions. When jitter shows regular spikes, the problem is usually related to excessive broadcast traffic or improper packet prioritization (QoS) configuration on industrial switches. Meanwhile, constant packet loss points to direct physical failures, such as oxidized RJ45 connectors, cables crushed by trays, or electromagnetic interference generated by improperly grounded frequency drives.

In practice, cross-referencing these network metrics with equipment maintenance history allows the creation of simple predictive models. If we know a given shielded cable begins to degrade when jitter exceeds 15 milliseconds for more than ten consecutive minutes, we can schedule preventive replacement during break shifts, eliminating unplanned stops and optimizing operations.

Final Considerations on Industrial Reliability

Proactive monitoring of industrial networks is no longer a technical luxury but a vital necessity for modern factories seeking high availability. The combination of lightweight software tools, intelligent metric collection on PLCs, and rigorous jitter and packet loss analysis guarantees operational stability and protects manufacturing investments. Investing time in network infrastructure visibility is the safest path to shield production against unwanted surprises.