Compared with the general computer language, the PLC programming language of the industrial computer has obvious characteristics. It is not only different from the language, but also different from the general assembly language. It must meet the requirements of being easy to write and easy to debug. Currently, there is no programming language that is compatible with products from all manufacturers. Such as Mitsubishi's products have its own programming language, OMRON's products also have its own language. But no matter what type of PLC
PLC programming languages all have the following characteristics:
1. Graphical instruction structure: The program is expressed graphically, and the instructions are composed of different graphic symbols, which are easy to understand and remember. The software developer of the system has compiled the independent computing functions required in industrial control into symbolic graphics, and users can combine these graphics according to their own needs and fill in the appropriate parameters. In the logic operation part, almost all manufacturers use the ladder diagram similar to the relay control circuit, which is easy to accept. For example, Siemens also uses the control system flow chart to represent it, which uses the binary logic component graphic symbols to express the control relationship, which is very intuitive and easy to understand. More complex arithmetic operations, timing counts, etc. are generally represented with reference to ladder diagrams or logic component diagrams. Although they are not as symbolic as logic operations, they are also popular with users.
2. Definite variable constants: Graphic symbols are equivalent to opcodes, specifying operation functions, and operands are filled in by the user, such as: K400, T120, etc. The variables and constants in the PLC and their value ranges are clearly defined, which are determined by the product model. You can refer to the product catalogue manual.
3. Simplified program structure: PLC program structure is usually very simple, typically block structure, different blocks complete different functions, so that the program debugger has a clear concept of the control function and control sequence of the entire program.
4. Simplify the application software generation process: use assembly language and language to write programs, to complete the three processes of editing, compiling and linking, while using programming language, only one process needs to be edited, and the rest is automatically completed by the system software, and the entire editing process is in the It is carried out under the man-machine dialogue and does not require users to have advanced software design capabilities.
5. Strengthen debugging methods: Whether it is assembler program or language program debugging, it is a headache for editors, and PLC program debugging provides complete conditions, using the programmer, using the buttons and display on the PLC and the programmer. And internal editing, debugging, monitoring, etc., and with software support, diagnosis and debugging operations are very simple.
In a word, the programming language of PLC is user-oriented, which does not require users to have advanced knowledge and does not require long-term specialized training.
The form of industrial computer PLC programming language
This textbook uses the two most commonly used programming languages, one is the ladder diagram, and the other is the mnemonic language table. Using ladder diagram programming, because it is intuitive and easy to understand, but requires a personal computer and corresponding programming software; using mnemonic form is convenient for experimentation, because it only requires a simple programmer instead of an expensive graphic programmer or computer to program.
Although some PLCs also have computer-compatible C language, BASIC language, special-purpose languages (such as Siemens' GRAPH5, Mitsubishi's MELSAP), and Boolean logic language, general-purpose computer-compatible assembly language, etc. In any case, the programming languages of various manufacturers can only be applied to their own products.
Programming Instructions: Instructions are codes or symbols that the PLC is told to do and how to do it. Essentially, the instructions are just some binary codes, which is exactly the same as a normal computer. At the same time, PLC also has a compilation system, which can compile some text symbols or graphic symbols into machine code, so the PLC instructions that users see are generally not machine codes but text codes or graphic symbols. Commonly used mnemonic sentences use English characters (multiple languages available) abbreviations and numbers to represent corresponding commands. A commonly used graphic symbol is a ladder diagram, which is similar to an electrical schematic diagram and is easily accepted by electrical workers.
Command system: The totality of commands possessed by a PLC is called the command system of the PLC. It contains the number of instructions, what each instruction can do, and represents the function and performance of the PLC. Generally speaking, a PLC with strong functions and good performance has a rich instruction system and can do more things. We must figure out the PLC's instruction system before programming
Program: An orderly set of PLC instructions, the PLC can run it and perform corresponding work. Of course, the program here refers to the user program of the PLC. User programs are generally designed by users, and are not provided by PLC manufacturers or distributors. Programs expressed in statements are not intuitive and have poor readability, especially complex programs, which are more difficult to read, so most programs are expressed in ladder diagrams.
Ladder diagram: A ladder diagram is a connected diagram that connects the ladder diagram symbols of PLC instructions together through an online connection to express the PLC instructions used and their sequence. It is very similar to an electrical schematic diagram. It has two kinds of connections: one is the bus, the other is the internal horizontal and vertical lines. The internal horizontal and vertical lines connect each ladder symbol instruction into an instruction group. This instruction group usually starts with the load (LD) instruction, and if necessary, it is followed by several input instructions (including the LD instruction) to establish logical conditions. Finally, it is an output class command to realize output control, or it is a command such as data control, process control, communication processing, monitoring work, etc. to carry out the corresponding work. The bus is used to connect the command group.

