PLC Scan Time: Measure, Calculate & Troubleshoot
Quick answer
PLC scan time is the measured execution duration of a controller task or cyclic program pass. It is not automatically the task period or end-to-end I/O response time; priorities, interruptions, I/O update rates, communications and jitter also affect response.
Key Takeaways
- PLC scan time is the measured execution duration of a controller task or cyclic program pass. It is not automatically th...
- Beginner-level topic in PLC Fundamentals
- Commonly used in: Task watchdog and CPU-loading verification, Diagnosing missed pulses and delayed responses
Detailed Definition
Scan time is how long a particular cyclic execution takes. A simple PLC may expose one last, average and maximum scan value. A modern controller can run continuous, periodic and event tasks, each with its own execution time, period, priority and watchdog.
Do not use a generic “1–100 ms” range as a design guarantee. Measure the target controller under realistic communications, motion, messaging and worst-case branches. For a periodic task, verify both execution time and interval/jitter. End-to-end machine response also includes when the input is updated, when the task next runs and when the output module applies the result.
Evidence and scope
Measurement fields and task terminology were checked against current Rockwell Studio 5000 V38, Siemens STEP 7 V21 and CODESYS task-monitor documentation. Values are controller observations, not universal PLC timing ranges.
Technical review:
Critical behavior
- Task execution time, configured task period and end-to-end I/O response are different measurements.
- Maximum observed scan is more useful for deadline checks than a single last or average value.
- Higher-priority tasks, interrupts, communications and conditional code paths can create execution-time variation and jitter.
- Distributed I/O can update asynchronously to logic, so a fast task alone does not guarantee a fast field response.
- A watchdog is a fault boundary, not a design target; normal worst-case execution needs deliberate margin below it.
Verification checklist
- 1Record controller model, firmware, task type, priority, period and watchdog with every timing result.
- 2Reset and observe maximum scan through startup, normal production, faults, recipes and communication bursts.
- 3Measure task jitter or interval variation where the platform exposes it.
- 4Compare input pulse width and I/O update rates with the task schedule.
- 5Measure the physical input-to-output path when a response-time requirement is safety- or process-critical.
IEC and vendor terminology
Similar-looking instructions do not always have identical execution, initialization or storage behavior.
| Platform | Common term | What to verify |
|---|---|---|
| IEC / general control model | Cycle, task execution, interval | IEC defines program execution concepts, while the runtime decides the task model and timing diagnostics. |
| Rockwell Studio 5000 | LastScanTime / MaxScanTime | Program and Task objects expose scan values; task Rate and Watchdog are separate configuration values. |
| Siemens STEP 7 | Cycle time / OB runtime | Diagnostics depend on CPU family. S7-300/400 OB1 documents previous, minimum and maximum cycle values. |
| CODESYS | Last/average/max cycle time and jitter | The Task Configuration monitor separates cycle measurements from periodic jitter and configured interval. |
One cyclic response path
Physical input → module update → wait for task → execute logic → output update → device
└──── not all of these delays equal “scan time” ────┘Interpret a 10 ms periodic-task measurement
This example separates configured scheduling values from observed execution values.
| State / phase | Example value | What it means | Engineering use |
|---|---|---|---|
| Task interval | 10.0 ms | Requested time between task releases | Control update target |
| Last execution | 2.6 ms | Most recently observed task runtime | Live diagnostic only |
| Average execution | 2.3 ms | Mean over the monitor window | Trend normal loading |
| Maximum execution | 4.4 ms | Largest observed runtime since reset | Deadline and headroom review |
| Watchdog | 20.0 ms | Configured overrun fault boundary | Fault protection, not target |
Working LD and ST example
Capture task scan diagnostics without confusing units
Store the vendor diagnostic attributes in clearly named tags and alarm on an engineering limit below the watchdog.
Ladder Diagram
|--[ GSV Task MainTask LastScanTime → MainTaskLast_us ]----------------|
|--[ GSV Task MainTask MaxScanTime → MainTaskMax_us ]----------------|
|--[ MainTaskMax_us > EngineeringLimit_us ]--------------( ScanAlarm )----|Structured Text
(* Attribute names and units are platform-specific. *)
ScanUtilizationPct :=
DINT_TO_REAL(MainTaskMax_us) /
DINT_TO_REAL(MainTaskPeriod_us) * 100.0;
ScanAlarm := MainTaskMax_us > EngineeringLimit_us;Expected result: The diagnostic distinguishes observed maximum execution from the configured period. Verify the actual attribute units before using the calculation.
Failure modes and diagnostic checks
| Symptom | Likely cause | Check next |
|---|---|---|
| Average scan looks healthy but watchdog faults occur | Rare worst-case branch, preemption or communications spike | Reset and trend maximum scan, jitter and task overlaps during the full machine cycle. |
| Fast scan but slow output response | I/O update, network RPI, device or mechanical delay dominates | Timestamp or scope each stage from physical input to physical output. |
| Short sensor pulses disappear | Pulse is not sampled by the module/task path | Use latched/high-speed input hardware or a faster justified task. |
| Performance changed after a small edit | Different code path, online edit overhead or task interaction | Repeat the same acceptance test and compare maximum, not only last scan. |
Current primary and technical sources
These sources support the behavior summarized on this page. The project's controller, firmware and IDE help remain authoritative for implementation.
- Program scan-time monitor, Studio 5000 V38.02
Rockwell Automation — Last and maximum program scan fields
- GSV time and task attributes, Studio 5000 V38.01
Rockwell Automation — Program and task scan attributes
- Cyclic program OB1, STEP 7 V21
Siemens — Cycle execution and monitored OB1 values for S7-300/400
- Task Configuration monitoring
CODESYS Development — Last, average, maximum cycle time and jitter fields
Continue with the practical guide
Common Questions
What is Scan Time?
PLC scan time is the measured execution duration of a controller task or cyclic program pass. It is not automatically the task period or end-to-end I/O response time; priorities, interruptions, I/O update rates, communications and jitter also affect response.
When should I use Scan Time?
Scan Time is particularly useful in scenarios such as Task watchdog and CPU-loading verification and Diagnosing missed pulses and delayed responses. Consider implementing it when you need reliable, efficient solutions for these types of applications.
What should I verify before using Scan Time?
Record controller model, firmware, task type, priority, period and watchdog with every timing result. Reset and observe maximum scan through startup, normal production, faults, recipes and communication bursts. Measure task jitter or interval variation where the platform exposes it. Compare input pulse width and I/O update rates with the task schedule. Measure the physical input-to-output path when a response-time requirement is safety- or process-critical.
What are related concepts I should learn?
To fully understand Scan Time, you should also familiarize yourself with PLC (Programmable Logic Controller), Scan Cycle, and CPU (Central Processing Unit). These concepts work together in industrial automation systems.
Continue Learning
Ready to deepen your understanding of Scan Time? Here are some recommended resources:
Was this helpful?
Let us know if this glossary term helped you understand Scan Time better.
Your feedback helps us improve our glossary and create better content for the PLC programming community.
Quick Info
- Category
- PLC Fundamentals
- Difficulty
- Beginner
- Tier
- Important
About PLC Fundamentals
Core concepts and hardware components of programmable logic controllers