A programmable logic controller (PLC) is the brains behind any good automation process. PLC programming can be used across a range of industrial applications including manufacturing, assembly lines, mining, power generation, robotics and any other activity that requires a high degree of precision, repeatability, ease of programming and simple fault analysis.
PLC programming consists of textual or graphical instructions that represent the program logic and instruct the machines what to do. There are five major PLC programming languages supported by the International Electrotechnical Commission’s standard IEC 61131-3 for control systems. These are Ladder Diagram (also known as Ladder Logic), Function Block Diagram, Sequential Function Chart, Instruction List and Structured Text.
Let’s have a look at each of these languages and find out what the differences are and what are some of the pros and cons of each language.
Ladder Diagram (LD) was originally used for physical process controls like switches and mechanical relays. It is a graphical PLC programming language that is built with horizontal rungs and vertical rails that represent the electrical connection on relay-logic schematics.
LD is one of the most common programming languages. It’s easy to read, comment and edit online and troubleshoot. It’s also one of the more visual languages. LD is the absolute must-know language for any PLC system.
Despite its prevalence, LD isn’t great at programming operations like motion or batching since it’s based on the on/off logic of hard-wired relays.
Function Block Diagram
Function Block Diagram (FBD) is a graphical and highly visual language for PLC design. FBD describes a function between input and output variables by using blocks that are connected by connection lines.
The code is minimised into function blocks, which provide simple ways to create common, repetitive commands such as counters, timers and loops. FBD is similar to LD, except that the code blocks can be used to create more complex tasks like motion programming.The visual layout of the programming can be simplified by condensing many lines of code down into the function blocks.
The downside of using these code blocks is that it renders some of the programming invisible. Additionally, since the blocks can be placed anywhere on the sheet, logic can be difficult to follow, making troubleshooting a challenge.
Sequential Function Chart
Sequential Function Chart (SFC) is another graphical language used for PLC programming. Similar to a flowchart, it uses steps and transitions to lay out instructions and can be good for program processes that need to be split into steps. SFC is a parallel language that can have multiple paths and you can use branches to initiate multiple steps at one time.
SFC is a highly visual language useful for programming processes that are heavy on conditional logic or require parallel instructions. This helps to prevent bottlenecks in production process.
Since processes can be broken into multiple steps, this makes troubleshooting easier than some other languages, like Function Block Diagram. SFC can also be quicker to program than other languages since you can use repeated executions of individual pieces of logic. However, there are limits to applications meaning that SFC may not always be the best choice.
Instruction List (IL) is a text-based programming language similar to an assembly language. IL code is represented as a list of commands with each instruction on a new line and any comments you might want to add at the end of each line.
IL uses compact code, is straightforward to read and quick and easy to program. However, there are few structuring possibilities and identifying and troubleshooting errors can be tricky.
Structured Text (ST) is another text-based language. It’s a high-level, block-structured language that resembles languages like Basic, C++ and Pascal. Since ST is similar to traditional coding languages, it can be easier to learn than other PLC languages for people with a coding background.
It’s an incredibly powerful language that can be programmed to carry out simple repetitive tasks or complex tasks using algorithms and mathematical functions.
Because ST is a text-based language, it runs faster and requires less space than graphical languages.
If you don’t have a coding background, ST can be a difficult language to learn. The syntax can be dense and complex, it can be hard to troubleshoot and tricky to edit online.
However, it’s also the best language for computing large mathematical calculations and programming complex tasks.
Which language is right for you?
Ladder Logic is the most commonly used PLC programming language. However, most people will be guided by what PLC language their workplace uses. If your workplace machinery uses Ladder Logic, then there isn’t much point learning ST.
If your work involves designing automation applications, then you may be required to know all the major PLC programming languages to be able to determine which one is right for your application.
It’s also worth noting that some PLC brands will only work with specific languages, while others will support all major languages. Some PLC brands will require add-ons before they will support other languages.
It’s worth doing some serious research into your workplace, your PLC controllers and software and your design applications before deciding which language is right for you.