A PLC program can be considered to behave as a permanent runningloop similar to that in Figure (a). The user’s instructions are obeyedsequentially, and when the last instruction has been obeyed the operationstarts again at the first instruction. A PLC does not, therefore, communicatecontinuously with the outside world, but acts, rather, by taking ‘snapshots’.
The action of Figure (a) is called a program scan, and the period ofthe loop is called the program scan time. This depends on the size of thePLC program and the speed of the processor, but is typically 2–5ms perK of program. Average scan times are usually around 10–50 ms.Figure (a) can be expanded to Figure (b). The PLC does notread inputs as needed (as implied by Figure (a)) as this would bewasteful of time. At the start of the scan it reads the state of all the connectedinputs and stores their state in the PLC memory. When the PLCprogram accesses an input, it reads the input state as it was at the start ofthe current program scan.As the PLC program is obeyed through the scan, it again does notchange outputs instantly. An area of the PLCs memory correspondingto the outputs is changed by the program, then all the outputs areupdated simultaneously at the end of the scan. The action is thus: readinputs, scan program, update outputs.The PLC memory can be considered to consist of four areas asshown in Figure (c).
Read the rest of this entry »