Working principle of PLC control cabinet
First, scanning technology
When the PLC is put into operation, its working process is generally divided into three stages, namely input sampling, user program execution and output refresh three stages. Completing these three stages is called a scan cycle. During the entire operation period, the PLC's CPU repeats the above three stages at a certain scanning speed.
(1) Input sampling stage In the input sampling stage, the PLC reads all the input status and data in turn by scanning, and stores them in the corresponding unit in the I/O image area. After the end of the input sampling, the user program execution and output refresh phase. In both phases, even if the input state and data change, the state and data of the corresponding unit in the I/O map area will not change. Therefore, if the input is a pulse signal, the width of the pulse signal must be greater than one scan cycle to ensure that the input can be read in any case.
(2) User program execution stage In the user program execution stage, the PLC always scans the user program in sequence from top to bottom (ladder diagram). When scanning each ladder diagram, it always scans the control line composed of each contact on the left side of the ladder diagram first, and carries out logical operations on the control line composed of contacts in the order of first left and then right, first up and then down, and then refreshes the status of the corresponding bit of the logic coil in the system RAM storage area according to the results of logical operations; Or refresh the state of the corresponding bit of the output coil in the I/O map area; Or determine whether to execute the special function instructions specified in the ladder diagram.