Documente Academic
Documente Profesional
Documente Cultură
PLC Programming
161
56
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:
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.
I wrote another article where I included examples of PLC analog input and output programming. If
you want to learn ladder logic from the beginning, you should check out my ladder logic tutorial or
maybe even start learning from an online PLC training course.
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.
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?
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.
Click on the type of PLC program example you want to see, or scroll down to see the all:
Ladder diagram examples and solutions to simple PLC logic functions. These are all basic PLC
functions implemented in ladder logic.
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.
The start button will activate the relay, or ladder logic relay M10.0. When the start button is
released, the relay will still be activated, because of the latch in ladder rung 2. This latching will be
broken when the stop button is activated.
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:
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):
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.
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
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.
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.
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 OFF:
Heating element off and off delay timer starts counting down.
TIMER DONE:
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.
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.
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.
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.
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.
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.
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.
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.
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.
If you are using LogixPro Simulator, then you should absolutely take a look at this great example
video:
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.
If you are using LogixPro Simulator from Allen Bradley, then you can learn a lot from this example
video:
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. You might want to incorporate a safety relay in the system.
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.
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!
And here is an example of a ladder diagram for elevator control from circuit4hobby:
Rate this article below or write a comment if you found this article helpful or you have any
questions.
If you would like to share your ladder logic examples, please write a comment below or send me a
message. You can also find us on Facebook.
likethis
Posted In
Ladder Logic
Tags
bottle filling plant, dol motor starter, elevator control, examples, motor control, off delay timer, on
delay timer, retentive timer, timers, traffic light
examples
Read More
56 Comments
Leave a response
Tom Opoku
pedro
Super
nalin
how to write a overlap programme.. i mean ,there are two programmes in plc,but its run
separately…
ARSLAN
January 21, 2016 at 9:16 am
Akshay
Nkululeko
hello everyone,i am a first year student at CPUT doing electrical engineering,we have been given a
project about on/off controller using PLC,my problem i never used PLC before and i don’t even know
how they work,,,,can someone plz explain to me how does it work?
Dwayne S
I been using Plcs for over 20 yrs.. Once you know it its very easy. I still watch all videos on youtube.
tayceer
jossi
hi guys…whr can I get a plc software for a laptop…without necessarily buying online
Tushar Chavan
September 7, 2016 at 10:10 am
you have one choice download delta plc software its free. and then practice on it . this the only
softwtwar eits free on web site. and it easy to learn. if u have want any plc program. mail i can make
program. mail me your details. i will teach you how to learn.
Shiju Jacob
hi,
can you please help me to learn how analog outputs are used in delta.
thank you
josey odero
Karam Ramnunan
Hi Tushar
Do you have a program, for a conveyor system in a distribution warehouse setting, moving
boxes/totes etc.
Thank you.
krp
awsm
single push button controls output on/off
MWESIGE PROSPER
JEET
G.N.S.
How i’m build water level indication logic. give me idea for ladder program.
pavan
Khalid Morales
How to make a ladder diagram for oil and gas tank level? Using P&ID controller, AUTOMATICALLY.
maruti
How to make a ladder diagram for oil and gas tank level? Using P&ID controller, AUTOMATICALLY.
Rajeev Kirar
kirose
kirose
Sam
Hey guys… I have to program the “Batching Process” on ITS PLC,using Automgen, but i find it to be
very complicated…
aranganathan
fatemeh
when I run S7 pro I need to test my program ,PLC simulation on/off button is disabled.
Shailesh Mishra
Hazrat Binun
June 4, 2018 at 5:43 am
Nasiem Amer
Thanks for these examples and we hope more specially for automation in industrial process
sushil
thank you for giving example of plc programming . i need more example plz send my e-mail id.
jyoti parkhe
i want ladder ladder prgm to count 0-100 & 100-0 up-down counter using single push button . & its
continuous operation.
Allen Dubberly
Awesome!!! Thank you so much for this. You should start a paypal.me/yourname account and let
people buy you a cup of coffee or donate to the cause!
muhammad khan
PRAVEEN KUMAR
thank you for giving example of plc programming . i need more example plz send my e-mail id.
rajivgandhi
Richie
I’m looking for anything dealing with studio 5000 and servo motor drive interface. We use Parker
drives. I have to coordinate a sequence of motors to flow at one speed with the ability to draft.
selva ganabathi
hi i need a V/F open loop control on plc ladder logic program please send a model of plc on my mail
id
rushikesh
this question was given by my teacher and Im curious to know about ladder program
ERROR!!!!!!
“Here is the example using boolean logic instructions only (complicated version):”
under this complicated version, Extend M0.1 and M0.2 on rungs 4,7 past the Push Button….
“Rung 4 Edit.”
| M0.1 | |
|—| |———-+ |
It will not latch right and the second Press will never activate.
Copy and paste this into notepad, Then Replace * with a single space for the edit….
|***M0.0****I0.0*******M0.2**************************M0.1**|
|—|*|——|/|–+—-|/|—————————(*)—|
|***M0.1**********|****************************************|
|—|*|———–+****************************************|
|***M0.0*********************************************Q0.0**|
|—|*|———————————————-(*)—|
|***M0.1****I0.0*******M0.3**************************M0.1**|
|—|*|——|/|–+—-|/|—————————(*)—|
|***M0.2**********|****************************************|
|—|*|———–+****************************************|
Parveen
Claudiu Adascalitei
My name is Mr. Claudiu Adascalitei, and i’m a student of University from Sibiu city, Romania. So, I
want to help me with a project for school. It’s about a ladder diagram programming. Can you help
me, please. I send my adress e-mail to contact: claudiu_sebastian@yahoo.com.
Thank you,
Claudiu
alem
Sumon Ahmed
Hi I am new for PLC,,I start learning from today of PLC ladder programming..I hope it will help me
like a near teacher….
mulat
good
Emmanuel Koomson
It’s so simple and easily to understand the stuff,but need some more diagram to practice in order to
master the process
Matt Edwards
I am having a hard time trying to figure out a simple logic issue. Can you please draw me or explain
the logic for:
David Waller
Umesh more
M.koteswar
guys does anybody know about textile industry ladder logic and how they work??
tryfom
i need to write code for in ladder for a task with a conveyor with three color sencor and tree bin so
when a bin is full the conveyor is stop the first color sensor is alone and it is at begin the second two
is next to it and below them are the bin in the end of the conveyor are the red bin . we put object on
the conveyor one each time . is anyone can help in ladder (brandley )
temesgen shibru
i dont now how to draw a ladder logic diagram for diffrent instructions please help me
Vishal golakiya
Ahmed Eisa
“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 a stop button, to avoid dangerous situations under failure.”
Your first example shows the stop button as NO, and you recommend using NC as a stop button. The
sentence above contradicts itself?
Ryan MacKellar
Great article. Starting with ladder logic is the foundation of understanding any kind of PLC program.
Here’s another great resource for four steps to writing a PLC program
https://www.plctechnician.com/news-blog/Intro-to-Writing–%20PLC-Program-in-4-Simple-Steps
Leave a Response
Latest Articles
All About PLC Analog Input and Output Signals and Program...