Glossary · PLC and control programming
Program cycle
Also known as: Program scan, Cycle time
German: Programmzyklus
In PLC technology, the program cycle is one complete execution of the cyclic user program from its first to its last instruction; its duration, the cycle time, is monitored by the controller.
- PLC programming
In one sentence
A program cycle is one full execution of the cyclic PLC user program; its duration, the cycle time, is monitored.
Example
The main program of a packaging machine needs about 4 ms per program cycle, with peaks of 7 ms when recipe data is copied.
How it applies
- Engineering: Program execution time depends on the code path: loops, data copies and conditional blocks make some cycles longer than others. Engineers design so that the worst case stays well within the cycle limit.
- Timing: Variations in cycle time produce Jitter. Functions that need equal time steps, such as control loops or integrators, belong in a Cyclic task with a fixed period rather than in a free-running program cycle.
- Commissioning: Controllers report current, minimum and maximum cycle times. These values are recorded under full load; a Watchdog timer limit is set with margin above the maximum.
- Documentation: State the measured cycle times and the configured limits in the commissioning report, and note functions that are sensitive to cycle time.
Program cycle vs. PLC scan
The program cycle covers the execution of the user program. The PLC scan includes the program cycle plus input and output image updates and system tasks. In everyday language, both words are used for the same thing; precise documents keep them apart.