The PLC program scan

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).

PLC program scan and memory organization
The inputs are read into an input mimic area atthe start of the scan, and the outputs updated from the output mimicarea at the end of the scan. There will be an area of memory reservedfor internal signals which are used by the program but are not connecteddirectly to the outside world (timers, counters, storage bits, e.g. faultsignals, and so on). These three areas are often referred to as the datatable (Allen Bradley) or the database (ASEA/ABB).
This data area is smaller than may be at first thought. A medium-sizePLC system will have around 1000 inputs and outputs. Stored as individualbits this corresponds to just over 60 storage locations in a PLCwith a 16-bit word. An analog value read from the plant or written tothe plant will take one word. Timers and counters take two words (onefor the value, and one for the preset) and 16 internal storage bits takejust one word. The majority of the store, therefore, is taken up by thefourth area, the program itself.

Leave a Reply

You must be logged in to post a comment.