The Basics of Ladder Logic

Wed, 11/03/2021 - 14:15

One of the top 5 most popular types of PLC programming languages is ladder logic. But what makes it so popular, and what does it take to master the language? Ladder logic is a programming language and one of the first languages that was ever used for PLCs or programmable logic controllers.

If you’re interested in working with PLCs, then you have to know the basics of ladder logic and how important it is to these machines. Learning ladder logic is basically like learning a new language, but thankfully, if you already have some working knowledge of PLCs, you’ll catch on quickly. In this article, we will discuss the history of ladder logic, why it’s popular, ladder programming, and ladder logic basics.
 

simple plc

The History of Ladder Logic 

To understand the history of ladder logic, let’s begin with a definition of process control. Process control is commonly understood as a discipline that uses industrial control systems to achieve consistency and safety during production that could not be achieved manually by humans alone. 

Ladder logic began as a method to document the design and construction of relay racks as used in manufacturing and process control. Relay racks are storage systems that are used for networking and communications equipment, and were popularly used prior to the 2000s. They were numbered in some fashion, usually top to bottom and left to right like spreadsheet cells. 

Each device would be represented by a symbol with their corresponding devices. External devices would also be shown on the diagram, such as pumps and heaters. However, relays were expensive and they often failed quickly as the mechanical parts wore out and the electricity used burned away the parts. With the advent of PLCs, it was essential to keep similar systems in place, thus ladder logic evolved to become the first PLC programming language. 

Why is Ladder Logic Popular?

Ladder logic is the most popular method of PLC programming because it is a graphics based programming language and mimics relay logic. Engineers, electricians and students that are already familiar with relay logic found it easy to transition from an electric circuit to ladder logic, compared to other text based programming languages.

Ladder logic was designed to have the same look as electrical ladder diagrams, but instead, the physical contacts and coils are replaced with memory pieces. When programming ladder logic in a PLC, the graphic, drag and drop nature of ladder diagrams helps create code quickly. Ladder logic also helps troubleshoot code because visually, the flow of logic from the LHS start rail can be seen through the logic symbols and to the RHS end rail.

programmable logic controller

The Key Components

 

ladder logic program

As with computers, PLCs operate with binary signals, using 1 or 0 - this type of data is called a boolean. When implementing a ladder logic program in a PLC there are seven basic components that are important to know: 

Rails: vertical lines running down the far most ends of the page. If they were in a relay logic circuit they would represent the active and zero volt connections of the power supply where the power flow goes from the left hand side to the right hand side.

Rungs: horizontal lines that connect the rails to the logic expressions. If they were in a relay logic circuit they would represent the wires that connect the power supply to the switching and relay components. Each rung is numbered in ascending sequential order.

Inputs: the inputs are external control actions such as a push button being pressed or a limit switch being triggered.

Outputs: the outputs are external devices that being are turned on and off such as an electric motor

Logic Expressions: used in combination with the inputs and outputs to formulate the desired control operations.

Address Notation/Tag Names: the address notation describes the input, output and logic expression memory addressing structure of the PLC. The tag names are the descriptions allocated to the addresses.

Comments: comments are displayed at the start of each rung and are used to describe the logical expressions and control operations that the rung, or groups of rungs, are executing.

To execute ladder logic, the PLCs central processing unit (CPU) will read the physical units tied to the input and output modules, updating their status in the CPU’s memory. The CPU then works its way down the ladder, executing each rung from left to right. Once the CPU reaches the last rung, it will update the real outputs and then loop back around and start over again. 

You Can Master Ladder Logic 

Because ladder logic is the most popular programming language used for PLCs, it’s integral to learn if you’re interested in working with them. Ladder programming is a visual language, and because it mimics electrical relay circuits, most people find it easy to learn ladder logic basics.

The Programmable Logic Controllers Technician (PLC) certificate program is uniquely positioned to provide training and educational insights for individuals interested in working with PLCs across industries. Contact us for more details about the program and how you can register. 

Add new comment