PLC programming basic instruction system and programming method - Database & Sql Blog Articles

Programmable Package SG-8018CA(SG7050C) 0.67M~170M
Probe domestic switch needle KG-300K needle head diameter is 3.0mm normally open switch needle
SMD aluminum electrolytic capacitor

First, the basic command system features

Compared with general computer languages, plc's programming language has obvious features. It is different from high-level languages ​​and general assembly languages. It is easy to write and easy to debug. At present, there is no programming language that is compatible with all manufacturers' products. If Mitsubishi's products have its own programming language, OMRON's products also have its own language. But no matter what type of PLC, its programming language has the following characteristics:

1. Graphical instruction structure: The program is expressed graphically. The instructions are composed of different graphic symbols, which are easy to understand and memorize. The software developers of the system have compiled the independent computing functions required in industrial control into symbolic graphics, and the users combine these graphics according to their own needs and fill in the appropriate parameters. In the logic operation part, almost all manufacturers use a 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. It uses the binary logic component graphic symbols to express the control relationship, which is very straightforward. More complex arithmetic operations, timing counts, etc., are generally given to the ladder diagram or logic component diagram to give representation, although the symbol is not as good as the logic operation part, it is also welcomed by users.

2, the explicit variable constant: the graphic symbol is equivalent to the operation code, the calculation function is specified, and the operand is filled in by the user, such as: K400, T120, etc. The variables and constants in the PLC and their range of values ​​are clearly defined and are determined by the product model.

3, simplified program structure: PLC program structure is usually very simple, typically block structure, different blocks to 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: using assembly language and high-level language to write the program, to complete the editing, compiling and linking three processes, and using the programming language, only need to edit a process, the rest is automatically completed by the system software, the entire editing process In the human-machine dialogue, users are not required to have advanced software design capabilities.

5, strengthen debugging means: whether it is assembly program, or high-level language program debugging, is a headache for editors, and PLC program debugging provides a complete condition, using the programmer, using the buttons on the PLC and programmer, Display and internal editing, debugging, monitoring, etc., with software support, diagnostics and debugging operations are very simple.

In short, the programming language of PLC is user-oriented, and does not require advanced knowledge for users, and does not require long-term specialized training.

Second, the form of 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. Ladder programming is used because it is intuitive and easy to understand, but requires a personal computer and corresponding programming software; it is easy to experiment with mnemonic because it requires only a simple programmer without having to use an expensive graphics programmer or Computer to program.

Although some high-end PLCs also have C language compatible with computers, BASIC language, special high-level languages ​​(such as GRAPH5 from Siemens, MELSAP from Mitsubishi), and Boolean logic, general-purpose computer-compatible assembly language. In any case, the programming language of each manufacturer can only be applied to our products.

Programming instructions: An instruction is a code or symbol that the PLC is told what to do and how to do it. In essence, the instructions are just some binary code, 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 the user sees are generally not machine code but text code or graphic symbol. Commonly used mnemonic statements use the abbreviations and numbers of English characters (multiple languages ​​available) to represent the corresponding instructions. The commonly used graphical symbol is the ladder diagram, which is similar to the electrical schematic diagram, which is easy for electrical workers to accept.

Command system: The whole command of 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 is bound to be rich in command systems, and there are many things that can be done. We must understand the PLC command system before programming

Program: An ordered collection of PLC instructions. The PLC runs it and can perform the corresponding work. Of course, the program here refers to the user program of the PLC. The user program is generally designed by the user and is not provided by the PLC manufacturer or the affiliate. Programs expressed in statements are not intuitive and have poor readability, especially for more complex programs, which are more difficult to read, so most programs are represented by ladder diagrams.

Ladder Diagram: A ladder diagram is a connected diagram that connects the ladder symbols of a PLC instruction together by a wire to express the PLC command used and its sequence. It is similar to the electrical schematic. There are two kinds of connections: one is the busbar and the other is the internal horizontal and vertical lines. The internal horizontal and vertical lines connect a ladder symbol symbol instruction into an instruction group. This instruction group generally starts with a load (LD) instruction and, if necessary, a number of input instructions (including LD instructions) to establish a logic condition. Finally, it is an output class instruction to realize output control, or instructions for data control, flow control, communication processing, monitoring work, etc., to perform corresponding work. The bus is used to connect to the instruction set. The picture below is the simplest ladder diagram of Mitsubishi's FX2N series:

Digital camera

It has two groups, the first group is used to achieve start and stop control. The second group has only one END instruction to end the program.

Correspondence between ladder diagram and mnemonic: The mnemonic instruction has a strict correspondence with the ladder instruction, and the ladder diagram can reflect the order of the instruction. Generally speaking, the order is: first input, then output (including other processing); first up, then down; first left, then right. With a ladder diagram, you can translate it into a mnemonic program. The mnemonic program in the above figure is:

Address Instruction Variable 0000 LD X000
0001 OR X010
0002 AND NOT X001
0003 OUT Y000
0004 END

On the contrary, according to the mnemonic, the corresponding ladder diagram can also be drawn.

The relationship between the ladder diagram and the electrical schematic: If only the logic control is considered, the ladder diagram and the electrical schematic can also establish a certain correspondence. For example, the output (OUT) instruction of the ladder diagram corresponds to the coil of the relay, and the input commands (such as LD, AND, OR) correspond to the contacts, the interlock commands (IL, ILC) can be regarded as the main switch, and so on. In this way, the original relay control logic can be converted into a ladder diagram after being converted, and then further converted to become a statement table program.

With this correspondence, it is very easy to represent the relay logic with a PLC program. This is also the inheritance of PLC technology to traditional relay control technology.

Pharmaceuticals

Pharmaceuticals,2-Methyl- Propanoic Acid Monohydrate Price,2-Methyl- Propanoic Acid Monohydrate Free Sample,Pure 2-Methyl- Propanoic Acid Monohydrate

Zhejiang Wild Wind Pharmaceutical Co., Ltd. , https://www.wild-windchem.com

Posted on