PLC five standard programming languages explained

Aug 31, 2024 Leave a message

PLCs currently have five standard programming languages, including graphical programming languages and text-based programming languages.

 

Graphical programming languages include:

 

Ladder Diagram (LD - Ladder Diagram);

Function Block Diagram (FBD - Function Block Diagram);

Sequential Function Chart (SFC - Sequential Function Chart).

 

Textualized programming languages include:

 

Instruction List (IL-Instruction List) & Structured Text (ST-Strutured Text).

IEC 1131-3 programming language is a set of international programming language standard for industrial control system formed on the basis of IEC working group's reasonable absorption and reference to the programming languages of PLC manufacturers worldwide. It is not only applicable to PLC systems, but also to a wider range of industrial control fields, making an important contribution to the global standardization of PLC programming languages.

 

Relay Ladder Diagram (LD)

 

Relay Ladder Diagram (LD-Ladder Diagram) language is the first PLC programming language, is also the most common PLC programming language.

Ladder Diagram programming language is evolved from the basis of the schematic diagram of the relay control system, and the basic idea of the ladder diagram of the relay control system is the same, but only in the use of symbols and expression of certain differences.

 

PLCs were originally designed for use by electrical technicians on the factory floor, in order to conform to the habits of mind of relay control circuits.

As the programming language first used in PLCs, ladder diagrams retain the style and conventions of relay circuit diagrams, making them the most accessible and usable language for the majority of electrical technicians.

 

1. Soft relays

PLC ladder diagram of some programming elements along the name of the relay, such as input relays, output relays, internal auxiliary relays, etc., but they are not real physical relays, but some of the storage unit (soft relay), each soft relay and the PLC memory in the image of a memory register corresponding to a storage unit.

If the memory cell for the "1" state, the ladder diagram that corresponds to the soft relay coil "energized", its normally open contacts open, normally closed contacts open, said that this state is the soft relay "1 This state is called the "1" or "ON" state of the soft relay.

If the memory cell is in the "0" state, the state of the coil and contacts of the corresponding soft relay is the opposite of the above, and the soft relay is said to be in the "0" or "OFF" state. These "soft relays" are often referred to as programming elements.

 

2. Energy flow

There is an imaginary "conceptual current" or "power flow" (Power Flow) flowing from left to right, and this direction is consistent with the sequence of logical operations in the execution of the user program.

Energy flow can only flow from left to right. Using the concept of energy flow can help us better understand and analyze ladder diagrams.

 

3. Bus

The vertical common line on both sides of the ladder diagram is called the bus bar.

In the analysis of ladder logic, in order to borrow the analysis of relay circuit diagrams, you can imagine that the left and right sides of the bus (left bus and right bus) between a left positive and right negative DC supply voltage, between the bus, "energy flow" from left to right flow. The right busbar can be left out.

 

4. Logical solution of ladder diagram

According to the state and logical relationship of each contact in the ladder diagram, the state of the programmed element corresponding to each coil in the diagram is called the logical solution of the ladder diagram.

Logic solving in a ladder diagram is performed in a left-to-right, top-to-bottom order. The result of the solution is immediately utilized by the logic solution that follows.

The logical solution is based on the value in the input image register, not on the state of the external input contact at the instant of solution.

 

1, corresponding to the electrical operation schematic diagram, with intuition and correspondence;
2, consistent with the original relay logic control technology, for electrical technicians, easy to grasp and learn;

3, and the original relay logic control technology is different from the ladder diagram of the energy flow (Power Flow) is not the actual meaning of the current, the internal relay is not the actual existence of the relay, so the application of the original relay logic control technology needs to be differentiated from the relevant concepts;

4, and the instruction table programming language has a one-to-one correspondence, easy to convert each other and check the program.

 

Function Block Diagram (FBD)

Function Block Diagram (FBD - Function Block Diagram) uses graphical symbols similar to digital logic gate circuits, the logic is intuitive and easy to use, it has ladder diagram programming of touch and coil equivalent instructions, and can solve a wide range of logic problems.

 

1,Unit of function module, starting from the control function, it makes it easy to analyze and understand the control scheme;

2, the function module is a graphical method to describe the function, its intuitive greatly facilitates the programming and configuration of the designers, and has a better ease of operation;

3, for systems with larger control scale and more complex control relations, the programming and configuration time can be shortened and the debugging time can be reduced because the relations of control functions can be expressed more clearly.

 

Sequential Function Chart (SFC)

Sequential Function Chart (SFC - Sequential Function Chart), also known as flowchart or state transfer diagram, is a graphical, functional illustrative language dedicated to describing industrial sequential control programs, using which systems with complex structures such as concurrency and selection can be programmed.
 

1. Function-oriented, well-organized, easy to understand and communicate the operation of the program;

2, for large programs, can be divided into design, using a more flexible program structure, can save program design time and debugging time;

3,Commonly used in the larger scale of the system, the program relationship is more complex occasions;

4, only in the active step of the command and operation is executed, the conversion after the active step is scanned, so the scanning time of the entire program is much shorter than the scanning time of other programming programs.

 

Instruction List

Instruction List (IL-Instruction List) programming language is similar to the computer mnemonic assembly language, which is the most basic programming language for programmable controllers, the so-called instruction list programming, is to use one or a few easy to memorize characters to represent a certain operation function of the programmable controller.

 

1. Adopting auxiliary characters to indicate the operation function, which has the characteristics of easy to remember and easy to master;

2, in the programmer's keyboard using mnemonics to indicate that has the characteristics of easy to operate, can be programmed in the absence of computer design occasions;

3, one-to-one correspondence with the ladder diagram, its characteristics and ladder diagram language is basically the same.

 

Structured Text (ST)

Structured Text (ST - Strutured Text) is a high-level text language that can be used to describe the behavior of functions, function blocks, and programs, as well as the behavior of steps, actions, and transitions in sequential functional flowcharts.

The Structured Text language is superficially similar to PASCAL, but it is a programming language developed specifically for industrial control applications with strong programming capabilities for assigning values to variables, calling back functions and function blocks, creating expressions, writing conditional statements, and iterating programs.

 

1, the use of high-level language programming, can complete the more complex control operations;

2,It requires certain knowledge of computer high-level programming language and programming skills, which requires high skills of programmers and cannot be completed by common electricians.

3,Performance such as intuition and ease of operation is poor;

4, often used for the use of function modules and other languages more difficult to achieve the implementation of some control functions.

 

Tip Note: Not all PLCs support all programming languages (e.g., Function Block Diagram, Sequential Function Diagram are not supported by many low-grade PLCs), while large PLC control systems generally support these five standard programming languages or similar programming languages.

 

Not all PLCs support all programming languages

 

There are also some programming languages other than the standard language, although they are not selected into the standard language, but they are developed to fit some special occasions of application, in some cases, they may be the better programming language.

For example, D7-SYS continuous function chart CFC is specially developed for large-scale continuous process control, as long as the call program in the CFC function block can be easily realized like PID controller, counter, positioner, ramp function generator and a series of special functions, and does not require special programming knowledge, only need to know the graphical processing and the use of standard program blocks, a simple setup can be.

Send Inquiry

whatsapp

Phone

E-mail

Inquiry