Basic structurePLC is essentially a kind of computer dedicated to industrial control, and its hardware structure is basically the same as that of a microcomputer.
Product details:
Central processing unit
The central processing unit(CPU) is the control center of the PLC. It receives and stores user programs and data typed from the programmer according to the functions given by the PLC system program; Check the state of the power supply, memory, I/O, and alert timer and can diagnose syntax errors in the user program. When the PLC is put into operation, it first receives the status and data of the input devices on the site in a scanning manner, deposits them into the I/O image area, and then reads the user program one by one from the user program memory. After the command explanation, the result of performing a logical or arithmetic operation according to the instructions is sent to the I/O image area or data register. After all user programs are executed, the data in the output state or output register of the I/O image area is finally transmitted to the corresponding output device. This loop runs until it stops running.
In order to further improve the availability of PLC, in recent years, double CPUs have also been used to form redundant systems for large PLCs, or three-CPU voting systems. In this way, even if a CPU fails, the entire system can still run normally.
memory
The storage of system software is called system program memory.
The memory that holds the application software is called the user program memory.
power supply
PLC's power supply plays a very important role in the entire system. PLC manufacturers also attach great importance to the design and manufacture of power sources without a good, * available power supply system. General AC voltage fluctuations in the + 10 %(+ 15 %) range, PLC can be directly connected to the AC grid without taking other measures.
The program input device is responsible for providing the operator with input, modification, and monitoring functions used by the program
The input-output loop is responsible for receiving external input component signals and external output component signals.
operating principle
Scan technology
When PLC is put into operation, its working process is generally divided into three stages, namely input sampling, user program execution and output refresh. The completion of the above three stages is called a scanning cycle. During the entire run, the PLC CPU repeats the above three stages at a certain scanning speed.
(I) Input sampling phase
During the input sampling phase, PLC reads all input States and data in a scanning manner and deposits them into the corresponding units in the I/O image area. After the input sample is finished, it is transferred to the user program execution and output refresh phase. In these two stages, the state and data of the corresponding unit in the I/O image area will not change even if the input state and data change. Therefore, if the input is a pulse signal, the width of the pulse signal must be greater than a scanning cycle to ensure that in any case, the input can be read.
(II) User program execution phase
During the user program execution phase, PLC always scans the user program(ladder map) in descending order. When scanning each ladder map, the control line consisting of each contact point on the left side of the ladder is always scanned first, and the control line consisting of contacts is logically calculated in the order of first left, then right, first up and then down. Then according to the result of logical operation, refresh the state of the corresponding bit in the system RAM storage area; Or refresh the state of the output coil in the I/O image area; Or determine whether you want to perform the special function instructions specified in the ladder diagram.
That is, during the execution of the user program, only the state and data of the input point in the I/O image area will not change. The status and data of other output points and soft devices in the I/O image area or the system RAM storage area may change, and the ladder diagram listed above, The results of the program execution will play a role in the ladder diagram that is listed below where these coils or data are used; Instead, in the ladder diagram below, the state or data of the refreshed logic coil can only work on the program above it until the next scanning cycle.
(III) Output refresh phase
When the scanning user program is over, the PLC enters the output refresh phase. During this period, the CPU refreshed all output locking circuits according to the corresponding state and data in the I/O image area, and then drove the corresponding peripheral through the output circuit. At this time, it is the real output of PLC.
The same number of ladder charts are arranged in different order and the results of execution are also different. In addition, the results of the running of the scanning user program are different from those of the hard logic running of the relay control device. Of course, if the time taken by the scanning cycle is negligible for the entire operation, there is no difference between the two.
In general, the PLC scanning cycle includes self-diagnosis, communication, etc., as shown in the figure below, that is, a scanning cycle is equal to the sum of all time such as self-diagnosis, communication, input sampling, user program execution, and output refresh.
Application area
At present, PLC has been widely used in various industries such as steel, petroleum, chemicals, electricity, building materials, machinery manufacturing, autos, textile, transportation, environmental protection, and cultural and entertainment. The use can be roughly summarized as follows.
Logical control of switching quantities
This is the most basic and most extensive application field of PLC. It replaces the traditional relay circuit and realizes logical control and sequential control. It can be used not only for the control of a single device, but also for multi-machine group control and automation pipelines. Such as injection molding machine, printing press, bookmaking machine, combination machine tool, grinder, packaging production line, electroplating production line.
Simulation control
In the industrial production process, there are many continuous changes, such as temperature, pressure, flow, liquid level and speed are analog quantities. In order for the programmable controller to handle the analog quantity, the A/D conversion and the D/A conversion between the analog quantity and the digital quantity must be implemented. PLC manufacturers produce supporting A/D and D/A conversion modules that allow programmable controllers to be used for analog control.
Movement control
PLC can be used for circular motion or linear motion control. From the point of view of the control mechanism configuration, the early use of the switch I/O module to connect the position sensor and the actuator, now generally uses a dedicated motion control module. For example, a single-axis or multi-axis position control module that can drive a stepper motor or servo motor. Almost all of the world's major PLC manufacturers have motor control functions and are widely used in various machinery, machine tools, robots, elevators and other occasions.
process control
Process control refers to the closed-loop control of simulated quantities such as temperature, pressure, and flow. As an industrial control computer, PLC can compile various control algorithm programs and complete closed-loop control. PID adjustment is a more commonly used adjustment method for general closed-loop control systems. Both large and medium-sized PLCs have PID modules, and many small PLCs currently have this function module. PID processing is generally a dedicated PID subroutine. Process control has a wide range of applications in metallurgical, chemical, heat treatment, boiler control and other occasions.
data processing
Modern PLC has mathematical operations(including Matrix operations, function operations, logic operations), data transmission, data conversion, sorting, lookup tables, bit operations and other functions, and can complete data collection, analysis, and processing. These data can be compared with the reference values stored in the memory, perform certain control operations, or use the communication function to transmit to other smart devices, or print them. Data processing is generally used for large-scale control systems, such as unmanned flexible manufacturing systems; It can also be used for process control systems such as some large control systems in the paper, metallurgical, and food industries.
Communications and networking
PLC communication includes communication between PLCs and between PLCs and other intelligent devices. With the development of computer control, the factory automation network has developed rapidly. All PLC manufacturers attach great importance to the communication function of PLC and have launched their own network systems. Recently produced PLC has communication interface, communication is very convenient.