Thursday, January 27, 2011

The PLC program scan


The PLC program scan
A PLC program can be considered to behave as a permanent running loop similar to that in Figure (a). The users instructions are obeyed sequentially, and when the last instruction has been obeyed the operation starts again at the first instruction. A PLC does not, therefore, communicate continuously with the outside world, but acts, rather, by taking ˜snapshots.
The action of Figure (a) is called a program scan, and the period of the loop is called the program scan time. This depends on the size of the PLC program and the speed of the processor, but is typically 2“5ms per K of program. Average scan times are usually around 10“50 ms. Figure (a) can be expanded to Figure (b). The PLC does not read inputs as needed (as implied by Figure (a)) as this would be wasteful of time. At the start of the scan it reads the state of all the connected inputs and stores their state in the PLC memory. When the PLC program accesses an input, it reads the input state as it was at the start of the current program scan. As the PLC program is obeyed through the scan, it again does not change outputs instantly. An area of the PLCs memory corresponding to the outputs is changed by the program, then all the outputs are updated simultaneously at the end of the scan. The action is thus: read inputs, scan program, update outputs. The PLC memory can be considered to consist of four areas as shown in Figure (c).