Over the past few years, PLC has become a very important element of industrial processes; it enabled the existence of more complicated systems and opened a lot of possibilities to the level of control we can have over an industrial process.
With the continuous demand for the PLC to be faster and more powerful to attain the various types of processes, the need for easier and faster programming to the PLC has risen. And that is why manufacturers started to develop new programming languages to fit different demands.
In this article, we will get to know the 5 different programming languages for the PLC and the advantages and disadvantages of each one.
- What are the 5 different PLC languages?
- Advantages and disadvantages of these 5 languages.
- Why there are so many languages?
- What is the best programming language I can use?
What are the 5 different PLC Languages?
According to the IEC (International Electrotechnical Commission), Section 61131-3 Standard there are 5 approved PLC languages, this part of IEC 61131 specifies the syntax and semantics of a unified suite of programming languages for programmable logic controllers (PLC).
These consist of
- Two textual languages
- IL (Instruction List)
- ST (Structured Text)
- Two graphical languages
- LD (Ladder Diagram)
- FBD (Function Block Diagram)
- SFC (Sequential Function Chart)
Ladder Diagram (LD)
Ladder diagram or ladder logic is the most popular and most commonly used PLC programming language, it was designed to mimic the hardwired relay logic systems, and that is why it is very easy to read and understand for electricians and electrical engineers.
Ladder logic is easy to read, comment on, and debug while your system is online. But it has limitations as you can only use the blocks that are defined. And it’s not great for motion control or batching. And your logic can get so complicated to perform some tasks.
Advantages of Ladder Diagram
- Easy to read and comment on.
- Enable online debugging and editing.
Disadvantages of Ladder Diagram
- Not suitable for some tasks like motion control and batching
- Ladder logic programming
Function Block Diagram (FBD)
Function Block Diagram (FBD) is the second most used PLC language, program blocks are connected together to form your logic, Depending on the size of your system, FBD may or may not be the optimal choice.
If your system requires a lot of motion control planning and repetitive tasks, then FBD could be the straightforward approach.
However, if you have a lot of code to create, you’ll have to take a few extra steps to keep the Function Block Diagrams organized. Because you can place blocks anywhere, these diagrams can get messy and disorganized fairly easily.
Advantages of Function Block Diagram
- Good for motion control.
- Visual blocks are easier to read.
- You can combine many lines of programming and put them into one block.
Disadvantages of Function Block Diagram
- Code can get very messy and disorganized.
- Logic can be hard to troubleshoot.
Structured List (ST)
Structured List (ST) is a high-level programming language like Basic, Pascal, and C. It is very powerful and suitable for complex mathematical functions and data analysis tasks.
Structured List is a textual-based language, so you have to write out each line of code. ST uses functions like IF, WHILE, FOR, and CASE.
Advantages of Structured List
- Suitable for complex logic and data handling tasks.
- Very organized and good at computing large mathematical calculations.
- More flexible than ladder logic.
Disadvantages of Structured List
- The syntax can be hard if you are not familiar with high-level languages like C.
- Hard to debug and edit online.
Instruction List (IL)
Instruction List (IL) is the second textual language you can use to program your PLC, as the name indicates; you can write your logic in this language as a list of instructions.
Each instruction is written on a new line. The IL is a low-level language and resembles assembly. You can add any comments you might want at the end of each.
Advantages of Instruction List (IL)
- Very useful for compact codes.
- Very useful for time-critical codes.
- Very fast and uses less memory
Disadvantages of Instruction List (IL)
- It’s a bit limited when it comes to structuring code.
- More difficult to debug and resolve errors
- More prone to run-time errors and can lead to infinite loops.
Sequential Function Chart (SFC)
Sequential Function Chart (SFC) is another PLC programming language that uses graphical blocks for the logic, but in SFC each block is called a step and your code will stay at this step executing whatever instructions are inside of it until a transition condition is met allowing the logic to move on to the next step.
This concept is similar to a flow chart, hence the word charts in SFC.
The decision to move on to the next step of your SFC logic can be based on timing, a certain phase of the process, or the physical state of equipment.
Unlike a traditional flow chart, SFC can have multiple paths (branches), and you can use branches to execute multiple steps at one time.
Advantages of Sequential Function Chart
- Useful for large processes that you can break into major steps.
- Easier online debugging, as you can see exactly at which step your logic stopped.
- Very fast to design your process.
Disadvantages of Sequential Function Chart
- Doesn’t fit every application.
Why there are so many PLC Languages?
First, that is not too many, and with the high number of PLC manufacturers, and the many more models of PLCs, it is good that the IEC standard only allowed these 5, otherwise, each manufacturer would have used their own special language and that would have made it very hard for programmers and also for integration of different brands with each other.
The other thing you should know is that these languages were developed naturally when automation evolution needed new ways to program our PLCs, for faster and easier solutions for the needs of industrial processes, and when new automation requirements began to be a challenge for older PLC languages.
For example, FBD started to be in need when our logic became so large and needed to be represented into blocks to be easier to read and understand. Also, when we needed to do more complex mathematical calculations and deal more comfortably with data manipulation the need for ST began to show. And also with SFC, it was easier to program large processes once we divided them into smaller partitions or STEPs.
So you can see that each PLC programming language is important and needed for certain applications.
What is the Best PLC Programming Language You can use?
Although Ladder logic is still the most commonly used language by many PLC programmers, and for good reasons, because you can use LAD to program almost most of the logic you need for your application, a small portion of your logic might need other languages like SFC or ST.
So for the small applications you can depend on LAD and it will almost always be enough, but as your automation process gets larger and more complicated, you have to start considering other options.
A best practice is to try to use multiple languages in your logic, so you can benefit from the strength of each one.
- There are 5 PLC programming languages approved by IEC.
- Different PLC programming languages were developed to keep up with industrial automation evolutions and requirements.
- There is no best PLC programming language, but there is the best choice for each automation application.
If you liked this article, then please subscribe to our YouTube Channel for Instrumentation, Electrical, PLC, and SCADA video tutorials.
You can also follow us on Facebook and Twitter to receive daily updates.
- Why 24 Volts DC Power Supply?
- VFD Commissioning Procedure
- Smart Spray System using PLC
- Industrial Automation Checklists
- Career Opportunities in Automation