What are PLC Programming Languages?

7 min video  /  6 minute read
 

Odds are, you’ve heard of Ladder Logic, the ubiquitous PLC programming language favored by many industrial professionals, but most organizations utilize multiple languages for their PLC programming needs. See how learning about all five common languages — Ladder Logic, Function Block Diagram, Sequential Function Charts, Structured Text, and Instruction List — will expand your PLC programming skills and let you get a leg up on your peers.

Transcript: 

00:07
Eric Knorr: Odds are, you've heard of Ladder logic, the ubiquitous PLC programming language favored by many industrial professionals. But how much do you know about the other four common PLC programming languages?

00:19
Eric Knorr: The reality is, that when it comes to PLC programming for industrial automation, most organizations utilize multiple languages for their PLC programming needs. By learning about all five languages, you'll be able to expand your PLC programming skills and get a leg up on your peers. Before we dive in, let's take a moment to define PLC programming. So what is PLC programming? PLC programming is the act of creating instructional code for a programmable logic controller to follow in order to automate industrial processes. The steps to program a PLC are, first, map out how the system will function. Then use a PLC programming language to write out the instructional code. Next, test, troubleshoot and debug the code. Finally, download the program onto a PLC and verify that it works properly. A PLC will use the program's logic to determine if it should change the state of an output, depending on the state of an input, status of a timer, a combination of several input states, et cetera. For example, a PLC programmer may include directions to turn an alarm, the output, to on when a tank sensor, the input, exceeds a certain temperature.

01:30
Eric Knorr: Now, let's look more closely at step two. The five PLC programming languages defined in the International Electro Technical Commission's Standard IEC 61131-3 are ladder logic, function block diagram, sequential function charts, structured text and instruction list. Each of these languages fall into one of two categories. Graphical or textual. Graphical languages are crafted with visual elements, whereas textual languages are strings of text. Ladder logic known as ladder diagram is a graphical PLC programming language based on relay logic's circuit diagrams. Ladder logic consists of two parallel bars connected by a series of rungs assembling a ladder. Hence the name. There are contacts and coils on these rungs, which symbolize inputs such as sensor value and outputs like a motor run command. The vast majority of control system programming in North America uses ladder logic and for good reason. It's flexible, versatile, simple to troubleshoot, and easy to learn.

02:35
Eric Knorr: One drawback however, is that once a ladder hits a certain amount of rungs, it can become unwieldy. In order to maintain its usability, the process needs to be split into multiple ladders. Some good use cases for ladder logic are state machines, PID controls and systems with an abundance of Boolean algebra. Function Block diagram or FBD is another popular graphical PLC programming language that consists of various kinds of blocks that have inputs and outputs. Devices connected to the PLC can be linked to an input, and variables can be sent to an output. Additionally, blocks connect to each other. The output of one block can feed into another block's input. These blocks are what define the functions of a system. The FBD language is relatively simple, though it does require some training to use. It's a great choice for safety PLCs, PID loops, and when you need to perform encapsulation, reuse code frequently, hide or preserve data or create analog input filtering. Sequential function charts or SFC is a graphical PLC programming language based on graph set and resembles computer science algorithm flow charts.

03:44
Eric Knorr: SFC consists of steps and transitions. Steps are actions to be performed, and transitions are the logic conditions that need to be met before moving on to the next step. Due to the nature of this architecture, SFC controls a program's operational flow. A major benefit to using SFC is how it can simplify a complicated process by dividing it up into more manageable parts. It can also be easier to test and troubleshoot than some of the other languages. SFC is ideal for complex multi-state processes, linked processes, multiple processes running in parallel or sequentially in batch production. Structured text or ST is a high level PLC programming language. ST is a textual language with syntax comparable to C or C++. So those who have studied those types of computer programming languages will have an easier time picking it up. In ST, statements such as if, and or then are used to perform functions.

04:44
Eric Knorr: ST is a concise language that executes quickly and can be read by humans without much difficulty. Troubleshooting ST however can be a more involved process because the states of variables are not as easily discernible. This language excels for situations like barcode parsing, looping, manipulating data, bridging the gap to machine code, complicated math or searching data. Instruction list or IL is a low level textual PLC programming language. IL was deprecated in the IEC standard, so it's doubtful you will encounter any newer PLCs programmed with this language. However, some current or older PLCs may still use IL. So it's helpful to know how it functions. IL consists of a simple series of instructions similar to assembler language. Jump or store are examples of some of the common commands. If you are considering using IL for new programs, you should opt for structured text instead. Now that you're familiar with all five languages, something to keep in mind is that the use cases we've covered can be done in other languages as well.

05:51
Eric Knorr: Take PID loops as an example. While we only highlighted them in function block diagram, they are used in all five languages. So how do you determine which language is best for your project? All five of these languages can accomplish anything that your PLC is capable of. Choosing which language to use often depends on practical or situational considerations for deployment and maintenance. Ask yourself, who will be maintaining the program? What are your customer's preferences? What skill level do the programmers, engineers, and maintenance personnel have? Another thing to note is that some programming software has licensing restrictions which may limit access to sequential function chart, function block diagram, and or structured text. Luckily, there are softwares like Inductive Automation's, Ignition platform that are compatible with any kind of PLC and your chosen programming Language. Ignition gives you the freedom to break out of the ladder logic box and choose the best languages and hardware for your project. Click this link to learn more about Ignition. It's variety of built-in communication drivers and the SFC module with features like chart monitoring, hot editability, and a drag and drop programming tool in our inductive university courses.

Posted on December 19, 2024