GE / IP FANUC Series 90/30 In Stock
Ladder Logic, also referred to as Ladder Diagram (LD), is a graphical, IEC 61131-3 standardized programming language used to program PLCs (Programmable Logic Controllers). It formulates the logic operations of PLCs in symbolic notations that represent the PLC inputs and outputs, and conditional expressions. While the logic framework is created using rails and rungs, as we’ll discuss later.
Ladder Diagrams are mainly used to formulate bit logic PLC operations, although they can still be used to scale analog PLC inputs. In essence, a PLC accepts input data from a variety of field input devices such as pushbuttons, sensors, switches, etc., processes the input data based on a user-programmed control logic, and activates the connected field output devices (e.g. motor starters, solenoid valves, relays, etc.) as per the execution results of the control algorithm.
The user-programmed control algorithm executed by the PLC is the Ladder Logic; it describes the logical relationships between the PLC inputs and outputs in a graphical form, as though they were relay coils and contacts in a relay-based control system.
Originally, Ladder Logic was designed to replace hard-wired relay logic circuits (combination of electromechanical switches, relay contacts, and relay coils), as before the invention of PLCs, relay-based control systems were the standard for controlling machinery in different industrial applications.
As such, the 1st generation of PLCs were programmed using Ladder Logic – a technique that greatly resembled the electrical schematics of relay logic. This eliminated the need to retrain control system designers, engineers, and technicians how to program the newly adopted PLC systems, as they were already accustomed to relay-based control systems.
To date, Ladder Diagram is still the most widely used PLC programming language, as it provides a simple technique of creating complex logic expressions for PLCs used in a broad range of industrial automation applications to automate various industrial processes and repetitive machine tasks. Examples of industrial applications where Ladder Logic PLC programs are used include: material handling conveyor systems, cement batching, fluid flow and pressure control, beverage bottling and labelling, ball mill lubrication systems, logistics, etc.
As previously stated, Ladder Logic was designed to mimic relay logic circuits. These relay logic circuits were based upon electrical wiring diagrams whose wiring layout closely resembled an upright ladder, with two vertical power rails and several horizontal lines (called rungs) that represented control circuits. In a similar way, every Ladder Logic program is organized to resemble a ladder-like relay logic circuit – hence the name “Ladder Logic”.
To better understand how a Ladder Logic program is drawn and implemented in a PLC there are seven key elements of a Ladder Diagram (LD) that are crucial to know. They include:
Rails: These are two vertical lines that run down the extreme ends of a Ladder Logic PLC program. They indicate the beginning and end of every line of symbolic code in the LD program. In relay logic control circuits, the two vertical rails represent the opposing polarity of a power supply, where electric current flows from the left-hand side to the right-hand side.
Rungs: Rungs are horizontal lines that are drawn in between the two vertical rails. They describe the logic flow through the graphical PLC code, by connecting the vertical rails to the logic expressions of the PLC program. You can include different types of Ladder Logic symbols in the rungs to create the PLC logic you need. The rungs are numbered in an ascending sequential order, usually on the left side of the first rail, and can be as many as necessary.
Note, in a relay-based control circuit, rungs are the physical wires that link the power supply terminals to the switching components and relay coils of the circuit.
Inputs: These are the field input devices that are directly wired to terminals of the PLC system. They provide the PLC with input data when triggered by an external control action, for example pressing a push button or activating a limit switch connected to the PLC system would be considered as a PLC input.
In a Ladder Logic program, PLC inputs are represented by Normally Closed (NC) and Normally Open (NO) relay contact symbols. The Ladder Logic symbol for a Normally Open relay contact includes two parallel line segments with an empty space in between, while the symbol for a Normally Closed relay contact includes a diagonal line crossing through the space between the two parallel line segments
Outputs: Outputs are the external devices, such as motor starters, relay coils, solenoid valves, light bulbs, etc., that are actuated by the PLC system. In Ladder Diagrams, PLC outputs are mainly represented by relay coil symbols, drawn as either pairs of parentheses or circles.
Logic Expressions: These are binary (digital) and logic concepts that are used along with the PLC inputs and outputs in order to formulate the required control operations. Logic is basically the ability to determine what control action ought to be performed depending on the state of the connected PLC input(s). While the binary concept describes a system with only two possible outputs: “0 or 1”, “High or Low”, “True or False”, “Yes or No”, etc.
For example, the logic expression for a specific ladder rung can be written as: IF M THEN W.
And the PLC input “M” can have two possible states, resulting in two probable logic iterations: IF input M = False THEN Output W = False IF input M = True THEN Output W = True
Boolean Expressions: These are statements that evaluate a condition using logical operators, such as “AND”, “OR”, “NOT”, and “XOR”, and result in a truth value (Boolean value), i.e., “TRUE” or “FALSE”. For instance, the statement “A and Y = TRUE”, is a Boolean expression.
Timer Functions: These are timing instructions available in three basic types: ON-Delay Timers (TON), Retentive Timers (RTO), and OFF-Delay Timers (TOF). Each type of PLC timer performs a unique function. For instance, they can be used to measure the time span of specific events, create time-based sequences, or provide a preset delay to the activation or deactivation of field output devices. The three timers have single inputs that trigger the timed function.
Counter Functions: They comprise of counting functions like “Count Up” or “Count Down” to increase or decrease values on every transition of a PLC input.
Math Functions: These are basically mathematical instructions used to perform different types of calculations, i.e., addition, subtraction, division, finding square roots, multiplication, or changing the sign of a data set.
Comparison Functions: They perform comparisons to determine if values are equal, less than, or greater than.
Specialty Functions: These functions are used to implement specialized control objectives. They include PID loops, ramp generators, communication instructions, shift registers, etc.
Tag Names & Address Notation: Tag Names are symbolic addresses assigned to each input and output bit in the Ladder Logic program; they describe the real-world I/O devices connected to the PLC system in a more readable and easily-interpreted format. Address Notation describes the PLC’s memory addressing structure for the logic expressions, inputs, and outputs included in the Ladder Diagram.
Comments: These are pieces of texts that are displayed at the beginning of each ladder rung or set of rungs. They are used to explain or clarify the control operations and logical expressions being executed in a particular rung, or set of rungs. Note, comments in Ladder Logic are not executed by the PLC’s processor.
How to write and read ladder logic programs and ladder diagrams is a rule-based PLC programming language, meaning certain conditions have to be met for an output to be activated. As such, to read and write a feasible Ladder Logic program there are a couple of basic principles to keep in mind: a) Left to Right and Top to Bottom Rule As discussed in the above section, every PLC program written using Ladder Diagram includes two vertical rails (a left and right rail) that are connected by several rungs in between. A Ladder Logic program is read from the left vertical rail to the right vertical rail and then consecutively, from the first horizontal rung to the last horizontal rung – Top to Bottom.
Inputs are on the Left, Outputs are on the Right The Ladder rungs contain inputs on the left-hand side that either block or pass the flow of the control logic. Standard symbols for Normally Closed (NC) and Normally Open (NO) relay contacts are common inputs in Ladder Logic programs. The output of each rung is represented in the last symbol on the right-hand side of the rung. Outputs in Ladder Diagrams are indicated as standard relay coil symbols. Other control instructions housed in the ladder rungs appear as rectangular boxes.
Note, the inputs, outputs, and logic expressions contained in the ladder rungs are referenced by variables or tag names.
Use of Logical Operators to Create a Logical Flow Ladder Logic programs are based on the principles of relay logic circuits, but they don’t include physical electrical conductors to transmit the input signals through to the outputs. Each ladder rung is a program statement consisting of a condition(s), along with some type of control action. The PLC inputs are the conditions, while the control action or output is the result of executing the ladder rungs.
Also, just like in hard-wired relay controls where physical devices are connected in parallel or series, PLCs also combine the Ladder Logic instructions in parallel or series. However, instead of working with physical electrical wiring connections, PLCs combine the instructions embedded in the ladder rungs logically using logical operators, such as “AND”, “NOT”, and “OR”.
The logical operators combine the ladder rung instructions allowing the PLC to execute logic functions that make the output of each rung a Boolean value, either “TRUE” or “FALSE”. The logic functions are automatically built into each ladder rung.
The logic “AND” function evaluates multiple PLC inputs to generate a single output. With the “AND” function, the resulting output can only be “TRUE” if all the evaluated PLC inputs are “TRUE”. But in case one of the PLC inputs is “FALSE”, then the corresponding outcome will be “FALSE”.
In a Ladder Logic program, the “AND” function can be expressed symbolically by connecting PLC input M (shown as a Normally Open relay contact) and PLC input Q (indicated as a Normally Closed relay contact) and a PLC output W (represented by a relay coil) in one line, in a manner akin to a series electrical circuit that provides a single “electrical path” for current flow.
The logic expression for this setup can be written as: IF M AND Q THEN W. The inbuilt “IF… THEN” functions are included into the rung as statements for better understanding of the given conditions.
The logic “OR” function also evaluates multiple PLC inputs to generate a single outcome. With the “OR” function, the resulting output can only be “FALSE” if all the evaluated PLC inputs are “FALSE”. If any of the PLC inputs is “TRUE”, then the corresponding output will be “TRUE”.
In a Ladder Logic program, the “OR” function can be expressed symbolically by creating a branch with PLC input Q (indicated as a Normally Closed relay contact) across PLC input M (represented by a Normally Open relay contact), and then connecting the PLC output W (shown as a relay coil) in line with the ladder rung.
The logic expression for this setup can be written as: IF M OR Q THEN W.
Ladder Logic operates akin to relay logic, featuring power supply rails, relay contacts (inputs), relay coils (outputs), PID controllers, timers, counters, and a myriad of functions also accessible with relay-based controllers.
In the realm of relay logic, physically wired control circuits are employed to craft the logic expressions, often leading to expansive racks of intricate relays and control wiring. Contrastingly, with Ladder Diagrams, the control logic is inscribed into the PLC memory. Therefore, the sole physical wiring requisite is for the PLC inputs and outputs. In essence, external output and input apparatuses are directly interfaced with the PLC system, and the programmed Ladder Logic delineates which output devices to actuate, contingent on the received input signals.
Moreover, while relay logic is materialized through hard-wiring physical entities like electromechanical switches, relays, and coils, Ladder Diagrams are virtual circuits incarnated as programs in PLCs. Herein, virtual “electric power” navigates through virtual “relay contacts” (solely when closed) to energize virtual “relay coils” to fulfill the required logical functions.
To enact the programmed Ladder Logic, the Central Processing Unit (CPU) of a PLC initially scans all the tethered field input devices and refreshes their status in the PLC memory. Subsequently, it traverses through and assesses each rung of the Ladder Logic, from the left rail to the right rail, and then sequentially, top to bottom.
Upon evaluating the last rung, the CPU executes the emergent logic and updates the tethered field output devices correspondingly. It then recommences the process by conducting checks on the PLC hardware and software for faults.
This entry was posted on October 9th, 2023 and is filed under Automation, Communication, Education. Both comments and pings are currently closed.
PDF Supply sells used surplus products. PDF Supply is not an authorized distributor, affiliate, or representative for the brands we carry. Products sold by PDF Supply come with PDF Supply’s 1-year, 2-year, or 3-year warranty and do not come with the original manufacturer’s warranty. Designated trademarks, brand names and brands appearing herein are the property of their respective owners. This website is not sanctioned or approved by any manufacturer or tradename listed.
Rockwell Disclaimer: The product is used surplus. PDF Supply is not an authorized surplus dealer or affiliate for the Manufacturer of this product. The product may have older date codes or be an older series than that available direct from the factory or authorized dealers. Because PDF Supply is not an authorized distributor of this product, the Original Manufacturer’s warranty does not apply. While many Allen-Bradley PLC products will have firmware already installed, PDF Supply makes no representation as to whether a PLC product will or will not have firmware and, if it does have firmware, whether the firmware is the revision level that you need for your application. PDF Supply also makes no representations as to your ability or right to download or otherwise obtain firmware for the product from Rockwell, its distributors, or any other source. PDF Supply also makes no representations as to your right to install any such firmware on the product. PDF Supply will not obtain or supply firmware on your behalf. It is your obligation to comply with the terms of any End-User License Agreement or similar document related to obtaining or installing firmware.