laitimes

How to choose a PLC programming language, the gods come to tell you

author:Jicheng PLC classroom

PLC currently has 5 standard programming languages, including graphical programming languages and text programming languages.

Graphical programming languages include:

LD-Ladder Diagram;

Function Block Diagram (FBD);

Sequential Function Chart (SFC).

Textual programming languages include:

IL-Instruction List & ST-Strutured Text.

How to choose a PLC programming language, the gods come to tell you

Iec 1131-3 programming language is a set of international programming language standards for industrial control systems formed by the IEC working group on the basis of reasonable absorption and reference of the programming languages of PLC manufacturers around the world. It is suitable not only for PLC systems, but also for the wider field of industrial control, making an important contribution to the global standardization of PLC programming languages.

Relay ladder diagram (LD)

The relay ladder diagram (LD-Ladder Diagram) language is the first programming language used by PLCs, and it is also the most common programming language used in PLCs.

Ladder diagram programming language is evolved from the basis of relay control system schematic diagram, and the basic idea of relay control system ladder diagram is consistent, but there are certain differences in the use of symbols and expressions.

How to choose a PLC programming language, the gods come to tell you

PLC is designed to be used by electrical technicians on the factory floor to conform to the habits of thinking of relay control circuits.

As the programming language first used in PLC, ladder diagram retains the style and habit of relay circuit diagram and becomes the most acceptable and used language for the majority of electrical technicians.

1. Soft relays

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

If the memory unit is in the "1" state, it means that the coil corresponding to the soft relay in the ladder diagram is "energized", its normally open contact is connected, and the normally closed contact is disconnected, saying that this state is the "1" or "ON" state of the soft relay.

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

2. Can flow

There is a hypothetical "conceptual current" or "energy flow" that flows from left to right, which is consistent with the order of the logical operations when executing 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 ladders.

3. generatrix

The vertical common lines on both sides of the ladder are called bus bars.

When analyzing the logical relationship of the ladder diagram, in order to borrow the analysis method of the relay circuit diagram, it is conceivable that there is a left positive and right negative DC power supply voltage between the left and right busbars (left busbar and right bus), and there is an "energy flow" flowing from left to right between the busbars. The right busbar can be drawn without drawing.

How to choose a PLC programming language, the gods come to tell you

4. Logical solution of ladder diagrams

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

The logical solution in the ladder diagram is performed in order from left to right, from top to bottom. The result of the solution can be immediately used by the subsequent logical solution.

The logical solution is based on the values in the input image registers, not on the state of the external input contacts at the time of the solution.

1. Corresponding to the electrical operation schematic, it has intuitiveness and correspondence;  

2. Consistent with the original relay logic control technology, it is easy for electrical technicians to master and learn; 

3. The difference with the original relay logic control technology is that the energy flow (Power Flow) in the ladder diagram is not a current in the actual sense, and the internal relay is not an actual relay, so when applied, it needs to be treated differently from the relevant concepts of the original relay logic control technology; 

4. There is a one-to-one correspondence with the instruction sheet programming language, which is convenient for mutual conversion and program inspection.

Function Block Diagram (FBD)

Function Block Diagram (FBD - Function Block Diagram) adopts graphical symbols similar to digital logic gates, logic is intuitive, easy to use, it has electrocution and coil equivalent instructions in ladder diagram programming, can solve a wide range of logic problems.

How to choose a PLC programming language, the gods come to tell you

1. Take the functional module as the unit, starting from the control function, so that the analysis and understanding of the control scheme becomes easy;

2, the function module is a graphical method to describe the function, its intuitiveness greatly facilitates the designer's programming and configuration, has a good ease of operation;

3. For systems with large control scale and more complex control relationships, because the relationship between control functions can be expressed more clearly, therefore, the programming and configuration time can be shortened, and the debugging time can also be reduced.

Sequential Function Diagram (SFC)

Sequential Function Chart (SFC - Sequential Function Chart), also known as flowchart or state transfer diagram, is a graphical functional description language designed to describe industrial sequence control programs, using which can program systems with complex structures such as concurrency, selection, etc.

How to choose a PLC programming language, the gods come to tell you

1. Take function as the main line, be clear and well organized, and facilitate the understanding and communication of program operation;  

2. For large-scale programs, the division of labor can be designed, and a more flexible program structure can be adopted, which can save program design time and debugging time; 

3. It is often used in the occasions where the scale of the system is large and the procedural relationship is more complicated;

4. Only the commands and operations of the active step are executed, and the conversion after the activity step is scanned, so the scanning time of the entire program is much shorter than that of other programs.

Instruction sheet

Instruction list (IL-Instruction List) programming language is similar to the mnemonic assembly language in the computer, it is the most basic programming language of the programmable controller, the so-called instruction table programming, is to use one or several easy to remember characters to represent a certain operation function of the programmable controller.

How to choose a PLC programming language, the gods come to tell you

1. The mnemonic is used to indicate the operation function, which is easy to remember and easy to master;

2. The mnemonic symbol is used on the keyboard of the programmer, which has the characteristics of easy operation and can be programmed in the absence of a computer; 

3. It has a one-to-one correspondence with ladder diagram, and its characteristics are basically similar to the ladder diagram language.

Structured Text (ST)

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 steps, actions, and transitions in sequential function flowcharts.

Structured text languages are superficially similar to PASCAL languages, but they are a programming language developed specifically for industrial control applications and have strong programming capabilities for assigning values to variables, calling back functions and function blocks, creating expressions, writing conditional statements, and iterating programs.

How to choose a PLC programming language, the gods come to tell you

1. Programming in a high-level language can complete more complex control operations;

2, the need to have a certain computer advanced programming language knowledge and programming skills, the skills of programmers are higher, ordinary electrical personnel can not complete.

3. Poor performance such as intuitiveness and ease of operation; 

4. It is often used to implement some control functions that are difficult to implement in other languages such as functional modules.

Tip: Not all PLCs support all programming languages (such as function block diagrams, sequential function diagrams have many low-end PLCs that are not supported), and large PLC control systems generally support these 5 standard programming languages or similar programming languages.

How to choose a PLC programming language, the gods come to tell you

There are also programming languages other than standards that, although not selected as standard languages, were developed for applications that are suitable for certain special occasions, and in some cases they may be better programming languages.

For example, the D7-SYS continuous function diagram CFC is developed for large-scale continuous process control, as long as the CFC function block in the call program can easily achieve a series of special functions such as PID controller, counter, positioner, ramp function generator, etc., and do not require special programming knowledge, only need to understand the use of graphical processing and standard program blocks, simple settings.

Retweeting is the biggest encouragement! Thank you for your support!

Tips

Advanced family barrel: contains 18 classic encyclopedias, real questions for electrical examinations over the years, simulation software for electrical training, and technical manuals for various types of electrical automation industry!

How to choose a PLC programming language, the gods come to tell you