As per the International Electrotechnical Commission Section 61131-3 standard, there are five different PLC programming languages. Each of these programming languages has its strengths and weaknesses. The choice of programming language depends on the complexity of the control system, the programming skills of the programmers, and the preferences of the system integrators. Let’s take a deeper look into all popular types of PLC Programming Languages.
Ladder Diagram (LD)
It is a graphical programming language used for designing and controlling industrial automation processes. It is commonly used to represent the logic of electrical circuits. It consists of two vertical lines representing the power rails or the supply voltage, and horizontal lines that represent the control circuits. The control circuits consist of symbols and lines that represent various components such as switches, relays, timers, and motors.
The symbols used in a Ladder Diagram represent the function of the component being controlled, and the lines connecting the symbols represent the wiring between the components. The symbols used in Ladder Diagrams are standardized, and their meanings are universally recognized.
They are easy to read and understand, and they can be quickly modified to change the control logic of a system. They are used in a wide range of applications, from controlling simple machines to complex manufacturing processes.
Sequential Function Charts (SFC)
SFCs are used to describe the behavior of a system or a process in a structured way. SFCs consists of a series of steps or actions that the system or process needs to take to achieve a particular goal. The steps are represented as boxes, with arrows connecting them to indicate the flow of control. The boxes can also contain conditions and actions that are executed when the condition is met.
SFCs can be used to model both continuous and discrete systems, and they are often used in conjunction with other programming languages such as ladder logic and function block diagrams.
One of the advantages of using SFCs is that they allow for the hierarchical organization of tasks and processes, making it easier to manage and troubleshoot complex systems. SFCs also provide a visual representation of the system’s behavior, which can help engineers and operators to better understand and optimize its performance.
Function Block Diagram (FBD)
FBD is based on a set of predefined function blocks, each of which represents a specific operation or function in the control system. These function blocks can be connected to form a diagram that represents the control system.
In an FBD, the diagram consists of a series of interconnected function blocks that perform specific tasks. Each function block has inputs and outputs, and the blocks are connected by lines that represent the flow of data between them. The inputs and outputs of the function blocks can be connected to sensors, actuators, or other control devices in the system.
FBDs are used to model and design control systems because they provide a visual representation of the system that is easy to understand and modify. They are also useful for troubleshooting and debugging control systems because they make it easy to identify the source of problems.
Structured Text (ST)
It is a text-based language that allows programmers to write code using a structured approach, like other high-level programming languages like C, Python, or Java. ST uses a structured programming approach that allows developers to write code using modules or functions. It has several features that make it a popular language for PLC programming, like:
- Structured programming: ST provides a structured programming approach, allowing developers to write code that is organized into functions or modules. This makes it easier to write and debug code.
- Data types: ST supports several data types, including Boolean, integer, real, string, and time. This allows developers to write code that can handle different types of data.
- Math functions: ST includes a range of math functions that can be used to perform complex calculations. These functions include trigonometric, exponential, and logarithmic functions.
- Comparison operators: ST includes a range of comparison operators that can be used to compare values. These operators include greater than, less than, equal to, and not equal to.
- Logical operators: ST also includes logical operators that can be used to create complex conditional statements. These operators include AND, OR, NOT, and XOR.
Instruction List (IL)
It is a textual language that allows the user to create a list of instructions that the PLC can execute. IL is like assembly language in that it uses a series of simple instructions to manipulate data and control the operation of the PLC. Here is a list of common instructions used in PLC programming languages:
- LDI (Load Immediate): This instruction loads a constant value into a register.
- AND (Logical AND): This instruction performs a logical AND operation on the values of two registers and stores the result in a third register.
- OR (Logical OR): This instruction performs a logical OR operation on the values of two registers and stores the result in a third register.
- XOR (Logical XOR): This instruction performs a logical XOR operation on the values of two registers and stores the result in a third register.
- NOT (Logical NOT): This instruction performs a logical NOT operation on the value of a register and stores the result in another register.
- Timer: This instruction creates a timer that counts down from a specified value.
- Compare: This instruction compares the values of two registers and sets a flag if they are equal, not equal, greater than, or less than.
Conclusion
Each programming language has its unique features and benefits, and the choice of language depends on the application and the preference of the programmer. Some PLC programming software allows for the use of multiple languages within a single project, providing flexibility and versatility in programming.