Ladder logic was originally a written method to document the design and construction of relay racks as used in manufacturing and process control.[1] Each device in the relay rack would be represented by a symbol on the ladder diagram with connections between those devices shown. In addition, other items external to the relay rack such as pumps, heaters, and so forth would also be shown on the ladder diagram.
Ladder logic has evolved into a programming language that represents a program by a graphical diagram based on the circuit diagrams of relay logic hardware. Ladder logic is used to develop software for programmable logic controllers (PLCs) used in industrial control applications. The name is based on the observation that programs in this language resemble ladders, with two vertical rails and a series of horizontal rungs between them. While ladder diagrams were once the only available notation for recording programmable controller programs, today other forms are standardized in IEC 61131-3 (For example, as an alternative to the graphical ladder logic form, there is also a more assembly language like format called Instruction list within the IEC 61131-3 standard.).
- 2Syntax & Examples
Overview[edit]
Part of a ladder diagram, including contacts and coils, compares, timers and monostable multivibrators
Ladder logic is widely used to program PLCs, where sequential control of a process or manufacturing operation is required. Ladder logic is useful for simple but critical control systems or for reworking old hardwired relay circuits. As programmable logic controllers became more sophisticated it has also been used in very complex automation systems. Often the ladder logic program is used in conjunction with an HMI program operating on a computer workstation.
The motivation for representing sequentialcontrol logic in a ladder diagram was to allow factory engineers and technicians to develop software without additional training to learn a language such as FORTRAN or other general purpose computer language. Development and maintenance were simplified because of the resemblance to familiar relay hardware systems.[2] Implementations of ladder logic may have characteristics, such as sequential execution and support for control flow features, that make the analogy to hardware somewhat inaccurate.
Ladder logic can be thought of as a rule-based language rather than a procedural language. A 'rung' in the ladder represents a rule. When implemented with relays and other electromechanical devices, the various rules execute simultaneously and immediately. When implemented in a programmable logic controller, the rules are typically executed sequentially by software in a continuous loop, or 'scan'. By executing the loop fast enough, typically many times per second, the effect of simultaneous and immediate execution is achieved. Proper use of programmable controllers requires an understanding of the limitations of the execution order of rungs.
Syntax & Examples[edit]
The language itself can be seen as a set of connections between logical checkers (contacts) and actuators (coils). If a path can be traced between the left side of the rung and the output, through asserted (true or 'closed') contacts, the rung is true and the output coil storage bit is asserted (1) or true. If no path can be traced, then the output is false (0) and the 'coil' by analogy to electromechanical relays is considered 'de-energized'. The analogy between logical propositions and relay contact status is due to Claude Shannon.
Ladder logic has contacts that make or break circuits to control coils. Each coil or contact corresponds to the status of a single bit in the programmable controller's memory. Unlike electromechanical relays, a ladder program can refer any number of times to the status of a single bit, equivalent to a relay with an indefinitely large number of contacts.
So-called 'contacts' may refer to physical ('hard') inputs to the programmable controller from physical devices such as pushbuttons and limit switches via an integrated or external input module, or may represent the status of internal storage bits which may be generated elsewhere in the program.
Each rung of ladder language typically has one coil at the far right. Some manufacturers may allow more than one output coil on a rung.
- Rung input : checkers (contacts)
—[ ]--
Normally open contact, closed whenever its corresponding coil or an input which controls it is energized. (Open contact at rest)—[]--
Normally closed ('not') contact, closed whenever its corresponding coil or an input which controls it is not energized. (Closed contact at rest)
- Rung output: actuators (coils)
—( )--
Normally inactive coil, energized whenever its rung is closed. (Inactive at rest)—()--
Normally active ('not') coil, energized whenever its rung is open. (Active at rest)
The 'coil' (output of a rung) may represent a physical output which operates some device connected to the programmable controller, or may represent an internal storage bit for use elsewhere in the program.
A way to recall these is to imagine the checkers (contacts) as a push button input, and the actuators (coils) as a light bulb output. The presence of a slash within the checkers or actuators would indicate the default state of the device at rest.
Logical AND[edit]
The above realizes the function: Door motor = Key switch 1 AND Key switch 2
This circuit shows two key switches that security guards might use to activate an electric motor on a bank vault door. When the normally open contacts of both switches close, electricity is able to flow to the motor which opens the door.
Logical AND with NOT[edit]
The above realizes the function: Door motor = Close door ANDNOT(Obstruction).
This circuit shows a push button that closes a door, and an obstruction detector that senses if something is in the way of the closing door. When the normally open push button contact closes and the normally closed obstruction detector is closed (no obstruction detected), electricity is able to flow to the motor which closes the door.
Logical OR[edit]
The above realizes the function: Unlock = Interior unlock OR Exterior unlock
This circuit shows the two things that can trigger a car's power door locks. The remote receiver is always powered. The unlock solenoid gets power when either set of contacts is closed.
Industrial STOP/START[edit]
In common industrial latching start/stop logic we have a 'Start' button to turn on a motor contactor, and a 'Stop' button to turn off the contactor.
When the 'Start' button is pushed the input goes true, via the 'Stop' button NC contact. When the 'Run' input becomes true the seal-in 'Run' NO contact in parallel with the 'Start' NO contact will close maintaining the input logic true (latched or sealed-in). After the circuit is latched the 'Stop' button may be pushed causing its NC contact to open and consequently the input to go false. The 'Run' NO contact then opens and the circuit logic returns to its inactive state.
The above realizes the function: Run = (Start OR Run) AND (NOT Stop)
This latch configuration is a common idiom in ladder logic. It may also be referred to as 'seal-in logic'. The key to understanding the latch is in recognizing that the 'Start' switch is a momentary switch (once the user releases the button, the switch is open again). As soon as the 'Run' solenoid engages, it closes the 'Run' NO contact, which latches the solenoid on. The 'Start' switch opening up then has no effect.
- Note: In this example, 'Run' represents the status of a bit in the PLC, while 'Motor' represents the actual output to the real-world relay that closes the motor's real-world circuit.
For safety reasons, an Emergency-Stop may be hardwired in series with the Start switch, and the relay logic should reflect this.
The above realizes the function: Run = (NOT Emergency Stop) AND (NOT Stop) AND (Start OR Run) |
Complex logic[edit]
Here is an example of what two rungs in a ladder logic program might look like. In real world applications, there may be hundreds or thousands of rungs.
Typically, complex ladder logic is 'read' left to right and top to bottom. As each of the lines (or rungs) are evaluated the output coil of a rung may feed into the next stage of the ladder as an input. In a complex system there will be many 'rungs' on a ladder, which are numbered in order of evaluation.
Line 1 realizes the function: A/C = Switch AND (HiTemp OR Humid)
Line 2 realizes the function: Cooling = A/C AND (NOT Heat)
This represents a slightly more complex system for rung 2. After the first line has been evaluated, the output coil 'A/C' is fed into rung 2, which is then evaluated and the output coil 'Cooling' could be fed into an output device 'Compressor' or into rung 3 on the ladder. This system allows very complex logic designs to be broken down and evaluated.
Additional functionality[edit]
Additional functionality can be added to a ladder logic implementation by the PLC manufacturer as a special block. When the special block is powered, it executes code on predetermined arguments. These arguments may be displayed within the special block.
In this example, the system will count the number of times that the interior and remote unlock buttons are pressed. This information will be stored in memory locations A and B. Memory location C will hold the total number of times that the door has been unlocked electronically.
PLCs have many types of special blocks. They include timers, arithmetic operators and comparisons, table lookups, text processing, PID control, and filtering functions. More powerful PLCs can operate on a group of internal memory locations and execute an operation on a range of addresses, for example, to simulate a physical sequential drum controller or a finite state machine. In some cases, users can define their own special blocks, which effectively are subroutines or macros. The large library of special blocks along with high speed execution has allowed use of PLCs to implement very complex automation systems.
Limitations and successor languages[edit]
Ladder notation is best suited to control problems where only binary variables are required and where interlocking and sequencing of binary is the primary control problem. Like all parallel programming languages, the sequential order of operations may be undefined or obscure; logic race conditions are possible which may produce unexpected results. Complex rungs are best broken into several simpler steps to avoid this problem. Some manufacturers avoid this problem by explicitly and completely defining the execution order of a rung, however programmers may still have problems fully grasping the resulting complex semantics.
Analog quantities and arithmetical operations are clumsy to express in ladder logic and each manufacturer has different ways of extending the notation for these problems. There is usually limited support for arrays and loops, often resulting in duplication of code to express cases which in other languages would call for use of indexed variables.
As microprocessors have become more powerful, notations such as sequential function charts and function block diagrams can replace ladder logic for some limited applications. Some newer PLCs may have all or part of the programming carried out in a dialect that resembles BASIC, C, or other programming language with bindings appropriate for a real-time application environment.
See also[edit]
References[edit]
- ^http://ecmweb.com/archive/basics-ladder-logic 'Ladder logic uses switch or relay contacts to implement Boolean expressions. In years past, ladder logic was made possible with discrete relays and was sometimes termed “relay logic.'
- ^Edward W. Kamen Industrial Controls and Manufacturing, (Academic Press, 1999) ISBN0123948509, Chapter 8 Ladder Logic Diagrams and PLC Implementations
Further reading[edit]
- Walker, Mark John (2012-09-08). The Programmable Logic Controller: its prehistory, emergence and application(PDF) (PhD thesis). Department of Communication and Systems Faculty of Mathematics, Computing and Technology: The Open University. Archived(PDF) from the original on 2018-06-20. Retrieved 2018-06-20.
External links[edit]
- 'Chapter 6: ladder logic' by Tony R. Kuphaldt
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Ladder_logic&oldid=869310979'
I will start this article by making a confession:When I develop a PLC program, I steal other people’s ladder logic.
I am stealing ladder logic examples for inspiration and solutions to my PLC programs.
From time to time you will be facing the same problem, when you do PLC programming with ladder logic. By looking at examples of ladder logic programs, you will be able to find a solution to your problem very fast. You may even find a smarter solution in the ladder logic examples than your own solution.
There are several reasons to use examples of PLC ladder logic. You can skip those and go straight to the PLC program examples:
Ladder Logic Examples and PLC Program Examples ⇓.
Why Use PLC Ladder Logic Examples?
The reason I use ladder logic examples is one of the big advantages of code. In this case the PLC programming language ladder logic. You can reuse chunks of a PLC program in your own PLC program. You can “copy and paste” lines of ladder logic symbols from one PLC program to another PLC program. By doing so, you will shorten the development time of a project. So that you don’t have to invent everything from the very bottom each time you are developing a new PLC program. That is why I often make use of PLC program examples.Learn from PLC Programming Examples
Another reason to make use of ladder logic examples is, that you can learn from them. Let’s say you have a specific functionality, you want to implement in your ladder logic. The first thing you naturally would do, is to think about it for yourself. Try to design the ladder logic by yourself.But even though you come to a solution, there might be a smarter way to make that piece of ladder logic. When you look at a ladder logic example it may look different from your ladder logic. This is due to the fact that every function you want to implement in your PLC program, there are many different solutions.
Ladder logic examples can be hard to find, though. Especially because the names of the ladder logic examples often are confusing and even misguiding. A ladder logic example of a trafic light can, as an example, vary a lot.
One other thing that causes good PLC ladder logic examples to be so hard to find, is that ladder logic often is brand specific. Many PLC ladder logic program examples are available for download, and you will have to install the PLC programming software to view the example ladder.
Another brand specific issue is the names for the instructions and functions. For example in the Siemens S7-1200 and other PLC’s from Siemens the latching function is referred to as the set/reset function. While that function, in Allen Bradley PLCs, are the called latch/unlatch function. You can start exploring the latch/unlatch function already now with RSLogix Micro Starter Lite from Allen Bradley.
Collecting the Best PLC Programming Examples
For those reasons I have made this collection of PLC ladder logic examples. I have divided all the ladder examples into categories, so you can find them with ease. The first examples are general ladder logic examples. These examples can be used in almost every ladder logic PLC program.If you need a simple function implemented in your ladder logic, you can use the general examples. General ladder logic examples can almost always be copied into your own ladder diagrams. The only thing you need to edit, is the names and the symbols for the bit logic instructions.
At last you will find real-world PLC ladder logic examples. This is a collection of PLC programs from the real-world, where simulations, videos or photos are a part of the example. Real-world PLC examples from a factory or a traffic light can be very useful, when you are searching for inspiration. These examples can rarely be copied to fit your own project, but you can use chunks and ideas from the real-world examples.
Do you have your own PLC ladder logic examples, even better than these?
Feel free to contact me.
I will gladly put your PLC ladder logic example on this site. In that way, we can all benefit from this list of the best examples of PLC ladder logic.
Ladder Logic Examples and Example PLC Programs
Click on the type of PLC program example you want to see, or scroll down to see the all:- Simple Ladder Logic Program Examples
- Simple Start/Stop Ladder Logic Relay
- Single Push Button On/Off Ladder Logic
- Ladder Logic Examples with Timers
- PLC Program Example with On Delay Timer
- PLC Program Example with Off Delay Timer
- PLC Program Example with Retentive Timer
- Ladder Diagram for Motor Control
- Star Delta PLC Ladder Diagram
- Ladder Diagram for DOL Motor Starter
- PLC Program Examples From The Real World
- Traffic Light Ladder Logic Diagram
- Ladder Diagram for Bottle Filling Plant
- PLC Ladder Diagram for Elevator Control
Simple Ladder Logic Program Examples
Ladder diagram examples and solutions to simple PLC logic functions. These are all basic PLC functions implemented in ladder logic.Simple Start/Stop Ladder Logic Relay
This is how the ladder diagram looks for a simple start/stop function. The function can be used to start and stop anything like a motor start/stop.In this ladder logic example, there are two inputs.
- “Start button” or PLC input I0.0.
- “Stop button” or PLC input I0.1.
You might wonder why the stop button in this example is normally open. And the reason for that, is that you should use normally closed as stop button, to avoid dangerous situations under failure.
Here is what the PLC program example looks like:
Simple ladder logic examples of start/stop of relay.
Single Push Button On/Off Ladder Logic
This function is also called push on push off logic sometimes even flip-flop or toggle function. It is the same function as the on/off button on your computer or mobile phone. When you push the button the first time, the output will be activated. Now, when you push the button for the second time, the output will deactivate and turn off. The single push button has two functions: on and off.Push on push off logic can be done in several ways. It can be done by using ladder logic and boolean logic instructions or it can be done with a counter. It can even be done with PLC rising edge and falling edge triggers or with shift registers.
Here is the example using boolean logic instructions only (complicated version):
Single push button ON/OFF ladder logic example. Also known as “push to on, push to off” logic function.
This example is from the PLC, Scada, DCS blog. The blog has a lot of very useful information about PLC programming and especially ladder logic. Take a look at the blog and see the many ladder logic examples.
But… there is a faster way to make the same toggle function with a single push button:
The example is from Mayur Haldankar’s blog about PLC programming and DSP (digital signal processing). He even has examples of DSP programs written in C++.
In his example, he uses 3 (4) rungs only to make the toggle function of a push button (simple version):
Ladder toggle or flip-flop function (single push button on/off).
Ladder Logic Examples with Timers
PLC program examples with timers in ladder logic. Generally speaking, you have three types of timers available in ladder logic. The on-delay timer, the off-delay timer and the retentive timer.PLC Program Example with On Delay Timer
The first type of timer in ladder logic is the on delay timer. Its name comes from the fact, that the on delay timer delays its output from the on signal.As soon as the on delay timer gets a signal at the input, the timer starts to count down. When the preset time is up, the output of the on delay timer will turn on. If the input is turned off before the count down finish, the time will reset.
On delay timers in ladder logic can look different depending on the PLC programming software. But common for all of them are the following:
- Input
- Enable Output (EN)
- Done Output (DN)
- Preset Time Value
The enable output (EN) is the first output and it is on when the timer is energized. So, as long as the input is true or on, the enable output will be true.
Second output is the done output (DN). This output in an on delay timer is only on, when the timer has counted down the preset time.
Look at this great video for more info about the on delay timer. The software used is the free RSLogic Micro Starter Lite from Allen Bradley.
PLC Program Example with Off Delay Timer
The off delay timer works just like the on delay timer with one exception.Instead of starting the count down from the signal at the input turns on, the off delay timer starts to count down from the signal turning off at the input signal.
The example below is from Sakshat Virtual Labs. In the example, ladder logic is used to visualize the values of the three bits in an off delay timer. These three bits are from Allen Bradley PLCs, but other brands has similar bits.
- Enable bit (EN) – On when the timer is energized (input is on)
- Done bit (DN) – On when the timer is done counting down
- Timer timing bit (TT) – On when the timer is counting
Cooling Example With Off Delay Timer
Another example with the use of the off delay timer in ladder logic is in heating. When you are heating something, you often have some sort of cooling too. A good example of that is a heating oven. The oven is heated by an electrical heater, and in the side there are ventilation motors to cool the oven after use.Here is a simplification of how the cooling PLC program should work:
- HEATING ON:
Heating element and cooling fans turn on. - HEATING OFF:
Heating element off and off delay timer starts counting down. - TIMER DONE:
Cooling fans turn off.
The electrical heater and the cooling fans should turn on simultaneously. Why the cooling fans has to turn on too, is to circulate the hot air and spread the heat.
Since both the fans and the heater has to start at the same time, the two outputs should work simultaneously. But keep in mind, that the cooling fans has to run for some time, after the heater is turned off.
This is the exact function of an off delay timer, and the ladder logic example looks like this:
Example of motors with cooling in ladder logic. Off delay timer for extra delay.
PLC Program Example with Retentive Timer
Retentive timers are just like on delay and off delay timers, but with one crucial exception.The time only pauses if the input is turned off before the count down is finished. When the input is turned on again, the timer continues counting down from where the time was paused.
The word retentive even means to retain, and that is what retentive timers do. They retain the time they have counted when the input is off.
If you’re still not sure, check out this video of a functioning retentive timer in ladder logic:
KronoTech has published a very informative PLC program example. With the use of a retentive timer to control a motor with an automatic lubrication system, they have made a great practical example.
Ladder logic program for automatc lubrication
More About Timers In PLC Programming Examples
Feel free to watch this video for more information about PLC timers in ladder logic. The video illustrates some great examples and the basics of PLC timers. The PLC programming software used is RSLogix 500.Ladder Diagram for Motor Control
Motor control can be done with a PLC program. In fact, the PLC is a common choice for controlling AC motors. Here are some examples of ladder diagrams for motor control.Star Delta PLC Ladder Diagram
One of the most common ways to start an AC motor is by first starting the motor in star connection. When the motor speed is sufficient, the connection is switched to delta. This is due to the high current AC motors use when starting.Star/delta motor control can be done in several ways. To switch between the star and the delta relay, a timer is used. The ladder logic for a star/delta motor control is quite simple, and that is one of the advantages of using a PLC for motor control.
Ladder diagram of star/delta starter with a Mitsubishi PLC
Another great example of how to use a PLC for star/delta start of an AC motor is example #5 in the PDF file below. It includes a lot explination and a lot of great power and control circuit diagrams. Example #5 is on page 30.
Star/delta start PLC example
Ladder Diagram for DOL Direct On Line Motor Starter
Still commonly used in many factories the DOL or direct on line motor starter is another way of starting AC motors. The DOL is made of a contactor (usually 3-phase contactor), an overload relay like the thermal relay, and some connections in between.Controlling the DOL motor starter with a PLC program is simple. This video below shows an example of how to control a DOL with a PLC program. In the example the PLC Zelio from Schneider Electric is used. But any PLC with digital inputs and outputs can be used, even the mini PLC Siemens S7-200 or the later Siemens S7-1200. Sometimes you might have to use a smaller relay between the PLC output and the coil of the contactor. Make sure you always check the ratings of the PLC outputs you are using.
PLC Program Examples From The Real World
These next PLC programs are examples of real-world PLC applications. All examples of how to use PLC programming and ladder logic to solve real problems.Traffic Light Ladder Logic Diagram
One of the most used applications for a PLC is the traffic lights. At many schools, universities and even companies you will get the challenge to make a traffic light ladder logic diagram.The traffic light PLC program is a combination of timers to control which lights are turned on and for how long time. But some sort of interlock must be there to prevent the green light to be on in multiple directions.
Simple Ladder Logic Diagrams Examples
A PLC program like the traffic light is a little more complicated and therefore are a lot more solutions to. For inspiration you can look at these good examples of traffic light ladder diagrams:The first ladder logic example is from Engineer On A Disk, which is a marvelous site full of great articles. In the example you will get all the ladder diagrams and step-by-step instructions and explanation.
PLC program example of a traffic light
If you are using LogixPro Simulator, then you should absolutely take a look at this great example video:
Ladder Diagram for Bottle Filling Plant
Detailed example from Electrical Engineering Portal. This is a great example because of all the explanation it gives. You will be introduced to the actuators (motors), sensors and switches and a step-by-step guide to how to make the PLC program. At last you will see the example ladder logic for the bottle filling application.PLC implementation of bottle filling application
If you are using LogixPro Simulator from Allen Bradley, then you can learn a lot from this example video:
PLC Ladder Diagram for Elevator Control
Elevators are often controlled by a PLC or a similar controller (sometimes even relay controllers). In fact a PLC program is a great way to make an elevator control. But before you start looking at ladder diagrams and PLC program examples for elevator control, some safety issues are important to know about.Here are the things you need to know before you start to build a PLC elevator control:
- Mechanical safety
No elevator control without mechanical parts. All these parts has to be tested and verified to make sure that they will last. - Electrical safety
Be sure to follow the rules and regulations for electrical safety. They differ a bit depending on whether you are in the US, Europe, Asia or anywhere in the World. This includes proper grounding, using the right circuit breakers, wire gauges and so on. - PLC elevator program safety
The last but not least part is the PLC elevator program. In the elevator examples you will be looking at, there will be a lot of interlocks, to prevent some functions to run at the same time. This is a highly critical point. For example, you don’t want to elevator to run before the doors are closed!
This is a great introduction to how the elevator control system works:
Elevator Control System: How they work
And here is an example of a ladder diagram for elevator control from circuit4hobby:
Elevator PLC program (PDF)
Ladder diagrams are specialized schematics commonly used to document industrial control logic systems. They are called “ladder” diagrams because they resemble a ladder, with two vertical rails (supply power) and as many “rungs” (horizontal lines) as there are control circuits to represent. If we wanted to draw a simple ladder diagram showing a lamp that is controlled by a hand switch, it would look like this:
The “L1” and “L2” designations refer to the two poles of a 120 VAC supply unless otherwise noted. L1 is the “hot” conductor, and L2 is the grounded (“neutral”) conductor. These designations have nothing to do with inductors, just to make things confusing. The actual transformer or generator supplying power to this circuit is omitted for simplicity. In reality, the circuit looks something like this:
Typically in industrial relay logic circuits, but not always, the operating voltage for the switch contacts and relay coils will be 120 volts AC. Lower voltage AC and even DC systems are sometimes built and documented according to “ladder” diagrams:
So long as the switch contacts and relay coils are all adequately rated, it really doesn’t matter what level of voltage is chosen for the system to operate with.
Note the number “1” on the wire between the switch and the lamp. In the real world, that wire would be labeled with that number, using heat-shrink or adhesive tags, wherever it was convenient to identify. Wires leading to the switch would be labeled “L1” and “1,” respectively. Wires leading to the lamp would be labeled “1” and “L2,” respectively. These wire numbers make assembly and maintenance very easy. Each conductor has its own unique wire number for the control system that its used in. Wire numbers do not change at any junction or node, even if wire size, color, or length changes going into or out of a connection point. Of course, it is preferable to maintain consistent wire colors, but this is not always practical. What matters is that any one, electrically continuous point in a control circuit possesses the same wire number. Take this circuit section, for example, with wire #25 as a single, electrically continuous point threading to many different devices:
In ladder diagrams, the load device (lamp, relay coil, solenoid coil, etc.) is almost always drawn at the right-hand side of the rung. While it doesn’t matter electrically where the relay coil is located within the rung, it does matter which end of the ladder’s power supply is grounded, for reliable operation.
Take for instance this circuit:
Here, the lamp (load) is located on the right-hand side of the rung, and so is the ground connection for the power source. This is no accident or coincidence; rather, it is a purposeful element of good design practice. Suppose that wire #1 were to accidentally come in contact with ground, the insulation of that wire having been rubbed off so that the bare conductor came in contact with grounded, metal conduit. Our circuit would now function like this:
With both sides of the lamp connected to ground, the lamp will be “shorted out” and unable to receive power to light up. If the switch were to close, there would be a short-circuit, immediately blowing the fuse.
However, consider what would happen to the circuit with the same fault (wire #1 coming in contact with ground), except this time we’ll swap the positions of switch and fuse (L2 is still grounded):
This time the accidental grounding of wire #1 will force power to the lamp while the switch will have no effect. It is much safer to have a system that blows a fuse in the event of a ground fault than to have a system that uncontrollably energizes lamps, relays, or solenoids in the event of the same fault. For this reason, the load(s) must always be located nearest the grounded power conductor in the ladder diagram.
- REVIEW:
- Ladder diagrams (sometimes called “ladder logic”) are a type of electrical notation and symbology frequently used to illustrate how electromechanical switches and relays are interconnected.
- The two vertical lines are called “rails” and attach to opposite poles of a power supply, usually 120 volts AC. L1 designates the “hot” AC wire and L2 the “neutral” (grounded) conductor.
- Horizontal lines in a ladder diagram are called “rungs,” each one representing a unique parallel circuit branch between the poles of the power supply.
- Typically, wires in control systems are marked with numbers and/or letters for identification. The rule is, all permanently connected (electrically common) points must bear the same label.
In the previous article, I have mentioned all the basic rules you should follow for PLC programming.
Today I am sharing my article about the PLC ladder diagram program example. Explained in detail.
At the end of this tutorial, you will learn how to write PLC ladder program with a ladder diagram.
Now, let’s start.
How to Write PLC Ladder Program using a Ladder Diagram?
It is always easier to understand PC programming with the help of example rather than tons of theory.
In the ladder diagram program, the switches are considering as inputs and load are considering as coil or output.
PLC Ladder Diagram Program Example for Running Motor:
Problem statement: Write a program for a simple motor with the following conditions.
Condition:
Case 1: Following conditions should be satisfied to start a motor.
- Switch 1 is off and switches 2 is on.
- Switch 3 is on or switch 2 is off.
- Both switch 4 and switch 5 are on or switch 3 is off.
- Switch 6 is on or both switch 4 and switch 5 are off.
Case 2: Following conditions should be satisfied to stop a motor.
- Switch I1 is on.
Solution:
Now, we draw the ladder diagram program with seven switches and a single motor.
As per the below diagram, the switches are representing as I1, I2, I3, I4, I5, I6 and I7. And a coil of the motor is representing as Q1.
The conditions (i.e. On 0r Off modes) of the switches are operated by the toggle button.
First of all, all switches (I2, I3, …., I7) are Normally Open (NO) contact except switch I1.
Case 1: Motor in a Running Condition
Follow the conditions one by one as below.
According to the first case, switch I1 has normally close contact.
When you press the switch I2, it gets close contact. This causes the power flowing through the circuit. And the motor starts running.
When the switch I3 is pressed and the switch I2 is realized then power flows through the circuit. This makes to run the motor continuously.
You can see, the switches I4 and I5 are connected in the series.
If both switches I4 and I5 are pressed then it makes the contact (NC) to flow the power. So the motor will run continuously.
To satisfy the last point in the first case, the switches I6 or I7 should be pressed.
After getting normally closed contact, power continuously flows through to the circuit. Due to this, the motor still runs.
Case 2: Motor in a Stop Condition
If the switch I1 is in NC contact, the switch I1 gets pressed.
Here the switch I1 is in series contact.
After the breaking contact, power will not flow to the motor. So, the motor will stop running.
That’s it all about PLC Ladder Diagram Program example. I have also explained how to write PLC ladder program with images.
What’s Next?
Let’s try to implement logic gates using PLC ladder programming. Logic gates are the most common utility functions in electrical and you will find it very useful in many of the PLC programming projects.
I hope that this article will be useful to learn the basic concept of a PLC ladder programming.
If you have any query, let’s discuss in the comment section.
![Program Program](/uploads/1/2/3/7/123735850/887130108.jpg)
Happy Learning PLC!
Myself Dipali Chaudhari. I am a master in Electrical Power System. Sharing my knowledge on this blog makes me happy. Apart from that, I love playing badminton. And sometimes I dwell on the Python programming.
We will look at a PLC basic tutorial of a paint spraying station. Following the 5 steps to program development this PLC programming example should fully explain the procedure for developing the PLC program logic. Ladder will be our PLC programming language.
We will be using the Do-more Designer software which comes with a simulator. This fully functional program is offered free of charge at automation direct.
Define the task:
What has to happen?
Paint spraying system where boxes are fed by gravity through a feeder magazine one at a time onto a moving conveyor belt. Upon the start signal, boxes are pushed towards the conveyor by valve 1. This is a cylinder which extends and retracts which operates switches S1 and S2 respectfully. A spraying nozzle paints each box as it passes under the paint spray controlled by valve 2. A sensor (S3) counts each box being sprayed. When 6 boxes have been painted the valve 2 shuts off (paint spray) and valve 1 (cylinder) stops moving boxes onto the conveyor. Three seconds later the conveyor stops moving and the hopper with its load moves forward (valve 3) where it is emptied. Ten seconds later the hopper returns to the original position. The cycle is then complete and waits for a start signal again.
Define the Inputs and Outputs:
Inputs:
Start Switch – On/Off (Normally Open) – NO
Stop Switch – On/Off (Normally Closed) – NC
S1 – Valve 1 (cylinder retract) On/Off – NO
S2 – Valve 1 (cylinder extend) On/Off – NO
S3 – Box Detected- On/Off – NO
Outputs:
Motor – On/Off (Conveyor Run)
Valve 1- Cylinder to feed boxes – On/Off
Valve 2- Paint Spray – On/Off
Valve 3- Cylinder to move hopper – On/Off
Start Switch – On/Off (Normally Open) – NO
Stop Switch – On/Off (Normally Closed) – NC
S1 – Valve 1 (cylinder retract) On/Off – NO
S2 – Valve 1 (cylinder extend) On/Off – NO
S3 – Box Detected- On/Off – NO
Outputs:
Motor – On/Off (Conveyor Run)
Valve 1- Cylinder to feed boxes – On/Off
Valve 2- Paint Spray – On/Off
Valve 3- Cylinder to move hopper – On/Off
Develop a logical sequence of operation:
Sequence Table: The following is a sequence table for our paint spraying application.
1 – Input / Ouput ON
0 – Input / Output OFF
x – Input / Output Does not Matter
When the power goes off and comes on the sequence will continue. This means that we must use memory retentive areas of the PLC. The stop pushbutton will stop the sequence. The start will resume until the end.
Develop the PLC program:
The best way to see the development of the programmable logic controller program is to follow the sequence table along with the following program. You will see the direct correlation between the two and get a good understanding of the process.
This is the main process to start and stop bit. V0:0 is used because it is memory retentive.
Control of the Motor (Conveyor) and the paint spray is done with the V0:0 contacts in front of the actual PLC output. The conveyor and paint spray will stop when the timer 0 is done. This is the delay after the last box is detected to allow the box to be painted and loaded onto the hopper.
Control of the box movement onto the conveyor. As long as we have the process start and the hopper count is not complete this will allow the cylinder to put boxes on the conveyor.
Count number of boxes in the hopper via S3. The counter is memory retentive.
A timer to stop the conveyor and spray after the last box is detected for the hopper. This will allow time for the box to be sprayed and loaded into the hopper.
Hopper movement to load and unload the boxes.
The hopper unload timer is to unload the boxes and will then trigger the reset conveyor timer, box counter and the process start bit (V0:0).
Test the program:
Test the program with a simulator or actual machine. Make modifications as necessary. Remember to follow up after a time frame to see if any problems arise that need to be addressed with the program.
Watch on YouTube: PLC Programming Example – Paint Spraying
If you have any questions or need further information please contact me.
Thank you,
Garry
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.
If you have any questions or need further information please contact me.
Thank you,
Garry
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.
To get this free article, subscribe to my free email newsletter.
Use the information to inform other people how numbering systems work. Sign up now.
Use the information to inform other people how numbering systems work. Sign up now.
The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.
May 17, 2018 Softros LAN Messenger Softros LAN Messenger is an easy-to-use LAN messaging application for safe, secure and effective intra-office communication. Pc software cracks/keys pro registered serial key new Softros LAN Messenger v9.1 Crack Softros LAN Messenger v9.1 Crack free Softros LAN Messenger v9.1 Cracked Softros LAN Messenger v9.1 Cracked. Aug 22, 2018 Softros LAN Messenger 9.2 Crack Full 2018. Softros LAN Messenger Crack is a good and all in one safe texting framework that enables you to effortlessly visit with associates inside a neighborhood. What’s more, now, this capable LAN visit program is accessible for cell phones and tablets running the Android working framework. Softros LAN Messenger Alternative 7.3 is very useful network messenger that help you to fully secure your network messaging software for LANs, WANs and Internets. The user interference is quite easy and simple but works like professional messengers. Nov 20, 2017 Softros LAN Messenger 8 Full Crack Free Download: Softros LAN Messenger Crack Full v8 is a useful messenger to keep in touch with your fellows on same LAN network. It is very suitable to connect via LAN, WAN and internet espacially on your local area network. Softros LAN Messenger License Key is a simple to use but very reliable smart messenger application. Apr 05, 2019 Softros LAN Messenger 9.2.2 Crack is smart and advanced software which allows you to connect with your family, friends, and co-workers from the same LAN and WAN. The Application provides text and files exchange facility exclusively. The software designed at the best level of quality to accommodate users with great. Softros lan messenger cracked.