PLC controller refers to the programmable logic controller (Programmable Logic Controller, PLC for short), is a digital electronic device with a microprocessor for automation control of digital logic controller, can be loaded at any time the control instructions are stored in the memory and execution.
PLC controller is widely used in the field of industrial control, the following explains the working principle and operation of PLC controller:
The working principle of PLC controller
Scanning technology When the PLC is put into operation, its work process is generally divided into three stages, namely, input sampling, user program execution and output refreshment of three stages. Completion of the above three phases is called a scanning cycle. During the whole operation period, the PLC CPU repeats the above three phases at a certain scanning speed.
1. Input Sampling Phase During the input sampling phase, the PLC reads in all the input states and data sequentially in a scanning manner and stores them in the corresponding units in the I/O image area. After the end of input sampling, the user program execution and output refresh phase. During these two phases, even if the input states and data change, the states and data of the corresponding cells in the I/O image area do 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.
2. User Program Execution Phase During the user program execution phase, the PLC always scans the user program (ladder diagram) sequentially in a top-down order. In scanning each ladder diagram, and always first scan the left side of the ladder diagram by the contacts constitute the control line, and according to the first left and then right, first up and then down the order of the contacts constitute the control line for logical operations, and then according to the results of the logical operations, refresh the logic coil in the system RAM storage area in the state of the corresponding bit; or refresh the output coil in the corresponding bit of the state of the I / O image area; or determining whether or not to execute a special function instruction specified in the ladder diagram.
That is, during the execution of the user program, only the states and data of the input points in the I/O image area do not change, while the states and data of the other output points and the soft devices in the I/O image area or the system RAM memory area may change, and the ladder diagrams which are arranged on the top, the results of the execution of their programs will have an effect on the ladder diagrams which are arranged on the bottom and which are used with these coils or data; on the contrary, ladder diagrams which are arranged on the On the other hand, a ladder at the bottom of the ladder, the state or data of the logic coils that are refreshed will not be available to the program at the top of the ladder until the next scan cycle. If an immediate I/O instruction is used during program execution, I/O points can be accessed directly. That is, if an I/O instruction is used, the value of the input process image register will not be updated, the program will take the value directly from the I/O module, and the output process image register will be updated immediately, which is a little different from the immediate input.
3. Output Refresh Phase After scanning the user program, the PLC enters the output refresh phase. During this period, the CPU in accordance with the I / O image area corresponding to the state and data refresh all the output latch circuit, and then through the output circuit to drive the corresponding peripherals. At this point, the real output of the PLC.
PLC controller mode of operation Although the ladder diagram program used by the PLC is often used in many relays, timers and counters and other names, but the PLC is not physically inside the hardware, but the memory and programming to do the logic control editing, and through the output components connected to the external mechanical devices to do the physical control. Therefore, the hardware space required for the controller can be greatly reduced. In fact, the PLC executes the ladder program by scanning the ladder program code into the CPU line by line and finally executes the control operation. The whole scanning process consists of three major steps, "Input Status Check", "Program Execution", and "Output Status Update", which are described as follows:
Step 1 "Input status check": The PLC first checks the status of the switches or sensors connected to the input components (1 or 0 for on or off) and writes their status to the corresponding position Xn in the memory.
Step 2 "Program Execution": The ladder program is loaded into the CPU line by line for operation. If the input contact status is required for program execution, the CPU will query and retrieve it directly from the memory. The result of output coil operation is stored in the corresponding position in the memory and is not reacted to the output terminal Yn for the time being.
Step 3 "Output status update": The output status in step 2 is updated to the PLC output contacts and the program returns to step 1. These three steps are called the PLC scanning cycle, and the time required for completion is called the PLC response time. If the PLC input signal time is less than this response time, there is a possibility of misreading. After each program execution and before the next program execution, the output and input status will be updated once, so this operation is called "end-of-program regeneration" for the outputs and inputs.




