A PLC(Programmable Logic Controller) is an industrial computer that automates a machine or process by monitoring inputs according to their processes or logic and making decisions based on them to control (turn on/off) their outputs.
nema defines a programmable logic controller as:
A digitally operated electronic device that implements specific functions such as logical sorting, timing, counting, and arithmetic via digital or analog input/output, an internal memorizer module that implements instructions via programmable memorizers, various types of machine inks, or processes
Basic working principle of plc
Scanning technique
When PLC is put into operation, its working process is generally divided into three stages: input sampling, user program execution and output refresh, and the completion of these three stages is called the scan cycle. During the entire operation period, the PLC’s CPU repeats the above three stages at a certain scanning speed
(A) Input sampling phase
During the input sampling phase, North reads all input status and data by scanning and stores it in the corresponding cell in the i0 image region. Once the input example is complete, move it to the user program execution and output refresh phase. 1769-IF8 detail In both stages, even if the input state and data change, the state and data of the corresponding unit in the io image area will not change. Therefore, if the input is a pulse signal, the width of the pulse signal must be greater than the scan period to ensure that the input can be read in any case.
(i) User program execution phase
In the execution stage of the user program, the PLC scans the user program (ladder diagram) from top to bottom. When scanning each ladder diagram, the control circuit composed of contacts on the left side of the ladder diagram is scanned first, and the control circuit composed of contacts first operates according to the sequence logic of left, right, up and down. Then, according to the result of logical operation, the logical coil is refreshed at the corresponding position in the memory area of the system RAM. Status: Either refresh the corresponding position of the output coil in the 1O image area: or determine whether to perform the special function indicated in the ladder diagram
That is to say, during the execution of the user program room, only the state and data of the input point in the 10 image area will not change, while the state and data of the other output points and software devices in the /0 image area or the system RAM storage area may change, and the ladder diagram above will be lower than the execution result of the program. Ladder diagram working with these lines or data: In contrast, the status or data of the logic coils refreshed in the ladder diagram below can only be used for the program at the top of the ladder diagram in the next scan cycle
(3) Output refresh phase
1769-IF8 Detail When the scan user program ends, the PLC enters the output refresh phase. During this time, the CPU refreshes all output latching circuits according to the corresponding state and data in the 1/0 mapped region, and drives the corresponding peripheral devices through the output circuit. At this time, it is the actual output of the PLC
The same ladder diagram is arranged in different order, and the execution results are different. In addition, the result of scanning the user program is different from the hard logic parallel operation of the relay control device. Of course, if the time taken by the scan cycle is negligible in the overall operation, then there is no difference between the two.
Generally, the scan cycle of PLC includes self-diagnosis, communication, etc., as shown in the figure below, that is, a scan cycle is equal to the sum of all times, such as self-diagnosis, communication, input sampling, user program execution and output refresh
The PLC hardware includes a power module, a 1/0 module, an external field output assembly, and some wires, terminals, and junction boxes. Field input components mainly include travel switch, push button switch and intermediate relay output contact. Field output components mainly include relays, solenoid valves, contactors and motors. Common failures in the hardware part are damaged components and loose wiring.