What is Relay Logic and Ladder Logic?

Control engineering has evolved over time. In the past humans were the main method for controlling a system. More recently electricity has been used for control and early electrical control was based on relays.

These relays allow power to be switched on and off without a mechanical switch. It is common to use relays to make simple logical control decisions. The development of low cost computer has brought the most recent revolution, the Programmable Logic Controller (PLC).

The advent of the PLC began in the 1970s, and has become the most common choice for manufacturing controls.

PLCs have been gaining popularity on the factory floor and will probably remain predominant for some time to come.

Most of this is because of the advantages they offer.

  • Cost effective for controlling complex systems.
  • Flexible and can be reapplied to control other systems quickly and easily.
  • Computational abilities allow more sophisticated control.
  • Trouble shooting aids make programming easier and reduce downtime.
  • Reliable components make these likely to operate for years before failure.

Ladder Logic

Ladder logic is the main programming method used for PLCs. As mentioned before, ladder logic has been developed to mimic relay logic. The decision to use the relay logic diagrams was a strategic one.

By selecting ladder logic as the main programming method, the amount of retraining needed for engineers and tradespeople was greatly reduced. Modern control systems still include relays, but these are rarely used for logic.

A relay is a simple device that uses a magnetic field to control a switch, as pictured in below Figure. When a voltage is applied to the input coil, the resulting current creates a magnetic field. The magnetic field pulls a metal switch (or reed) towards it and the contacts touch, closing the switch.

The contact that closes when the coil is energized is called normally open. The normally closed contacts touch when the input coil is not energized. Relays are normally drawn in schematic form using a circle to represent the input coil.

The output contacts are shown with two parallel lines. Normally open contacts are shown as two lines, and will be open (non-conducting) when the input is not energized. Normally closed contacts are shown with two lines with a diagonal line through them.

When the input coil is not energized the normally closed contacts will be closed (conducting).

Relay Logic and Ladder Logic

Relays are used to let one power source close a switch for another (often high current) power source, while keeping them isolated.

An example of a relay in a simple control application is shown in below Figure.

In this system the first relay on the left is used as normally closed, and will allow current to flow until a voltage is applied to the input A.

The second relay is normally open and will not allow current to flow until a voltage is applied to the input B. If current is flowing through the first two relays then current will flow through the coil in the third relay, and close the switch for output C.

This circuit would normally be drawn in the ladder logic form. This can be read logically as C will be on if A is off and B is on.

The example in above Figure does not show the entire control system, but only the logic. When we consider a PLC there are inputs, outputs, and the logic. Above Figure shows a more complete representation of the PLC.

Here there are two inputs from push buttons. We can imagine the inputs as activating 24V DC relay coils in the PLC. This in turn drives an output relay that switches 115V AC, that will turn on a light.

Note, in actual PLCs inputs are never relays, but outputs are often relays. The ladder logic in the PLC is actually a computer program that the user can enter and change.

Notice that both of the input push buttons are normally open, but the ladder logic inside the PLC has one normally open contact, and one normally closed contact.

Do not think that the ladder logic in the PLC needs to match the inputs or outputs. Many beginners will get caught trying to make the ladder logic match the input types.

Relay Logic and Ladder Logic are two graphical programming languages commonly used in the field of industrial automation and control systems. Both languages provide a way to design and represent control logic for various electromechanical processes.

Let’s take a closer look at each:

Relay Logic

Relay Logic is a control system programming language that mimics the behavior of electromechanical relays using traditional ladder diagrams. In relay logic, control circuits are built using various relay symbols connected by lines to represent the flow of current. Each relay symbol represents a specific logic or operation, such as contacts (normally open or normally closed), coils, timers, and other components.

Relay Logic diagrams are constructed vertically, resembling electrical ladder diagrams, hence the term “ladder logic.” The design and layout of the ladder diagram represent the sequence and logic of the control operations. The control logic is based on the principles of relay-based control systems, where the activation or deactivation of relays determines the state and behavior of the system.

While Relay Logic is a simple and intuitive programming language, it is primarily used for basic control functions and can become complex and difficult to maintain for larger control systems.

Ladder Logic

Ladder Logic is a graphical programming language specifically designed for programmable logic controllers (PLCs), which are widely used in industrial automation. Ladder Logic is named so because its graphical representation resembles the rungs of a ladder.

Ladder Logic uses a set of predefined symbols and graphical elements to represent various input and output devices, contacts, coils, timers, counters, and other control functions. The symbols are interconnected in a horizontal manner, representing the flow of electrical current and the logical relationships between the components.

The control logic in Ladder Logic is created by combining different ladder diagram elements to form a network of interconnected rungs. Each rung represents a specific control operation or condition, and the logical flow follows from left to right. The output of one rung can become an input for the next rung, allowing complex control sequences to be developed.

Ladder Logic provides a flexible and powerful means of designing control systems, and it is widely supported by PLC manufacturers. It allows for the creation of complex control algorithms while offering features like timers, counters, math operations, and data manipulation.

Ladder Logic is a versatile and widely adopted programming language for industrial automation due to its familiarity, ease of use, and the robustness of PLC platforms.

Both Relay Logic and Ladder Logic are still used in some industries, particularly in legacy systems. However, as technology advances, more modern programming languages, such as Structured Text and Function Block Diagrams, are becoming increasingly prevalent in industrial automation and control.