Download Prospectus


Understanding different programming techniques

In our previous articles, we looked at PLC systems and what they are, as well as their interface requirements. Now we’re going to look at the different programming techniques we can use in a PLC system.

PLC programming

A PLC program is a set of instructions representing the logic that governs the process the PLC is controlling. There are two main classifications of PLC programming languages.  These can be divided into sub-classifications:

  1. Textual Language
    • Instruction list
    • Structured text
  2. Graphical Form
    • Ladder Diagrams (LD) (i.e. Ladder Logic)
    • Function Block Diagram (FBD)
    • Sequential Function Chart (SFC) 

While all of these can be used, graphical languages are generally preferable.  We’re going to look at some of these languages now.

Ladder Logic

This is the simplest form of PLC programming.  It’s also known as ‘relay logic’.  The relay contacts used in relay controlled systems are represented using ladder logic.  The image below shows a simple example of a ladder diagram:

In this example, two pushbuttons are used to control the same lamp load. When any one of the switches is closed, the lamp will glow.  The two horizontal lines are called rungs and the two vertical lines are called rails.

, Understanding different programming techniques

Every rung forms the electrical connectivity between Positive rail (P) and Negative rail (N). This allows the current to flow between input and output devices

Functional Block Diagrams

A Functional Block Diagram (FBD) is a simple graphical method to program multiple functions in a PLC.  A function block is a program instruction unit that yields one or more output values when executed.

, Understanding different programming techniques

It’s represented as a rectangular block with inputs entering on the left, and outputs leaving on the right.  It shows a relationship between the state of the input and output.

The advantage of using FBD is that any number of inputs and outputs can be used on the functional block. When using multiple input and outputs, you can connect the output of one function block to the input of another.

, Understanding different programming techniques

The figure below shows a ladder diagram and its function block equivalent in Siemens notation.

, Understanding different programming techniques

Structured Text Programming

This is a programming language that uses statements to determine what to execute.  It follows more conventional programming protocols but it is not case sensitive.  A series of statements (logic) consists of expressing assignments and relationships using several operators. The structure’s text operators are listed in the image.
, Understanding different programming techniques

Many early PLCs were not capable of graphical representation of the logic, so it was instead represented as a series of logical expressions in a Boolean format

As programming terminals evolved, it became more common for ladder logic to be used because it was a familiar format used for electro-mechanical control panels. More modern formats, such as state logic and Function Block diagrams, exist, but they are still not as popular as ladder logic.  A possible reason for this is that programmers prefer the more visual appeal of ladder logic over structured text programming.

Until approximately the mid-1990s, PLCs were programmed using proprietary programming panels or special-purpose programming terminals, which often had dedicated function keys representing the various logical elements of PLC programs. Some proprietary programming terminals displayed the elements of PLC programs as graphic symbols, but plain ASCII code representations of contacts, coils, and wires were common.

Keep an eye out for our next articles, where we’re going to dive even further into Programmable Logic Controller systems and their uses.

Interested in our courses?

You can read more about our selection of accredited online electrical and electronic engineering courses here.

Check out individual courses pages below:

Diploma in Electrical and Electronic Engineering

Higher International Certificate in Electrical and Electronic Engineering

Diploma in Electrical Technology

Diploma in Electronics

Diploma in Renewable Energy (Electrical)

Higher International Diploma in Electrical and Electronic Engineering

Alternatively, you can view all our online engineering courses here.

Recent Posts

What are the principles of operation of electrical cells?

What are the principles of operation of electrical cells? In our last article, we looked at the basic electrical parameters in D.C. circuits.  In this article, we’re going to move on to the principles of operation of electrical cells.  We’ll look at the different types of cells and batteries, their mechanisms, and their applications. What […]

How can we calculate basic electrical parameters?

How can we calculate basic electrical parameters? In our last article, we looked at how we can select the best engineering material for the task.  In this article, we’re going to move on to basic electrical parameters in D.C. circuits. As an engineer, we need to be able to define these key terms and apply […]

How can we select engineering materials?

How can we select engineering materials? In our previous article, we looked at elastic and magnetic hysteresis. In this article, we’re going to look at how we can select engineering materials.  In other articles, we have previously looked at the different materials and their properties.  However, it’s important that engineers understand how we can go […]