Understanding PLC: Start With Programming Languages!

Content

The programming languages of PLCs have distinct characteristics compared to general computer languages. They differ from high-level languages and general assembly languages, needing to be easy to write and debug. Currently, there is no programming language that is compatible with products from all manufacturers. For example, Mitsubishi has its own programming language, while OMRON has its own as well. However, regardless of the PLC model, the programming languages share the following characteristics:

Understanding PLC: Start With Programming Languages!

Graphical Instruction Structure

The program is expressed graphically, and instructions consist of various graphical symbols that are easy to understand and remember. Software developers have compiled the independent operational functions required in industrial control into symbolic graphics. Users can combine these graphics according to their needs and fill in the appropriate parameters. In the logical operation part, almost all manufacturers use ladder diagrams similar to relay control circuits, which are easy to accept.

For instance, Siemens also uses control system flowcharts to represent control relationships using binary logic element graphical symbols, which are very intuitive and easy to understand. More complex arithmetic operations, timing, and counting are generally represented in reference to ladder diagrams or logic element diagrams, although they are not as symbolic as the logical operation part, they are still popular among users.

Understanding PLC: Start With Programming Languages!

Clear Variables and Constants

The graphical symbols serve as operation codes that define operational functions, while the operands are filled in by users, such as: K400, T120, etc. The variables and constants in the PLC, along with their value ranges, are clearly defined and determined by the product model, which can be referenced in the product catalog manual.

Understanding PLC: Start With Programming Languages!

Simplified Program Structure

The program structure of a PLC is usually very simple, typically in a block structure, where different blocks perform different functions, providing the debugger with a clear concept of the overall program’s control functions and control sequence.

Understanding PLC: Start With Programming Languages!

Simplified Application Software Generation Process

Writing programs in assembly language and high-level languages requires three processes: editing, compiling, and linking. However, when using programming languages, only editing is needed; the rest is automatically completed by the system software, and the entire editing process is conducted through human-computer dialogue, without requiring users to have advanced software design skills.

Understanding PLC: Start With Programming Languages!

Enhanced Debugging Methods

Debugging assembly programs or high-level language programs can be a headache for editors, while PLC program debugging offers complete conditions. Using a programmer, the keys, displays, and internal editing, debugging, and monitoring on the PLC and programmer make diagnosis and debugging operations very simple with software support.

Understanding PLC: Start With Programming Languages!

In summary, the programming language of PLCs is user-oriented, requiring no advanced knowledge or extensive specialized training from the user.

Programming Language Forms

Taking the two most commonly used programming languages as examples, one is the ladder diagram, and the other is mnemonic language representation. Ladder diagram programming is used because it is intuitive and easy to understand, but it requires a personal computer and corresponding programming software. Mnemonic representation is convenient for experimentation as it only requires a simple programmer without the need for an expensive graphical programmer or computer.

Understanding PLC: Start With Programming Languages!

Although some high-end PLCs also have C language, BASIC language, and proprietary high-level languages (such as Siemens’ GRAPH5 and Mitsubishi’s MELSAP) that are compatible with computers, as well as Boolean logic languages and general computer-compatible assembly languages, each manufacturer’s programming language is only applicable to its own products.

Understanding PLC: Start With Programming Languages!

Programming Instructions

Instructions are the codes or symbols that tell the PLC what to do and how to do it. Essentially, instructions are just binary codes, which is completely the same as a regular computer. PLCs also have a compilation system that can compile some character symbols or graphic symbols into machine code, so the PLC instructions users see are generally not machine code but rather textual codes or graphic symbols. Common mnemonic statements use abbreviations of English words (which can be in multiple languages) and numbers to represent corresponding instructions. Common graphical symbols are ladder diagrams, which are similar to electrical schematics and are easily accepted by electrical workers.

Instruction System

The entire set of instructions that a PLC has is called the instruction system of that PLC. It includes the quantity of instructions, what each instruction can do, and represents the functions and performance of the PLC. Generally, a powerful and high-performance PLC will have a rich instruction system, allowing it to do more tasks. Before programming, we must understand the PLC’s instruction system.

Program

A sequential collection of PLC instructions that the PLC executes to perform corresponding tasks, here the program refers to the user program of the PLC. User programs are generally designed by users, and PLC manufacturers or distributors do not provide them. Programs expressed in statements are not very intuitive and have poor readability, especially for more complex programs, making them harder to read; thus, most programs are expressed using ladder diagrams.

Ladder Diagram

A ladder diagram is a connected diagram that links the ladder diagram symbols of PLC instructions together to express the PLC instructions used and their sequence. It is very similar to electrical schematics. There are two types of connections: one is the bus line, and the other is internal horizontal and vertical lines. The internal horizontal and vertical lines connect individual ladder diagram instruction symbols into an instruction group, which generally starts with the Load (LD) instruction, followed by several input instructions (including the LD instruction) to establish the logical conditions. Finally, output instructions are used to achieve output control, or data control, process control, communication processing, monitoring tasks, etc., to perform corresponding work. The bus line is used to connect the instruction groups.

Disclaimer: This article is a network reprint, and the copyright belongs to the original author. If there are any copyright issues, please contact us for deletion! The content of this article only represents the author’s personal views, and the reprint does not imply the endorsement of this platform or agreement with the same views.

SourceMechanical Engineer

Leave a Comment