PLC Scan Time & Throughput Estimator

This industrial-grade estimator calculates the Scan Cycle Time for PLCs/PACs. It uniquely models Periodic Interrupt Loading, Network Protocol Overhead (EtherNet/IP vs Modbus), and Logic Branching to provide a realistic "Worst Case" vs "Typical" analysis.

Hardware Platform

Logic & Execution

Periodic Interrupts (Tasks)

Network & I/O

Validation

Simple Machine Process Skid High-Speed Sortation
Logic Time
-- ms
Base Execution
CPU Load
-- %
Interrupts: --%
Total Scan
-- ms
--

Cycle Time Breakdown

Industrial Calculation Detail

Engineering Assessment

Run a calculation to view the engineering assessment.

Control Systems Engineering Guide

1. What This Tool Does

This software models the internal execution cycle of Programmable Logic Controllers (PLCs) and Programmable Automation Controllers (PACs). It moves beyond simple instruction counting by simulating the complex interaction between Continuous Tasks, Periodic Interrupts, and Communication Overhead.

It is designed for System Integrators and Control Engineers to validate CPU selection during the design phase, ensuring the chosen hardware can handle the required logic, motion axes, and network traffic without tripping watchdog timers or causing task overlaps.

2. The Importance of Scan Time in Industrial Automation

Unlike general-purpose computing, industrial control relies on Determinism. The "Scan Time" is the heartbeat of the automation system. If the scan time is too high or fluctuates wildly (Jitter), the consequences can be severe:

  • Missed Inputs: Short duration sensor pulses (e.g., product counting sensors) may be missed if the scan time exceeds the pulse duration.
  • PID Instability: Control loops rely on a consistent time delta ($dt$) for integration and differentiation. Jitter causes the derivative term to spike, leading to erratic valve/VFD behavior.
  • Motion Errors: High-speed packaging machines require precise synchronization. Lag in logic execution results in position errors and product waste.

3. Deep Dive: IEC 61131-3 Task Models

Modern PACs (like Rockwell ControlLogix or Siemens S7-1500) utilize a multitasking operating system. Understanding the task priority model is crucial for accurate estimation.

Task Types Explained

  • Continuous Task: The lowest priority task. It runs in the background, utilizing whatever CPU time is left after interrupts and system overhead are processed. Most general logic (safety interlocks, sequencing) resides here.
  • Periodic Task (Interrupt): A high-priority task triggered by a timer (e.g., every 10ms). It interrupts the continuous task. Used for PID loops and Motion planning. The calculator's "Interrupt Load" factor models this preemption.
  • Event Task: Triggered by a specific hardware event (e.g., Input Registration). These provide the fastest response but are non-deterministic regarding scan impact.

4. Network Overhead: EtherNet/IP vs. PROFINET

The choice of fieldbus protocol significantly impacts CPU load. This calculator applies specific overhead factors based on the protocol selected:

  • EtherNet/IP (CIP): Uses the TCP/IP stack. The CPU must encapsulate/decapsulate CIP packets inside UDP frames. This context switching adds noticeable overhead (~80µs per node) for implicit I/O messaging.
  • PROFINET RT: Operates at Layer 2 (Data Link), bypassing the TCP/IP stack for real-time data. This creates significantly less CPU burden (~30µs per node), allowing for faster scan times with high node counts.
  • Modbus TCP: While simple, the connection-oriented nature of TCP and the request/response model creates relatively high CPU overhead per transaction (~150µs) compared to cyclic protocols.

5. The Nyquist Theorem & PID Update Rates

A common engineering error is placing PID loops in the Continuous Task. This violates the requirements for stable discrete-time control. PID loops should be in a Periodic Task.

The Golden Rule: The scan rate of the PID task must be at least 5 to 10 times faster than the process time constant ($\tau$). For a temperature loop with a 10-second response time, a 1-second scan is sufficient. For a pressure loop with a 50ms response, a 5ms scan is required.

6. Frequently Asked Questions (FAQ)

What is a PLC Watchdog Timer?
A Watchdog Timer is a safety mechanism that monitors the PLC scan cycle. If the logic execution takes longer than the configured watchdog limit (e.g., 500ms) due to an infinite loop or hardware fault, the watchdog trips, forcing the CPU into a fault mode and de-energizing outputs to a safe state.
How does RPI affect PLC scan time?
Requested Packet Interval (RPI) determines how often I/O modules send data. A faster RPI (e.g., 2ms) increases the network interrupt load on the CPU. The CPU must process packets more frequently, which 'steals' time from the main logic scan, effectively increasing the total scan cycle.
Why is my PLC scan time fluctuating (Jitter)?
Scan time jitter is usually caused by asynchronous events: Explicit Messaging (MSG instructions), HMI communication requests, or variable logic paths (e.g., executing a complex FOR loop only when a specific condition is true). High network traffic is a common cause of jitter.
What is the ideal scan time for PID loops?
PID loops should be deterministic. They should generally execute in a Periodic Task rather than the Continuous Task. A rule of thumb (based on the Nyquist theorem) is that the PID update rate should be at least 5 to 10 times faster than the process time constant (tau) to ensure stable control.
What is the difference between Scan Time and Response Time?
Scan Time is the time the CPU takes to execute logic. Response Time (I/O to I/O) is longer: Input Delay + Scan Time + Output Delay. For a 10ms scan, the actual response to a sensor might be 20-30ms depending on when the input turned on relative to the scan cycle.
How does HMI polling affect the PLC?
HMI communications are usually processed during the "System Overhead" time slice. Aggressive polling (e.g., requesting 500 tags every 100ms) can saturate this time slice, causing the main scan to extend if the "Comms Overhead" setting is high, or resulting in sluggish HMI updates if the PLC prioritizes logic.
Do Task Priorities matter?
Yes. A higher priority periodic task (e.g., Motion at priority 2) will interrupt a lower priority periodic task (e.g., PID at priority 10). If high-priority tasks run too frequently or take too long, lower priority tasks may experience "Task Overlap" or starvation, never executing.
Why does Scan Time spike during Online Edits?
When accepting an online edit, the PLC momentarily locks memory to swap the old logic with the new logic. This process involves consistency checks and pointer updates, which often adds a significant one-time spike (e.g., +50ms to +200ms) to the scan cycle, potentially tripping sensitive watchdogs.