A PLC executes control logic by repeating a sequential scan. Each scan centrally samples the inputs, executes the program, and then centrally refreshes the outputs. This operating model explains why a physical input change may not affect the logic or outputs immediately.
PLC Scan Cycle Sequence
| Phase | PLC action | Engineering consequence |
|---|---|---|
| Input sampling | Collects the input signals for the scan. | The program evaluates the sampled states rather than continuously resampling physical inputs. |
| Program execution | Executes instructions sequentially. | Element image register contents can change as the program executes. |
| Output refresh | Updates the output signals as a group. | Logic results do not reach the outputs until the refresh phase. |
Why Input Changes Can Be Missed Until the Next Scan
If a physical input changes after input sampling while the program is executing, the new state is not read during that execution phase. The PLC reads it during the input-sampling phase of the next scan. When diagnosing an apparent stale input, compare the physical transition time with the scan phase instead of assuming that the program continuously reads the input terminal.
What Determines PLC Scan Time
Scan-cycle duration depends on CPU instruction-execution speed, the execution time required by each instruction, and the number of instructions executed. Evaluate all three factors when comparing scan times or investigating a response delay; instruction count alone does not determine scan duration.
Diagnosing I/O Response Delay
Centralized input sampling and output refreshing inherently introduce I/O response delay. Trace the response through the sequence below to separate expected scan behavior from a logic problem.
- Confirm when the physical input changes relative to input sampling.
- Observe the sampled input state used during program execution.
- Trace changes to the relevant element image registers as the program executes.
- Confirm that the calculated result reaches the physical output during output refresh.
FAQ
What are the three phases of a PLC scan cycle?
The phases are input sampling, program execution, and output refresh. The PLC repeats this sequence continuously.
Why does my PLC input update one scan late?
If the physical input changes during program execution, the new state is not sampled until the next scan. Check the sampled input state rather than relying only on the terminal state.
What determines PLC scan-cycle time?
Scan time depends on CPU instruction-execution speed, the time required by the executed instructions, and the number of instructions executed.