1. Input sample stage
Enter the sampling stage, PLC to scan works in order to sample all inputs input state and stored in the input image register, input mapping registers to be refreshed. Then enters the processing stage, during the program or other phases, even if the input state changes, enter map registers of will not change, input state changes only when the next scan cycle of input processing stages can be sampled.
2. Program execution stage
Program execution stage, the PLC program executed in a sequential scan. If the program indicated by a ladder diagram, you always press first, and then the next, in sequence, first left and then right. When program jump instruction is encountered, depending on whether the jump condition met to decide whether to jump. When the instruction involved in input and output States, PLC from the input image register and element mapping registers read out, according to user procedures for operation, the result of the mapping registers in the restore component. For symbol mapping registers, the contents will change as program execution process.
3. Output refresh phase
When all the program execution has been completed, enter the output stage. In this stage, the PLC maps the output register state associated with the output (output relay status) transferred to the output latch, and output through certain means, drive the external load.
Therefore, the PLC in a scanning cycle, sampling their input sample stage for input state. After entering the program implementation phase when PLC inputs will be blocked until the next scan cycle of the input sample stage to resample the input status. This way is called concentration sample in one scan cycle, concentrated period of time to sample the input state.
In the user program if the output more than one assignment, the last valid. In a scanning cycle, will only refresh the output stage output status output from the output mapping registers, the output interface is refreshed. At other stages in output has been preserved in the output mapping registers. Known as a concentrate output in this way.
For small PLC, I/O point number less user program is short, focused sampling, work output is generally used, although to a certain extent reduce the response speed of the system, but the PLC work most of the time when isolated from the external input/output devices, radically improves the system anti-interference ability and enhance the reliability of the system.
For large and medium PLC, I/O point numbers more control functions, the user program is longer, in order to improve the response speed of the system, can be sampled on a regular basis, fixed output mode, or interruption of the input, output, and intelligent I/O interfaces such as variety of ways.
From the above analysis shows that when PLC inputs the input signal changes to the PLC output to respond to changes in the input that will take some time, a phenomenon called the PLC input/output response lag. For general industrial controls, this lag is completely allowed. Should be aware of is that this response lag is not only caused by a PLC scan works, mostly PLC input filter of the input delay and output interface driver brings output delay time, also associated with the program. Latency is a PLC application system should pay attention to the design of an argument.