Want to Learn PLC Programming? Understand These 5 PLC Languages!

There are currently 5 standard programming languages for PLCs, including graphical and textual programming languages.

Graphical programming languages include:

Ladder Diagram (LD);

Function Block Diagram (FBD);

Sequential Function Chart (SFC).

Textual programming languages include:

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

Want to Learn PLC Programming? Understand These 5 PLC Languages!

IEC 1131-3 programming languages are a set of international programming language standards for industrial control systems, rationally absorbing and referencing the programming languages of PLC manufacturers worldwide. They are applicable not only to PLC systems but also to a broader range of industrial control fields, making significant contributions to the global standardization of PLC programming languages.

Relay Ladder Diagram (LD)

Relay Ladder Diagram (LD) language is the first programming language adopted by PLCs and is also the most widely used programming language in PLCs.

The ladder diagram programming language evolved from the schematic diagrams of relay control systems, maintaining the basic ideas of relay control systems’ ladder diagrams, with some differences in the symbols and expressions used.

Want to Learn PLC Programming? Understand These 5 PLC Languages!

The original design intention of PLCs is for use by electrical technicians in factory workshops, to align with the thinking habits of relay control circuits.

As the first programming language used in PLCs, ladder diagrams retain the style and habits of relay circuit diagrams, making them the most easily accepted and used language by electrical technicians.

1. Soft Relay

Some programming elements in PLC ladder diagrams retain the name relay, such as input relays, output relays, and internal auxiliary relays, but they are not real physical relays; they are storage units (soft relays), each corresponding to a storage unit in the PLC’s memory image register.

If the storage unit is in the “1” state, it indicates that the corresponding soft relay coil in the ladder diagram is “energized,” the normally open contact is closed, and the normally closed contact is open, referred to as the “1” or “ON” state of this soft relay.

If the storage unit is in the “0” state, the states of the corresponding soft relay coil and contacts are the opposite of the above, referred to as the “0” or “OFF” state of this soft relay. These “soft relays” are also often referred to as programming elements.

2. Power Flow

There is a hypothetical “conceptual current” or “Power Flow” flowing from left to right, which is consistent with the order of logical operations when executing the user program.

Power Flow can only flow from left to right. Utilizing this concept can help us better understand and analyze ladder diagrams.

3. Bus Bar

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

When analyzing the logical relationships in a ladder diagram, to borrow the analysis method of relay circuit diagrams, one can imagine a direct current voltage with positive on the left and negative on the right between the left and right bus bars, with “Power Flow” flowing from left to right. The right bus bar can be omitted.

Want to Learn PLC Programming? Understand These 5 PLC Languages!

4. Logic Calculation of Ladder Diagram

Based on the states of each contact in the ladder diagram and their logical relationships, the states of the programming elements corresponding to each coil in the diagram are determined, referred to as the logic calculation of the ladder diagram.

The logic calculation in the ladder diagram is performed from left to right and from top to bottom. The results of the calculation can be immediately utilized by subsequent logic calculations.

Logic calculation is based on the values in the input image register, rather than on the instantaneous states of external input contacts during the calculation.

1. Corresponds to the electrical operation schematic, providing intuitiveness and correspondence;

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

3. The difference from the existing relay logic control technology is that the Power Flow in the ladder diagram does not represent actual current, and the internal relays do not exist physically; therefore, when applying it, the relevant concepts must be treated differently from the existing relay logic control technology;

4. There is a one-to-one correspondence with instruction list programming languages, facilitating conversion and program checking.

Function Block Diagram (FBD)

Function Block Diagram (FBD) uses graphical symbols similar to digital logic gate circuits, making the logic intuitive and easy to use; it has instructions equivalent to contacts and coils in ladder diagram programming, capable of addressing a wide range of logical problems.

Want to Learn PLC Programming? Understand These 5 PLC Languages!

1. Based on functional modules, starting from control functions, making the analysis and understanding of control schemes easier;

2. Functional modules are described graphically, greatly facilitating programming and configuration for designers, with good operability;

3. For systems with larger control scales and complex control relationships, the relationships can be clearly expressed, thus shortening programming and configuration time and reducing debugging time.

Sequential Function Chart (SFC)

Sequential Function Chart (SFC), also known as flowchart or state transition diagram, is a graphical functional description language specifically designed to describe industrial sequential control programs, allowing programming for systems with complex structures such as concurrency and selection.

Want to Learn PLC Programming? Understand These 5 PLC Languages!

1. Focusing on functionality, clear structure, facilitating understanding and communication of program operations;

2. For large programs, design can be divided, using a more flexible program structure, saving program design and debugging time;

3. Commonly used in cases where the system scale is large and program relationships are complex;

4. Only when the commands and operations of active steps are executed, the transitions after the active steps are scanned, thus significantly shortening the scanning time of the entire program compared to other program compilation scanning times.

Instruction List (IL)

Instruction List (IL) programming language is similar to the mnemonic assembly language in computers; it is the most basic programming language for programmable controllers. Instruction list programming uses one or several easily memorable characters to represent a certain operational function of the programmable controller.

Want to Learn PLC Programming? Understand These 5 PLC Languages!

1. Uses mnemonics to represent operational functions, making it easy to remember and master;

2. Uses mnemonics on the programmer’s keyboard, facilitating operations, and can be programmed without a computer;

3. Has a one-to-one correspondence with ladder diagrams; its characteristics are basically similar to ladder diagram languages.

Structured Text (ST)

Structured Text (ST) is a high-level textual language that can describe functions, function blocks, and the behavior of programs, and can also describe the behavior of steps, actions, and transitions in sequential function flowcharts.

Structured text language superficially resembles PASCAL language but is a programming language specifically developed for industrial control applications, with strong programming capabilities for variable assignments, callbacks, function blocks, creating expressions, writing conditional statements, and iterating programs.

Want to Learn PLC Programming? Understand These 5 PLC Languages!

1. Uses high-level languages for programming, capable of completing complex control calculations;

2. Requires certain knowledge of high-level computer programming languages and programming skills, with higher skill requirements for programmers, making it difficult for ordinary electrical personnel to complete.

3. Intuitiveness and ease of operation are relatively poor;

4. Commonly used for implementing control functions that are difficult to achieve with other languages such as function blocks.

Note: Not all PLCs support all programming languages (for example, many lower-end PLCs do not support Function Block Diagram and Sequential Function Chart), while large PLC control systems generally support these 5 standard programming languages or similar programming languages.

Want to Learn PLC Programming? Understand These 5 PLC Languages!

There are also some programming languages outside the standards; although they are not included in the standard languages, they were developed for specific applications, and in some cases, they may be better programming languages.

For example, the Continuous Function Chart (CFC) of D7-SYS was specifically developed for large continuous process control, allowing easy implementation of a series of special functions such as PID controllers, counters, positioners, ramp function generators, etc., simply by calling the CFC function blocks in the program, without requiring specialized programming knowledge, only needing to understand graphical processing and the use of standard program blocks for simple settings.

[Siemens Case Program]

Want to Learn PLC Programming? Understand These 5 PLC Languages!

Scan to Receive

Receive Classic PLC Cases and Source Programs

Leave a Comment