2026-10-23
An automation engineer is commissioning a high-speed packaging line with an ABB PLC. The line uses a servo-driven flying shear and a registration sensor. The program runs correctly in simulation, but on the real machine the shear fires 12 milliseconds late. The engineer checks the program logic. It is correct. The engineer checks the servo drive. It is correctly configured. The problem is the scan cycle. The user program is 8 milliseconds long, but the flying shear interrupt is being delayed by a non-interruptible block of code that runs for 15 milliseconds. The CPU cannot respond to the high-speed input until the current scan is complete. The engineer restructures the program to move the non-critical code into a lower-priority task. The shear now fires within 1 millisecond of the target. This guide explains how the CPU executes user programs in an ABB PLC system and why the execution model matters for deterministic control.
The CPU of an ABB PLC executes the user program in a repeating cycle called the scan cycle. The scan cycle has three phases: the input scan, the program execution, and the output update. During the input scan, the CPU reads the status of all input modules and stores the values in an internal memory area called the process image input. During the program execution, the CPU executes the user program instruction by instruction, using the process image values as the input data. During the output update, the CPU writes the results from the process image output to the physical output modules. The table below shows the scan cycle phases and their typical durations.
| Scan phase | Function | Typical duration (AC500 PM583) | Deterministic |
| Input scan | Read input modules into process image | 0.5 – 1.0 ms | Yes |
| Program execution | Execute user program instructions | 5 – 20 ms (depends on program size) | Mostly |
| Output update | Write process image to output modules | 0.5 – 1.0 ms | Yes |
| Housekeeping | Communication, diagnostics, memory management | 1 – 3 ms | No (varies) |
In our factory, we supply ABB PLC systems to machine builders and process plants. The scan cycle time is a critical specification for high-speed applications. The AC500 PM583 CPU executes a 1,000-instruction program in approximately 0.1 milliseconds, which allows a scan cycle of 5 to 10 milliseconds for a typical machine control program. Yueyang Tongtu E-commerce Co., Ltd. provides scan time calculations for our customers.
Not all instructions take the same amount of time to execute. The CPU executes some instructions in a single clock cycle, while others require multiple cycles. Boolean instructions, such as AND, OR, and NOT, are typically executed in one cycle. Data movement instructions, such as MOV, require two to four cycles. Floating-point math instructions require 10 to 50 cycles. Function block calls, such as PID controllers, require 50 to 200 cycles. The table below shows the typical execution time for common instruction types on an ABB PLC.
| Instruction type | Example | Execution time (µs) | Relative cost |
| Boolean | AND, OR, NOT | 0.01 – 0.02 | 1x |
| Integer math | ADD, SUB, MUL | 0.02 – 0.05 | 2 – 3x |
| Floating-point math | ADD_R, MUL_R | 0.10 – 0.30 | 10 – 15x |
| Data movement | MOV, MOV_R | 0.02 – 0.06 | 2 – 4x |
| Function block | PID, ramp, filter | 0.50 – 2.00 | 50 – 100x |
| Communication | Modbus read/write | 1.00 – 5.00 | 100 – 250x |
Automation engineer's note: The program execution time is dominated by the most expensive instructions. A program with 1,000 Boolean instructions and 10 PID function blocks will spend most of its scan time in the PID blocks. In our factory, we recommend that the engineer estimate the scan time by multiplying the number of instructions by the execution time for each type. If the estimated scan time exceeds the application requirement, the engineer should optimize the program by reducing the number of function block calls, using integer math instead of floating-point math where possible, and moving non-critical code to a slower task.
The standard scan cycle is not deterministic because the CPU may be interrupted by higher-priority tasks. ABB PLC systems support multiple tasks with different priority levels. A high-priority task, such as a motion control or high-speed counting task, can interrupt the main program and execute immediately. The main program resumes after the high-priority task is complete. The table below shows the task priority levels and their typical use cases.
| Task type | Priority | Typical cycle time | Use case |
| Cyclic task (main program) | Low | 10 – 50 ms | General machine control, HMI updates |
| Cyclic task (fast) | Medium | 2 – 10 ms | PID control, high-speed logic |
| Interrupt task (I/O) | High | Event-driven | Registration, high-speed counting |
| Interrupt task (timer) | High | 1 – 5 ms | Motion control, encoder feedback |
| System task | Highest | Background | Communication, diagnostics |
The interrupt latency is the time between the event and the start of the interrupt task. On an ABB PLC, the interrupt latency is typically 100 to 500 microseconds, depending on the CPU model and the current instruction. If the main program is executing a long function block, the interrupt may be delayed until the block is complete. In our factory, we recommend that the engineer keep the main program scan time below the required response time of the fastest interrupt task. Yueyang Tongtu E-commerce Co., Ltd. provides application support for task priority configuration.
The program execution time can be optimized in four ways. The first is to reduce the number of function block calls. Function blocks are the most expensive instructions. If a PID block is called every scan but the process only needs an update every 100 milliseconds, the block can be moved to a slower task. The second is to use integer math instead of floating-point math where precision is not critical. The third is to avoid unnecessary communication instructions in the main program. Communication should be handled by a separate task or by the system firmware. The fourth is to use the CPU's built-in diagnostics to measure the actual scan time and identify the most time-consuming blocks. The table below shows the optimization techniques and their typical impact.
| Optimization technique | Typical scan time reduction | Trade-off |
| Move PID to slower task | 20 – 40% | Slower PID response |
| Replace floating-point with integer math | 10 – 20% | Reduced precision |
| Reduce communication in main program | 15 – 30% | None (communication handled separately) |
| Optimize program structure (fewer blocks) | 10 – 25% | Requires program refactoring |
In our factory, we help customers optimize their ABB PLC programs for scan time. We provide a scan time analysis tool that runs on the PLC and reports the execution time for each program block. Yueyang Tongtu E-commerce Co., Ltd. offers training on program optimization and task configuration.
The CPU of an ABB PLC executes the user program in a repeating scan cycle: input scan, program execution, and output update. The scan time is determined by the number and type of instructions in the program. Function blocks and communication instructions are the most expensive. Interrupts and task priority allow the CPU to respond to high-speed events, but they introduce non-determinism if the main program is too long. By optimizing the program structure, moving non-critical code to slower tasks, and monitoring the scan time, engineers can achieve deterministic control for high-speed applications. Yueyang Tongtu E-commerce Co., Ltd. supplies ABB PLC systems and provides scan time analysis and program optimization support for our customers.
Yueyang Tongtu E-commerce Co., Ltd. supplies ABB PLC CPUs, I/O modules, and programming software. We provide scan time calculations, task priority configuration, and program optimization training for all of our products.