///// START OF VIDEO SCHEMA ///// ///// END OF VIDEO SCHEMA /////

What Are the Most Popular PLC Programming Languages?

In this video and article, we will take a look into the 5 most popular PLC programming languages.
Listen to this article

There are 5 languages that are all a part of the IEC (International Electrotechnical Commission) Section 61131-3 Standard. This IEC Standard allows some ground rules that standardize PLC’s and their languages. Let’s take a deeper look into all these popular PLC Programming Languages.

The 5 most popular types of PLC Programming Languages are:

1. Ladder Diagram (LD)

2. Sequential Function Charts (SFC)

3. Function Block Diagram (FBD)

4. Structured Text (ST)

5. Instruction List (IL)

Which language is best for PLC programming?

At RealPars, we are often asked which PLC programming language is the best to learn.

Although the students who ask that question want a definitive answer, the only correct answer is: It depends on the context.

In many ways, it's like asking what is the best tool in a toolbox. Just like the tools in your toolbox, every PLC programming language exists for a reason and is suitable for specific applications.

Making it even more difficult for us to answer that question is the fact that different programming languages are more popular in some countries and industries than others.

So the best PLC programming language for you to learn may vary depending on where you live and what industry you are interested in.

Suggested Skill Path

PLC Programming

Learn to program PLCs in an easy-to-follow, practical format.

Remember that to be a complete PLC programmer, you should be able to use all of the tools that are available to you. This means that you should be proficient at writing logic in any of the major PLC programming languages so that you can always use the optimal language for a specific application.

Let’s show you a little bit about each of these. I will start with Ladder Diagram which is a graphical type of PLC Programming Language.

1. Ladder Diagram (LD)

Ladder Diagram was originally modeled from relay-logic which used physical devices, such as switches and mechanical relays to control processes. Ladder Diagram utilizes internal logic to replace all, except the physical devices that need an electrical signal to activate them.

Ladder Diagram, or LD, is the most commonly used PLC programming language. It is a high-level, graphical programming language that is designed to be easy to read and understand for easy maintenance and troubleshooting.

Ladder Diagram is the first PLC programming language that many PLC programmers will learn because most companies want to hire engineers who can program with Ladder Diagram. This is especially true in North America.

Ladder Diagram is built in the form of horizontal rungs with two vertical rails that represent the electrical connection on relay-logic schematics.

You can program all the necessary input conditions to affect the output conditions, whether logical or physical.

1-1. Ladder Diagram Advantages

As you can see, the biggest advantage of Ladder Diagram is its graphical nature. It is very easy to look at a rung and debug the logic, even if you are not a programmer.

Ladder Diagram is a great programming language for complex Boolean logic.

The main advantages of the Ladder Diagram language are:

1. The rungs allow it to be organized and easy to follow.

2. It also lets you document comments that are readily visible.

3. It supports online editing very successfully.

1-2. Ladder Diagram Disadvantages

The main disadvantage is that there are some instructions that are not available, which might make it more difficult for programming such as motion or batching.

The next PLC Programming Language that I will talk to you about is the Sequential Function Charts which uses a graphical type of programming.

2. Sequential Function Charts (SFC)

If you have any experience with flowcharts, then this PLC Programming language will feel familiar to you. In Sequential Function Charts, you use steps and transitions to achieve your end results.

Steps act as a major function in your program. These steps house the actions that occur when you program them to happen. This decision can be based on timing, a certain phase of the process, or a physical state of an equipment.

Transitions are the instructions that you use to move from one step to another step by setting conditions of true or false.

Unlike traditional flowcharts, the Sequential Function Charts can have multiple paths. You can use branches to initiate multiple steps at one time.

SFC is an incredibly easy language to design in. You create a block for each state that is supported by your process, program the actions that are executed while the machine is in each state, and the conditions that are required to transition from one state to another.

As you can imagine, SFC is also easy to monitor and debug at runtime since you can see exactly what state is active and what conditions must be true to transition to the next state.

SFC is only suitable for defining high-level state machines and sequencers. In most platforms, the actions that are executed while a step is active are written in ST and many programmers will call a POU written in another programming language like LD or FBD to manage the actions that occur when a step is active.

In this snippet of SFC, we are controlling a sequencer that fills and empties a tank continuously. When the tank is filling or emptying, actions are to open and close valves and the conditions to move from one step to another depend on the level of the tank or the actions taken by the operator.

Sequential Function Chart (SFC)

2-1. Sequential Function Charts Advantages

A couple of the advantages of Sequential Function Charts are:

1. Processes can be broken into major steps that can make troubleshooting faster and easier.

2. You have direct access in the logic to see where a piece of equipment faulted.

3. It can be faster to design and write the logic due to the ability to use repeated executions of individual pieces of logic.

2-2. Sequential Function Charts Disadvantages

Even when you consider the advantages of the Sequential Function Charts, this PLC Programming Language does not always fit every application.

Now we are on to our third PLC Programming Language.

3. Function Block Diagram (FBD)

The Function Block Diagram which is also a graphical type of language. The Function Block Diagram describes a function between inputs and outputs that are connected in blocks by connection lines.

Function Blocks were originally developed to create a system that you could set up many of the common, repeatable tasks, such as counters, timers, PID Loops, etc.

You program the blocks onto sheets and then the PLC constantly scans the sheets in numerical order or is determined by connections which you program between the blocks.

3-1. Function Block Diagram Disadvantages

The code can get disorganized using this PLC Programming Language because you can place the function blocks anywhere on the sheet. This can also make it more difficult to troubleshoot.

3-2. Function Block Diagram Advantages

1. The Function Block Diagram does work well with motion controls.

2. The visual method is easier for some users.

3. The biggest advantage of Function Block Diagram is that you can take many lines of programming and put it into one or several function blocks.

The big advantage of FBD over LD is that the outputs of one Function Block can flow into the next or be used as feedback without using intermediate variables.

This feature makes FBD great for controlling continuous processes where analog values are constantly being monitored and outputs adjusted to keep the value within a range.

Because of its resemblance to P&IDs and its ability to easily control continuous processes, FBD is commonly used in process industries.

In this example, you can see a snippet of FBD which is being used to monitor the level of a tank.

In this case, analog input from the filling valve is scaled to an engineering value. The engineering value is fed into a function block that converts the data type of the scaled value to an integer data type. This value is then compared to pre-defined set points to set flags indicating the tank level.

Function Block Diagram (FBD)

FBD is great for continuous process controls but for complex arithmetic operations like calculating the level of a tank, Structured Text is more suitable.

4. Structured Text (ST)

The 4th PLC Programming Language is the Structured Text. This language is a textual based language.

Structured Text is a high-level language that is like Basic, Pascal and “C”.

Structured Text is popular with younger PLC programmers who are comfortable with text-based programming languages like Python.

Many older engineers tend to avoid Structured Text because it is harder for maintenance engineers to understand and debug.

It is a very powerful tool that can execute complex tasks utilizing algorithms and mathematical functions along with repetitive tasks.

The code uses statements that are separated by semicolons and then either inputs, outputs, or variables are changed by these statements.

You must write out each line of code and it uses functions such as FOR, WHILE, IF, ELSE, ELSEIF AND CASE.

If you have experience with Basic or C languages, this PLC Programming Language will come easier than some of the other types of PLC languages.

In general, ST is very powerful for performing complex arithmetic operations and for looping over data structures like arrays.

In this snippet of ST, we are calculating the fill level of a tank based on the volume being added to the tank every time the POU is scanned.

Structured Text (ST)

4-1. Structured Text Advantages

Some of the advantages of Structured Text are:

1. It is very organized and good at computing large mathematical calculations.

2. It will enable you to cover some instructions that are not available in some other languages like the Ladder Diagram.

4-2. Structured Text Disadvantages

The disadvantages of the Structured Text PLC programming language are:

1. The syntax can be difficult.

2. It is hard to debug.

3. It is difficult to edit online.

5. Instruction List (IL)

I will now show you the 5th and final PLC Programming Language which is Instruction List. The Instruction List is also a textual based language.

Instruction list, or IL, is an obsolete programming language that was very similar to an assembly language. When you use this PLC Programming Language, you will use mnemonic codes such as LD (Load), AND, OR, etc.

The Instruction List contains instructions with each instruction on a new line with any comments you might want to annotate at the end of each line.

You may encounter an instruction list if you are working in a maintenance role, but the recommendation from most manufacturers is not to use Instruction List for new projects.

5-1. Instruction List Advantages

The Instruction List language is valuable for applications that need code that is compact and time critical.

5-2. Instruction List Disadvantages

The main disadvantages of this PLC Programming Language are:

1. There are few structuring possibilities with the “Goto” command being one of them.

2. There can also be many errors that are more difficult to deal with in comparison to many of the other languages that I have previously reviewed.

If you’d like a video explanation, check out this video:

Conclusion

So, have you decided which PLC Programming Language you consider to be the most popular?

After reading many reviews and opinions and with my own experiences, the Ladder Diagram is by far the most popular PLC programing language .

The main reason for this is that the Ladder Diagram language naturally followed the technology advancement from a physical relay logic to a digital and logical one. This allowed the engineers and skilled workers to follow and troubleshoot and make that transition.

In summary, there is certainly a place for all the PLC Programming Languages that we have reviewed. Your background, experience and the application you are working with are really going to be the key to which PLC Programming Language you choose.

What’s the biggest “aha” you’re taking away from this technical conversation? How can you put that insight into action now? Tell us the comments below.

Thanks again for reading. Leave your questions and comments and we’ll chat with you soon!

Happy learning,

The RealPars Team

FAQS

Frequently asked questions

What are the five most popular PLC programming languages?
Why is Ladder Diagram (LD) widely used in PLC programming?
When should I use SFC instead of other languages?
What is Function Block Diagram (FBD) used for?
What’s the main advantage of Function Block Diagram compared to Ladder Diagram?
How do I choose the right PLC programming language?

Learn from Industry Experts

Start Learning for Free