PLC is essentially an industrial computer, computer technology and traditional relay contactor controller technology combined with the product, but than the general computer has stronger and industrial process interface and more direct suitable for industrial control requirements of the programming language.

1. PLC structure

From the hardware structure, PLC is mainly composed of central processing unit (CPU), memory (ROM/RAM), input and output interface, power supply, expansion interface and programming interface and other external devices.

(1) CPU is the core of PLC, all logical operations and judgment are completed by it, and control the operation of all other components. There are two kinds of internal memory: one is system program memory, the other is user program and data memory. System program memory, mainly storage system management and monitoring programs and user programs for compilation and processing programs. The system program has been fixed by the manufacturer and cannot be changed by the user. User program and data memory RAM, mainly store user compiled applications and a variety of temporary data, intermediate results.

(2) Input and output unit is the input and output module, I/O module, input unit for receiving input device control signals. The output unit is used to drive the output device through the output circuit which has been processed by the host. The I/O expansion port connects the expansion unit to the basic unit.

(3) Power supply refers to the DC switching power supply for CPU, memory, I/O interface and other internal electronic circuit work.

PLC control was originally used to replace the relay contactcontrol,PLC user program (software) to replace the relay control circuit (hardware), therefore, for users,PLC can be equivalent to a lot of various “soft relay” and “soft wiring” set, And the user program is to use “soft wiring” will “soft relay” and “contact” according to certain requirements to connect the “control circuit”.

Two, PLC working process

PLC working process PLC uses the “sequential scanning, continuous circulation” mode of work, this process can be divided into input sampling, program execution, output refresh three stages, the whole process of scanning and execution of a required time known as a scanning cycle.

(1) PLC in the input sampling stage, in order to scan the way to read all input on/off state or input data, and this state into the input image register, that is, input refresh, and then into the program execution stage. During the execution of the program, the input state changes, and the contents of the input image register do not change and can only be read in during the input processing phase of the next scan cycle.

(2) PLC in the program execution stage, according to the first left after right, first up after down step, the execution of program instructions. The process is as follows: read the on/off state of the relevant component from the input image register and other component image registers, perform logical operation according to the user program, and then store the operation result in the relevant image register.

(3) after the execution of all instructions, the physical relay corresponding output image register on/off state in the output refresh stage transferred to the output register, to control the physical electrical on/off, this is the actual output of PLC.

Visible by PLC working process, in the PLC program execution stage, even if the input has changed, the content of the input status register will not change immediately, to wait until the next cycle input processing stage to change. The output signal temporarily exists in the output status register, until the end of a cycle, the CPU will set all these output signals to the output latch, which becomes the actual CPU output. Therefore, the change of all input and output states requires a scan cycle, in other words, the input and output states maintain a scan cycle.

PLC programming language

Like other computer devices, THE OPERATION of PLC is carried out in accordance with its program operation. The INTERNATIONAL Electrotechnical Commission in IEC61131 has stipulated the STANDARD of PLC programming language and 5 kinds of programming language. Although different PLC manufacturers, different types of machines, the expression of different, but basically in line with the IEC61131 programming standards.

  1. Ladder Diagram

Ladder diagram is a programming language to express the control relationship by graphic symbols and their relationship in the diagram, which is evolved from the relay contactor control circuit diagram. Ladder diagram simplifies the relay contactor control circuit diagram, but the realized function is much more than the traditional relay contactor control circuit, is the most widely used programmable controller programming language. The drawing method of its symbols should be in accordance with certain rules. Although the symbols and rules of various manufacturers are not the same, the principle is basically similar with minor differences.

2. Instruction List

Instruction table is an instruction mnemonic to compile PLC program language, it is similar to the computer assembly language. Statement is the basic unit of instruction table programming language, can directly manipulate the CPU register and memory space, each control function by one or more statements composed of the program to perform.

3. Sequential Function Chart

Sequential function diagram is a novel graphic programming language based on process flow chart. It is a preferred programming language recommended by IEC standards and has been popularized and promoted in PLC programming in recent years. It is suitable for sequential control programming.

4. Function Block Diagram

Function diagram programming language is actually a graphical language that uses function blocks composed of logical function symbols to express commands. Similar to the logic diagram in digital circuits, it is easy to express the logical functions between conditions and results. It is easy for those who have a basic knowledge of digital circuits to grasp. Siemens’ LOGO! Function block diagrams are used for programming in line-out microplCs, which are otherwise rarely used.

5. Structure Text

With the rapid development of programmable controller, if many advanced functions are represented by ladder diagram, it will be very inconvenient. In order to enhance the programmable controller’s functions of number operation, data processing, chart display, report printing and so on, and facilitate the use of users, many large and medium-sized programmable controllers are equipped with PASCAL, BASIC, C and other high-level programming languages. This type of programming is called structured text. Compared with trapezoidal diagram, structured text has two great advantages, one is to achieve complex mathematical operations, and the other is very concise and compact.

Four, PLC technical indicators and main functions and characteristics

How to evaluate the performance of a PLC?

(1) I/O points

Refers to the number of input and output terminals outside PLC.

(2) Storage capacity of user programs

Used to measure how much the PLC can store user programs.

(3) Scanning speed

Refers to the time required to scan a 1000-step user program, in ms/ thousand steps.

(4) Number of instruction systems

Refers to the type and number of basic instructions and advanced instructions that PLC has. The more variety, the more powerful the software.

(5) Type and quantity of programming elements

Programming elements include input relay, output relay, auxiliary relay, timer, counter, general “word” register, data register and special function relay, etc. Its kind and quantity is an index to measure PLC.