There are different means and ways of executing a user program. Normally a cyclic execution program is preferred and this cyclic operators are given due priorities. Programming process in a PLC happens cyclically with the following execution:
1. The processor reads the individual inputs, after the PLC is initialized. This status of the input is stored in the process- image input table (PII).
2. This processor will process the program stored in the program memory. This consists of a list of logic functions and instructions, which are successively processed, so that the required input information will already be accessed before the read in PII and the matching results are written into a process-image output table (PIQ). Also other storage areas for counters, timers and memory bits will be accessed during program processing by the processor if necessary.
3. The status from the PIQ will transfer to the outputs and then be switched on and/or off, in the third step after the processing of the user program. Afterwards it begins the execution of the next cycle from step 1.
The same cyclic process also acts upon an Relay Ladder Logic (RLL) program.
The microprocessor requires the time to complete one cycle is known as the scan time. After all rungs have been tested, the PLC then starts over again with the first rung. Of course the scan time for a particular processor is a function of the processor speed, the number of rungs, and the complexity of each rung.
A cyclically executing program can be interrupted by a suitably defined signal resulting in an interrupt driven mode of program execution (when fast reaction time is required). If the signal interrupting occurs at fixed intervals we can also realized time synchronous execution (i.e. with closed loop control function). The cyclic execution was synchronized by a real time clock is the most common program structure for a PLC. Programmers can also define the routines of error-handling in their programs. Specific and defined error procedures are then invoked if the PLC operating system encounters fault of given types during execution.