Electrical Engineering Learning Network: https://www.dgdqw.com
Follow the official WeChat account of the Electrical Engineering Learning Network “Electrical Engineering and Electrical Learning” to gain more experience and knowledge.
A Programmable Logic Controller (PLC) is a digital operation electronic system designed specifically for industrial environments. It uses a programmable memory to store instructions for executing logic operations, sequential control, timing, counting, and arithmetic operations internally, and controls various types of machinery or production processes through digital and analog inputs and outputs. The PLC and its related peripheral devices should be designed according to the principles of ease of integration with industrial control systems and ease of expansion of their functions.
Classification of PLCs
There are many types of PLC products, each with different specifications and performance. PLCs are generally classified based on their structural form, functional differences, and the number of I/O points.
1. Classification by Structural Form
Based on the structural form of PLCs, they can be divided into two categories: integrated and modular.
(1) Integrated PLC
An integrated PLC consolidates components such as power supply, CPU, and I/O interfaces into a single chassis, as shown in the figure. It is characterized by compact structure, small size, and low cost. Small PLCs generally adopt this integrated structure. An integrated PLC is composed of a basic unit (also known as the host) with different I/O points and expansion units. The basic unit contains the CPU, I/O interfaces, expansion ports connected to I/O expansion units, and interfaces connected to programmers or EPROM programmers; the expansion unit generally contains only I/O and power supply, without a CPU. The basic unit and expansion units are typically connected by flat cables. Integrated PLCs can also be equipped with special function units, such as analog units and position control units, to extend their functionality.
(2) Modular PLC
A modular PLC separates its components into several individual modules, such as CPU modules, I/O modules, power supply modules (some included in the CPU module), and various function modules. A modular PLC consists of a frame or base and various modules, which are installed in sockets on the frame or base, as shown in the figure. The characteristic of this modular PLC is flexible configuration, allowing for different system scales to be selected as needed, and is easy to assemble, expand, and maintain. Medium and large PLCs generally adopt a modular structure.
Some PLCs combine the characteristics of both integrated and modular types, forming what is known as a stacked PLC. The CPU, power supply, I/O interfaces, etc., of a stacked PLC are also independent modules, but they are connected by cables and can be stacked layer by layer. This allows for flexible system configuration while maintaining a compact size.
2. Classification by Function
Based on different functions, PLCs can be divided into low-end, mid-range, and high-end categories.
(1) Low-end PLC
Low-end PLCs have basic functions such as logic operations, timing, counting, shifting, as well as self-diagnosis and monitoring, and may have a small number of analog inputs/outputs, arithmetic operations, data transfer, comparison, and communication functions. They are mainly used in single-machine control systems for logic control, sequential control, or a small amount of analog control.
(2) Mid-range PLC
Mid-range PLCs have all the functions of low-end PLCs, plus stronger analog input/output, arithmetic operations, data transfer and comparison, base conversion, remote I/O, subroutine, and network communication functions. Some can also add interrupt control, PID control, etc., suitable for complex control systems.
(3) High-end PLC
High-end PLCs not only possess the functions of mid-range PLCs but also include signed arithmetic operations, matrix operations, bit logic operations, square root operations, and other special function calculations, tabulation and table transfer functions. High-end PLCs have stronger communication networking capabilities and can be used for large-scale process control or form distributed network control systems, thus achieving factory automation.
3. Classification by I/O Points
Based on the number of I/O points, PLCs can be divided into small, medium, and large categories.
(1) Small PLC
Small PLCs have fewer than 256 I/O points, with a single CPU and an 8-bit or 16-bit processor, and a user memory capacity of less than 4KB. For example: Mitsubishi FX0S series.
(2) Medium PLC
Medium PLCs have 256 to 2048 I/O points, with dual CPUs and a user memory capacity of 2 to 8KB.
(3) Large PLC
Large PLCs have more than 2048 I/O points, with multiple CPUs and 16-bit or 32-bit processors, and a user memory capacity of 8 to 16KB.
Globally, PLC products can be divided into three major schools based on region: one is American products, one is European products, and one is Japanese products. The PLC technologies in the US and Europe were independently developed in isolation, leading to significant differences in PLC products from the US and Europe. Japanese PLC technology was introduced from the US, inheriting certain aspects of American PLC products but focusing on small PLCs. The US and Europe are known for medium and large PLCs, while Japan is known for small PLCs.

Scan to Watch PLC Video Courses for Free
Common PLCs are as shown in the table:
Functions and Application Areas of PLC
PLC is designed and developed to integrate the advantages of relay contact control and the flexibility and convenience of computers, making PLCs possess many characteristics that other controllers cannot compare to.
1. Functions of PLC
PLC is a general industrial automation control device developed around a microprocessor, integrating computer technology, automatic control technology, and communication technology. It has a series of advantages such as high reliability, small size, strong functionality, simple and flexible program design, and easy maintenance, making it widely used in metallurgy, energy, chemical, transportation, and power industries, becoming one of the three pillars of modern industrial control (PLC, robotics, and CAD/CAM). Based on the characteristics of PLCs, their functional forms can be summarized as follows.
(1) Switch Logic Control
PLCs have powerful logic operation capabilities, enabling various simple and complex logic controls. This is the most basic and widespread application area of PLCs, replacing traditional relay contact control.
(2) Analog Control
PLCs are equipped with A/D and D/A conversion modules. The A/D module converts field analog quantities such as temperature, pressure, flow, and speed into digital quantities, which are then processed by the microprocessor in the PLC (which can only process digital quantities), and then control; or converted back into analog quantities through the D/A module to control the target object, thus enabling PLC control over analog quantities.
(3) Process Control
Modern medium and large PLCs are generally equipped with PID control modules for closed-loop process control. When a variable in the control process deviates, the PLC can calculate the correct output based on the PID algorithm, thereby controlling the production process and keeping the variable at the set value. Currently, many small PLCs also have PID control functions.
(4) Timing and Counting Control
PLCs have strong timing and counting capabilities, providing users with dozens or even hundreds or thousands of timers and counters. The timing and counting values can be set by users when writing user programs or by operators on the industrial site through programmers, thus achieving timing and counting control. If users need to count high-frequency signals, they can choose high-speed counting modules.

Scan to Watch PLC Video Courses for Free
(5) Sequential Control
In industrial control, sequential control can be implemented using PLC step instruction programming or shift register programming.
(6) Data Processing
Modern PLCs can perform arithmetic operations, data transfer, sorting, and table lookups, and also compare data, convert data, communicate data, display data, and print, showing strong data processing capabilities.
(7) Communication and Networking
Most modern PLCs adopt communication and networking technologies, with RS-232 or RS-485 interfaces for remote I/O control. Multiple PLCs can network and communicate with each other, allowing for program and data exchange between external devices and one or more programmable controllers, such as program transfer, data document transfer, monitoring, and diagnosis. Communication interfaces or processors complete program and data transfer according to standard hardware interfaces or proprietary communication protocols.
2. Application Areas of PLC
Currently, PLCs are widely used in various industries both domestically and internationally, including steel, petroleum, chemicals, electricity, building materials, machinery manufacturing, automotive, textiles, transportation, environmental protection, and cultural entertainment, with usage generally summarized into the following categories.
(1) Logic Control of Switch Quantities
This is the most basic and widespread application area of PLCs, replacing traditional relay circuits to achieve logic control and sequential control; it can be used for controlling single devices or for multi-machine group control and automated production lines, such as injection molding machines, printing machines, stapling machines, combination machine tools, grinding machines, packaging production lines, and electroplating production lines.
(2) Analog Control
In industrial production processes, many continuously varying quantities, such as temperature, pressure, flow, liquid level, and speed, are analog quantities. To enable PLCs to process analog quantities, A/D and D/A conversions must be implemented. PLC manufacturers produce matching A/D and D/A conversion modules for analog control.
(3) Motion Control
PLCs can be used for controlling circular or linear motions. In terms of control configuration, early PLCs directly used switch quantity I/O modules connected to position sensors and actuators; now, specialized motion control modules are generally used, capable of driving stepper motors or servo motors for single-axis or multi-axis position control. Almost all major PLC manufacturers’ products have motion control functions, widely used in various machinery, machine tools, robotics, elevators, etc.
(4) Process Control
Process control refers to closed-loop control of analog quantities such as temperature, pressure, and flow, with very wide applications in metallurgy, chemicals, heat treatment, and boiler control. As industrial control computers, PLCs can compile various control algorithm programs to complete closed-loop control. PID regulation is the most commonly used method in general closed-loop control systems, and medium and large PLCs generally have PID modules; currently, many small PLCs also have this functional module. PID processing generally runs a dedicated PID subroutine.
(5) Data Processing
Modern PLCs have mathematical operations (including matrix operations, function operations, and logic operations), data transfer, data conversion, sorting, table lookups, and bit operations, enabling data collection, analysis, and processing. These data can be compared with reference values stored in memory to complete certain control operations; they can also be transmitted to other intelligent devices using communication functions or printed and tabulated. Data processing is generally used in large control systems, such as unmanned flexible manufacturing systems; it can also be used in process control systems, such as in large control systems in paper making, metallurgy, and food industries.
(6) Communication and Networking
PLC communication includes communication between PLCs and communication between PLCs and other intelligent devices. With the development of computer control, factory automation networks have developed rapidly, and all PLC manufacturers attach great importance to PLC communication functions, each launching their own network systems. Newly produced PLCs generally have communication interfaces, making communication very convenient.
Basic Structure and Working Principle of PLC
As an industrial control computer, PLCs have a structure similar to that of ordinary computers; however, due to different usage scenarios and purposes, there are some structural differences.
1. Hardware Components of PLC
The basic structure of the PLC hardware system is as follows:
The main unit of the PLC consists of a CPU, memory (EPROM, RAM), input/output units, peripheral I/O interfaces, communication interfaces, and power supply. For integrated PLCs, these components are all housed within the same casing. In the case of modular PLCs, each component is independently packaged, referred to as a module, and all modules are connected via racks and cables. Each part in the main unit is connected through power buses, control buses, address buses, and data buses, and certain external devices are equipped according to the actual control object needs, forming different PLC control systems. Common external devices include programmers, printers, EPROM programmers, etc. PLCs can be equipped with communication modules to communicate with host computers and other PLCs, forming distributed control systems.
The following sections introduce each component of the PLC and its functions, to help users further understand the control principles and working processes of PLCs.
(1) CPU
The CPU is the control center of the PLC, coordinating the work of various devices on-site under its control to achieve control over all devices in the field. The CPU consists of a microprocessor and a controller, capable of performing logic and mathematical operations, coordinating the work of various parts within the control system.
The controller’s role is to ensure that all components of the microprocessor work in an orderly manner, with its basic function being to read instructions from memory and execute them.
(2) Memory
PLCs are equipped with two types of memory: system memory and user memory. System memory is used to store system management programs, which users cannot access or modify. User memory is used to store compiled application programs and working data states. The part of user memory that stores working data states is also known as the data storage area, which includes input/output data image areas, timer/counter preset values and current values, and buffers for storing intermediate results.
The memory of PLCs primarily includes the following types:
a. Read-Only Memory
b. Programmable Read-Only Memory
c. Erasable Programmable Read-Only Memory
d. Electrically Erasable Programmable Read-Only Memory
e. Random Access Memory
(3) Input/Output (I/O) Modules
a. Switch Quantity Input Modules
Switch quantity input devices include various switches, buttons, sensors, etc. The input types of PLCs can generally be DC, AC, and AC/DC. The power supply for the input circuit can be provided externally, and some can also be supplied internally by the PLC.
b. Switch Quantity Output Modules
The output module’s role is to convert the control signals output by the CPU executing the user program into signals that can drive specific devices required in the production field, thus driving the actions of the actuators.
(4) Programmer
The programmer is an important external device for PLCs, allowing users to send user programs into the PLC’s user program memory, debug programs, and monitor the execution process. Programmers can be classified into the following three types:
a. Simple Programmer
b. Graphic Programmer
c. General Computer Programmer
(5) Power Supply
The power supply unit converts external power sources (220V AC power) into internal working voltage. The externally connected power supply is converted into the working power required for the PLC’s internal circuits (DC 5V, ±12V, 24V) through a dedicated switch-mode power supply within the PLC, and provides 24V DC power for external input components (only for input terminals). The power supply driving the PLC load is provided by the user.
(6) Peripheral Interfaces
The peripheral interface circuit is used to connect handheld programmers or other graphic programmers, text displays, and can form the PLC control network through peripheral interfaces. PLCs can connect to computers using PC/PPI cables or MPI cards through RS-485 interfaces, enabling programming, monitoring, and networking functions.
2. Software Components of PLC
The PLC software consists of system programs and user programs.
The system program is designed and written by the PLC manufacturer and stored in the PLC’s system memory, which users cannot directly read, write, or modify. The system program generally includes system diagnostic programs, input processing programs, compilation programs, information transfer programs, and monitoring programs.
The user program is the program compiled by users using the PLC programming language based on control requirements. In the application of PLCs, the most important task is to write user programs using the PLC programming language to achieve control objectives. Since PLCs are specially developed devices for industrial control, their main users are electrical technicians. To meet their traditional habits and capabilities, the main programming language of PLCs adopts a relatively simple, understandable, and visual specialized language compared to computer languages.
a. Graphical Instruction Structure
b. Clear Variables and Constants
c. Simplified Program Structure
d. Simplified Application Software Generation Process
e. Enhanced Debugging Tools
Basic Working Principle of PLC
The working method of PLC scanning mainly consists of three stages: input sampling stage, user program execution stage, and output refresh stage, as shown in the figure.
1. Input Sampling Stage
In the input sampling stage, the PLC sequentially reads all input statuses and data in a scanning manner, storing them in the corresponding units in the I/O image area. After the input sampling ends, it transitions to the user program execution and output refresh stages. During these two stages, even if the input statuses and data change, the statuses and data in the I/O image area do not change. Therefore, if the input is a pulse signal, the pulse width must be greater than one scanning cycle to ensure that the input can be read under any circumstances.
2. User Program Execution Stage
In the user program execution stage, the PLC always scans the user program (ladder diagram) in a top-down order. When scanning each ladder diagram, it first scans the control circuit composed of various contacts on the left side of the ladder diagram, performing logical operations on the control circuit in the order of left to right and top to bottom; then, based on the results of the logical operations, it refreshes the status of the corresponding bit in the system RAM storage area or refreshes the status of the corresponding bit in the I/O image area, or determines whether to execute the special function instructions specified by that ladder diagram. During the execution of the user program, only the input points in the I/O image area maintain their statuses and data, while other output points and soft devices in the I/O image area or system RAM storage area can change; moreover, the execution results of the ladder diagrams above affect those below that use these coils or data; conversely, the logical coils’ statuses or data refreshed by the ladder diagrams below can only affect the ladder diagrams above in the next scanning cycle.
3. Output Refresh Stage
After the user program scan ends, the PLC enters the output refresh stage. During this period, the CPU refreshes all output latch circuits according to the statuses and data in the I/O image area, then drives the corresponding external devices through the output circuits. At this point, it is the true output of the PLC.
Input/Output Lag Phenomenon
From the working processes of PLCs, the following conclusions can be drawn:
1. The program is executed in a scanning manner, and the logical relationships between input/output signals have a theoretical lag. The longer the scanning cycle, the more serious the lag.
2. The scanning cycle includes the time occupied by the three main working stages: input sampling stage, user program execution stage, and output refresh stage, as well as time taken by system management operations. Among these, the execution time of the program is related to the length of the program and the complexity of the instruction operations, while others remain relatively unchanged. The scanning cycle is generally in the nanosecond range.
3. During the nth execution of the program, the input data is based on the sampling values X from the sampling stage of the current scanning cycle, while the output data is based on the output values Y(n-1) from the previous scan and the current output values Y(n); thus, the signal sent to the output terminals is the final result Y(n) after executing all calculations.
4. The input/output response lag is related not only to the scanning method but also to the arrangement of program design.