# What is a ladder logic and what is ladder logic diagram in PLC

The ladder logic is a logical programming language that is used to program a PLC. Mostly a ladder logic is based on the following logic functions AND, OR, Exclusive OR, inclusive OR. Ladder logic is a kind of electrical logic schematic diagram. It was created to describe the logic made from the relay. It got its name because its programming structure looks like a ladder. The ladder logic would have two vertical rails and a series of rungs. The ladder logic diagram is evolved from electrical diagrams, and it shows how electric current flows through the device in order to complete an electric circuit.

How do you make a ladder logic diagram and how does it operate

In the above diagram, we can see a ladder diagram. The left and right lines are power lines, rung is the horizontal lines in which the components are placed. In a ladder diagram, the input instructions must be entered at the left side and the output instructions on the right. The lines which are in horizontal are the rungs and each rung represents the operation in the control process. More than one input can be used per rung in PLC. The PLC programming is done by using many logical functions, in a PLC program, the input and rungs could be true or false. The ladder logic programming is based on certain logical functions such as AND, OR, and exclusive OR. Mostly in a ladder diagram, the rung would contain one or more input and an output, the input is a control action and the output is for the device which is connected to the PLC output. The control instructions are operated by rung logic and with this, it can control the operation of the device that is connected to the PLC output. So if there is any logical continuity then the control out will be energized by the PLC. If not then the instruction will be off.

The PLC will process the code from left to right and top to bottom. Ladder logic is the most widely used program for PLC where sequential control of a process or manufacturing operation is needed. Ladder logic is used for simple and complicated control systems. So now PLCs are used for many complex automation systems.

The above image shows the logical AND & logical OR functions and its ladder diagram as the image shows in order to execute an output in AND function all the input must be true while in case of OR function the output will execute if any of the instruction is true.

There are many logic symbols that are used in ladder logic, such as timers, counters, math, and data moves. So because of this we can use any logical function, or control function in the ladder logic. The control decisions are made by logic gates. Then CPU’s are used to do all these functions