2005PLC B&R
I scanning technique
After the PLC is put into operation, its working process is generally divided into three stages, namely input sampling, user program execution, and output refresh. Completing the above three stages is called a scanning cycle. During the entire operation period, the CPU of the PLC repeatedly executes the above three stages at a certain scanning speed.

In the input sampling stage, the PLC sequentially reads in all input states and data in a scanning manner and stores them in the corresponding units in the I/O image area. After the input sampling is completed, it enters the user program execution and output refresh phase. In these two stages, even if the input state and data change, the state and data of the corresponding units in the I/O image area will not change. Therefore, if the input is a pulse signal, the width of the pulse signal must be greater than one scanning cycle to ensure that the input can be read in any case

User program execution phase
During the execution phase of the user program, the PLC always scans the user program (ladder diagram) in a top-down order. When scanning each ladder diagram, always scan the control circuit composed of each contact on the left side of the ladder diagram first, and perform logical operations on the control circuit composed of the contacts in the order of left to right, top to bottom. Then, based on the results of the logical operations, refresh the corresponding bit status of the logical coil in the system RAM storage area

Or refresh the state of the corresponding bit of the output coil in the I/O image area; Or determine whether to execute the special functional instructions specified in the ladder diagram.
That is, during the execution of the user program, only the state and data of the input points in the I/O image area will not change, while the state and data of other output points and software devices in the I/O image area or system RAM storage area may change. Moreover, the program execution results of the ladder diagram listed above will affect the ladder diagram below that uses these coils or data