0% found this document useful (0 votes)
9 views

ADC Chapter 4

The document provides an overview of PLC timers, including TON (Timer On), TOF (Timer Off), and RTO (Retentive Timer On), detailing their functions and applications in controlling devices for specific durations. It outlines the addressing for Allen Bradley PLC timers, explains how timers operate within ladder logic programming, and presents various programming examples for implementing timers in different scenarios. Additionally, it discusses the importance of timers in automating processes and controlling outputs based on time delays.

Uploaded by

Sarthak Panchal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

ADC Chapter 4

The document provides an overview of PLC timers, including TON (Timer On), TOF (Timer Off), and RTO (Retentive Timer On), detailing their functions and applications in controlling devices for specific durations. It outlines the addressing for Allen Bradley PLC timers, explains how timers operate within ladder logic programming, and presents various programming examples for implementing timers in different scenarios. Additionally, it discusses the importance of timers in automating processes and controlling outputs based on time delays.

Uploaded by

Sarthak Panchal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 152

PLC programming

Instructions
What is the PLC Timer?
PLC timer is a instruction to control and operate the device for a
specific duration. With the timer, we can perform any specific
operations for a particular time span.

A timer is one of the most essential and useful entity.

You can set time-based activity with the help of the PLC programming
timer instruction. Every PLC having different timer functions.

The timer instruction is used to provide programming logic and to decide


when to turn on or off the circuit. It has both normally open (NO) or
normally closed (NC) contact.
Addressing for AB (Rockwell) PLC
For the AB PLC, the timer has the address ranging from ‘T4:0′ upto ‘T4:255‘.

Where, T4 is the file type.

Addressing format for timer instruction with the three status bits.

File type: Element Number/ Bit status

1. Enable bit (EN) address is ranging from ‘T4:0/EN’ upto ‘T4:255/EN’.


2. The addressing for Timer timing bit (TT) is ranging from ‘T4:0/TT’ upto
‘T4:255/TT’.
3. Done bit (DN) address is ranging from ‘T4:0/DN’ upto ‘T4:255/DN’.
# PLC’s Brand Developed by Country Software
01 AB PLC United State RS Logix (RS Logix 5, RS Logix 500 and RS Logix 5000)

02 Siemens PLC Germany Step 5- Micro wins Step 7- Simatic Manager

03 ABB PLC Switzerland Automation Builder AC010 AC500

04 Delta PLC Taiwan WPL Soft ISP Soft

05 Schneider Europe PL7 TwidoSuite ProWORX 32

06 Mitsubishi PLC Japan Gx Developer Gx Works 2 MELSOFT series

07 Omron PLC Japan CX-One CX programmer

08 Hitachi PLC Japan EH-150

09 GE PLC United State Durus

10 Honeywell United State HRA

11 FATEK PLC Taiwan WinProladder

12 Bosch Germany Bosch Rexroth


● The timer starts operating when the rung condition becomes true.
The timer delay starts counting when the rung condition starts to
accumulate.
● When the Preset value becomes equal to the accumulated value,
the output is made true.
● The timed output becomes true sometime after the timer rung
becomes true; hence, the timer is said to have an on-delay.
● The length of the delay can be adjusted by setting the preset
value.
● When the rung timer is true, the output will be true without any
delay. When the rung signal becomes false the timer starts
operating.
● The timer starts accumulating times when the rung condition
becomes true, until the accumulated value becomes equal to
the Preset value.
● The output turns off when the output will turn false when the
accumulated value equals the preset value.
TON

TOFF

RTO
The TON timer starts running as soon as it gets a positive state of a signal at the
input.

The status of the Enable(EN) bit is 1 when the rung conditions are true. The Timer
Timing(TT) bit is set while the timer is running.

The status at the Done(DN) bit is high when the timer has completed its preset time
without any error and will be high until the supply at the timer is high.
The TOF timer starts running when there is a negative edge at the timer
input signal. It starts counting when the Enable(EN) bit is OFF and stops
when the accumulated value is reached or when the Enable(EN) bit is ON.

The Enable(EN) and Done(DN) bits work the same as the TON timer block.
The Timer Timing(TT) bit is set while the timer is running.
The main function of the RTO is used to hold or store the set (accumulated) time.

RTO is used in the case when there is a change in the rung state, power loss, or
any interruption in the system.

RTO is the retentive on-delay timer in the Allen Bradley plc system. RTO
instruction is the same as the TON and TOF, except for the fact the accumulated
value is retained even if the rung conditions go false.

The Enable(EN) bit is ON when the rung conditions are true. The Timer
Timing(TT) bit is ON when the rung conditions are true and accumulated value is
less than the preset value. The Done(DN) bit is ON after the timer has completed
preset value without any error.

The RES instruction must be used to reset the RTO timer and to start the timer
again.
Implement Latching and Unlatching of output with a particular time
delay in PLC using Ladder Diagram.

Problem Solution
● There are total three types of Timers available known as TON, TOFF and
RTO timers.
● TON -Timer On
● TOFF -Timer Off
● RTO -Retentive Timer On
● TON timer is used here to solve this problem
List of Inputs and Outputs

I:1/0 = Start Push Button (Input)

T4:0/DN = Timer 4.0 done bit (Input)

O:2/0 = (Output)

T4:0 = (Timer)
Program Description
● Latching is done the same way as in previous program. The only difference in this
program is that Timer On is added to unlatch the output after 10secs. And to operate
unlatching of output, instead of using stop PB, Timer On done bit passed to Stop XIO
contact which operates automatically.
● Time Delay to turn output off can be decided by operator in terms of Multiplication of
Time Base and Preset. It means if time base is 0.1 and we want to generate 10secs
of time delay then Preset value must be set to 100 so that “100 * 0.1 = 10secs”.
● When input I:1/0 is pressed momentarily, output goes true and it is latched.
● When output is latched, Timer T4:0 is enabled and EN bit goes high.
● As long as O:2/0 is true, Timer T4:0 is active and accumulator value is incremented.
● When Timer count (Accumulator value) is equal to Preset value, Timer Done Bit
T4:0/DN goes high which works as a Stop PB of previous problem causing output to
go false.
● Important thing to note here is that when timer is ON and you press Start PB as soon
as Time delay is over, output is latched again. So during those 10secs, Start PB has
no effect on output at all.
Problem Description

There are total four number of outputs which should be run one by one
with a particular time delay. Implement this in PLC using Ladder Diagram
programming language.

Problem Solution
● Generate Master Start and Stop buttons to activate the sequence and define
four outputs.
● Use TON timer to generate a particular time delay, same or different.
● Use Done bit of first timer to energize other output and activate second timer.
● Repeat this process until the final output is energized and last timer is activated.
● Reset timers after the completion of first cycle if necessary.
● Use LEDs as output to test the program.
List of Inputs and Outputs
I:1/0 = Master Start (Input)
I:1/1 = Master Stop (Input)
O:2/4 = Master Coil (Output)
O:2/0 = Output 0 (Output)
T4:0 = Output 0 Timer (Timer)
O:2/1 = Output 1 (Output)
T4:1 = Output 1 Timer (Timer)
O:2/2 = Output 2 (Output)
T4:2 = Output 2 Timer (Timer)
O:2/3 = Output 3 (Output)
T4:2 = Output 3 Timer (Timer)
Problem Description
Implement controlling of various lights in PLC using Ladder
Diagram programming language using timers. Retentive Timer is
suggested to use.
Problem Solution
● Define order of lights.
● Provide timers to lights, to each individually if necessary.
● Reset timers automatically or use reset coil to reset timers.
● Double check if the order of light is made correctly and connections are made
properly.
● Use latching coil for Master Start and Stop for prevention against
malfunctioning.
● 0.1 Time Base function availability is useful to turn ON and OFF a light.
● By using this, we can make lights blink.
● This is one method to solve this problem by using timers.
● Retentive Timers have a capability of storing the previous values at which timer
was stopped or input was withdrawn.
● Hence Retentive Timer RTO can be used here so that in case of power failure,
program can be restarted from where it was left previously.
Program Description
● This program is just a simple combination of Timers and Outputs.
● The only difference here is that Retentive Timer is used instead of Timer ON
TON or Timer OFF TOF.
● Various outputs Output 0 to 5 are used and made a pair of two outputs.
● One timer is provided to each pair of 2 outputs. Timers DN bits are used to Turn
ON and OFF lights.
● The only difference here in this program is that Retentive Timers are used so
that when Input is withdrawn or power fails, Timers do not reset itself because
this Timer has a capability of storing last accumulated value and hence when
again input is given, the program starts from where it was left previously.
● Simply time delay of 0.5 is generated here for each pair of lights.
Problem Description
Material A and Material B are collected in a tank. These
materials are mixed for a while. Mixed product is then
drained out through Outlet valve. Implement this in PLC
using Ladder Logic programming language.
Problem Solution
● To detect level of Material A and Material B, two separate level
switches are used.
● And to detect low level, one more level switch is used at the bottom of
the tank.
● These give output in digital terms that is when corresponding levels are
detected.
● To control level of this system, Single Acting Piston valve can be used
which has two states, either fully open or fully close.
● To control mixing, agitator is used which is connected with Motor shaft.
● Particular time delay is generate to mix the materials for a definite time.
● Control inlet valves on the basis of Level Material switches A and B.
● Outlet valve is then operated to drain the mixed product.
Program Description
● RUNG000 contain master start/stop with address of Start PB I:1/14 and
Stop PB I:1/15.
● RUNG001 is to operate Inlet Valve of Material A with address O:2/0. It is
operated when Low Level of the tank is detected by Level Low Switch I:1/2.
And it is closed when Level Material A is detected by a switch with address
I:1/1. Start PB is also connected in parallel with the LLS, it is done so that
when LLS or level of Material A is not detected, Inlet Valve is operated by
Start PB.
● RUNG002 is to operate Inlet Valve of Material B with address O:2/1. It is
opened when Material A is filled to its desired level (Level Material A). In
other words, Valve of Material B is opened when Level of Material A is
detected by I:1/1 and it is closed when Level of Material B is detected or
Tank is full.
● RUNG003 & RUNG004 operates Agitator Motor with address O:2/2.
When the tank is full with Material A and B, Level High (Level
Material B) is detected. This detection energizes O:2/2 and enables
ON timer with address T4:0. Agitator Motor is connected to the
address O:2/2. So when O:2/2 energizes, Motor Agitator starts the
mixing process and mixes Material A and B for 20secs which is a
preset of Timer ON. When Pre = Acc, T4;0/DN bit goes high turning
off the agitator motor.
● RUNG005 is for Outlet Valve with address O:2/3. It is operated
when the entire mixing process is completed that is when Pre= Acc
= 20secs. And this is closed when LLS is again detected.
● Timer On is set to auto reset mode.
On Delay Timer (TON)
We use the On Delay Timer to delay the Done bit from turning on. A
practical example would be a horn that blows for 5 seconds before
equipment starts. Use the TT bit to blow the horn, and then the DN
bit to start the equipment. The TON is also used in alarms. We don’t
want the operator to get nuisance alarms, so we might wait wait a
few seconds if we detect an alarm condition before notifying the
operator.
Here is an example of the TON instruction. If the alarm condition
persists for 10 seconds, the alarm horn will sound.
Timer Off Delay (TOF)
The off delay timer is probably the most widely confused timer. When we enable the
timer, both the TT and the DN Bit go high. When we disable, the timer, the
accumulator will start timing. The DN bit will shut off after the timer times out.
A practical use for the TOF would be to run off a conveyor. After the operator shuts
down a conveyor system, the product will continue to move until the conveyor has
time to clear. Another example is a blower on a motor. When a main motor starts,
the blower starts instantly. When the motor shuts off, the blower will continue to run
until enough time has passed for the motor to cool. It can also be used for post lube
systems, and to blow a line clear of product before the DN bit shuts off.
Here is an example of the TOF instruction:
Retentive Timer (RTO)
The Retentive timer works in a similar way as the TON instruction…. with one
exception. The RTO retains it’s accumulated value when the timer is disabled.
We use the Reset (RES) instruction to set the accumulated value back to 0.
Examples of uses of the RTO include a machine hour meter. When used in
conjunction with a counter instruction, the RTO, can keep total track of run time
for maintenance reasons. When the timer hits 1 hour, it can trigger a counter
and reset itself. The counter will then reflect the total run hours. Another use is
for Preventative Maintenance (PM). After a certain run time has passed, a light
will energize. We will use a reset button to reset this timer after the PM is
finished.
Here is an example of using an RTO:
Example 1
Let's say we to have a timer on a motor that times the time the motor was on.
What we want to do is to run the lubrication pump every 10 minutes the main
motor has run, for 5 seconds.

Input / Output

● Selector I:1.0/0
● Motor O:2.0/0
● Lube Pump O:2:0/1
Note
● When TON is energized it will start timing. If the RTO is de-
energized the accumulated value will not reset since it is retentive.
Therefore next time we energize the RTO the timer will accumulate
to whatever value it was.
● As opposed to TON and TOF, RTO does not reset by just de-
energizing the rung. We need to have the reset instruction with the
timers address to reset it, as shown in Rung 4.
Motor delayed start and delayed switch off.
Figure shows an example of where a TON timer and a TOF timer are both
used to control a motor. The first rung starts with a start switch that is
latched by the TON timer so that the input to it remains on, even when the
start switch is no longer activated.

After the delay time of the TON timer the motor is started. The motor is
stopped by input to the Stop input, but the motor continues running for a
time delay set by the TOF timer before finally stopping.
Practice for various programming
examples………….
PLC Program to Implement Various Logic Gates
PLC Program to Implement Various Boolean Functions
PLC Program to Implement Various Boolean Functions With
Don’t Care Condition
PLC Program to Implement a Combinational Logic Circuit (1)
PLC Program to Implement a Combinational Logic Circuit (2)
PLC Program to Implement Binary to BCD Converter
PLC Program to Implement BCD to Excess-3 Code Conversion
PLC program to implement Excess-3 to BCD Conversion
PLC Program to Implement Binary to Gray Code Conversion
PLC Program to Implement Gray Code to Binary Conversion
PLC Program to Implement BCD to Gray Code Conversion
PLC Program to Implement 2-bit Magnitude Comparator
PLC Program to Implement 4:1 Multiplexer
PLC Program to Implement 8:1 Multiplexer
PLC Program to Implement 1:8 Demultiplexer
PLC Program to Implement 3 to 8 Line Decoder
PLC Program to Implement 8 to 3 Encoder
PLC Program to Implement SR Flip-Flop
PLC Program to Operate Seven Segment Display
PLC Program to Operate Stamping of Parts
PLC Program to Implement D Flip Flop
PLC Program to Implement T Flip Flop
PLC Program to Simply Latch and Unlatch an Output
PLC Program to Latch and Unlatch an Output by Sealing
PLC Program to Latch and Unlatch Output With Time Delay
1. Car entry sensor triggers the process and turns conveyor belt ON to
move the car.
2. Soapy water sprinkler turns ON when stage 1 sensor detects the car
and do the process for certain time.
3. Brusher turns ON when stage 2 sensors detects the car and do the
process for certain time.
4. Clean water sprinkler turns ON when stage 3 sensors detects the car
and do the process for certain time.
5. Dryer turns ON when stage 4 sensors detects the car and do the
process for certain time.
6. Car exit sensor triggers conveyor motor to turn off.
Program Description
RUNG 0000

Latching rung to operate the system through Master Start and Stop PB.
RUNG 0001

Car entry sensor triggers the memory bit which will turn on conveyor motor
RUNG 0002

ON/OFF operation of conveyor motor is happening in this rung using various


conditions like Sensor input and timer done output.
Rung 0003 & 0004

When car reached stage 1 sensor conveyor motor should stop and water
sprinkler should ON for 10 sec. At the end of water sprinkler timer, Conveyor will
again ON because of the parallel contact in rung 0002.
Rung 0004 & 0005
When car reaches stage 2 sensor conveyor motor should stop and brusher should
ON for 10 sec. At the end of brushing process, Conveyor will again ON because of
the parallel contact in rung 0002.
Rung 0007 & 0008
When car reached stage 3 sensor conveyor motor should stop and water sprinkler
should ON for 10 sec. At the end of water sprinkler timer, Conveyor will again ON
because of the parallel contact in rung 0002.
Rung 0009 & 0010
When car reaches stage 4 sensor conveyor motor should stop and water sprinkler
should ON for 10 sec. At the end of water sprinkler timer, Conveyor will again ON
because of the parallel contact in rung 0002.
Rung 0011
When car reached exit ,car exit sensor will trigger the car wash done indication
lamp(O:0/5)
Step Conditions:

1. Start PB is to start the process.


2. At initial, Job in sensor, Drill up sensor should be in ON condition and job
out sensor should be in OFF condition.

3. When job in sensor detects object for drilling should turn on conveyor
motor to move the object.

4. When Position sensor detects object, conveyor motor should turn OFF and
after 5 sec Drill forward Motor should ON until drill down sensor ON. After

Delay of 5sec, Drill reverse motor should ON up to Drill up sensor ON.

5. After 5 sec delay, Conveyor motor runs till job out sensor ON.
6. Program run continuously till stop PB pressed.
Logic Description
RUNG000
Latching rung to operate the system through Master Start and Stop PB.
RUNG001
To save the status of Job in sensor, Drill Up sensor and Job Out sensor, Memory coil is
used.
RUNG 0002
when all the sensors are in Home condition, Conveyor Motor turned ON
Rung 0003 – RUNG 0004
Position sensor ON makes a time delay of 5 sec to turn Drill forward ON up to drill reverse
ON
Rung 0005 – RUNG 0006
Drill down sensor ON makes a time delay of 5 sec to turn Drill reverse ON till drill up sensor
ON
Rung 0007
After 5 sec delay, Conveyor motor runs up to job out sensor ON condition.
Program runs continuously until STOP PB is pressed.
Counters

A counter is set to some preset value and, when this value of input pulses has
been received, it will operate its contacts. The counter accumulated value ONLY
changes at the off to on transition of the pulse input. Typically counters can
count from 0 to 9999, -32,768 to +32,767 or 0 to 65535.

The normal counters are typically “software” counters – they don’t physically
exist in the plc but rather they are simulated in software. A good rule of thumb is
simply to always use the normal (software) counters unless the pulses you are
counting will arrive faster than 2X the scan time.

Counter Types Up-counters counts from zero up to the preset value. These are
called CTU, CNT, C, or CTR. Down-counters count down from the preset value to
zero. These are called CTD. Up-down counters count up and/or down. These are
called CTUD. For CTU or CTD counter we need 2 inputs, but in CTUD we need 3
(up, down and preset).
The CTU command is used to count an event which happens logically or externally and
places that value in the counter's Accumulator. The accumulated value is maintained even
during FALSE rung conditions and can only be reset back to 0 (zero) by the RES command.
The CU (Count Up Enable) bit is set when rung conditions are TRUE and remains TRUE
until the rung goes FALSE or until the RES instruction is enabled. The Done bit is set when
the accumulated value is equal to or greater than the preset value and is reset when the
accumulated value is less than the preset.
In this example the inputs are both XIC instructions used to make either
rung TRUE or FALSE.

Because the CTU command retains the Accumulator value and Done
status even when the rung is FALSE, an external source is required to
reset the Accum bit, otherwise, the Accum will continue to count above
the Preset value until Overflow is reached.

In this case, the RES command is used to reset the CTU and is triggered
by the Done bit of the counter C5:0. This will allow the cycle to start over
from 0 (zero).
The CTU instruction is tied to the XIC which is energized by a proximity switch. This
switch detects a certain product when it comes by on a conveyor belt. As soon as
the switch detects the product, it energizes the CTU and increments the “Accum”
value. This value will continue to increment every single time a new product goes by.
The process will continue until the counter has reached the value of 16.

At 16, the counter will set the C5:0.DN bit because “Accum” == “Preset”. At this point,
the .DN bit will set an internal bit which will energize another CTU instruction. This
instruction will keep track of the batches finalized in the process. Furthermore, the .DN
bit will also trigger the RES instruction which will set the “Accum” of C5:0 Counter
back to 0.

The process will repeat again for each batch. Note that the counter which keeps
track of the number of batches produced does not have a reset. This will need to be
implemented and tied into a button which is activated at the end of a shift for
example.
The CTD, also known as the Count Down, instruction is used to decrement the
value of the counter associated with it. This instruction will detect a FALSE to
TRUE transition of the logic leading to it and decrease the “Accum” value of the
counter by 1. The effect of using this instruction is the exact opposite of what
the CTU Instruction does to the counter. Just like its counterpart, this instruction
will be found in a rung which will count a certain number of events. Due to the fact
that it decrements the value, the use cases need to be very specific in order to
be clear to the next programmer.

You can use the CTD instruction for every single application of the CTU
instruction. In other words, it is just a matter of preference. That being said, an
experienced programmer will allow the program to flow naturally; using the
instruction as it would make sense in the real world. The most basic example
which comes to mind would be a start countdown where the values need to
decrement from 10 down to 0.
The CTD instruction is tied to an internal bit B3:0/15 which represents a
certain alarm within the process. As the alarm is energized, the counter
will decrement the value by 1. After 5 distinct alarms, the counter will
reach the limit which is set at -5. Once the limit is reached, the counter
will automatically set the .DN bit. This .DN bit will set a bit which
represents that the process has reached an alarm threshold.

The threshold will be set HIGH until the .DN bit is energized. The only
way to reset this bit is to reset the Counter. Doing so is possible through
the use of the RES Instruction which will set the “Accum” value of the
counter back to 0 and the .DN bit to LOW.
Counter examples
● Operating pushbutton PB1 provides the off-to-on transition pulses that are
counted by the counter.
● The preset value of the counter is set to 7.
● Each false-to-true transition of rung 1 increases the counter’s accumulated value
by 1.
● After 7 pulses, or counts, when the preset counter value equals the accumulated
counter value, output DN is energized.
● As a result, rung 2 becomes true and energizes output O:2/0 to switch the red
pilot light on.
● At the same time, rung 3 becomes false and de-energizes output O:2/1 to switch
the green pilot light off.
● The counter is reset by closing pushbutton PB2, which makes rung 4 true and
resets the accumulated count to zero.
● Counting can resume when rung 4 goes false again.
Example for Down counter:
One application for an up/down-counter is to keep count
of the cars that enter and leave a parking garage. A
typical PLC program that could be used to implement
this. The operation of the program can be summarized
as follows:
● As a car enters, the enter switch triggers the up counter output
instruction and increments the accumulated count by 1.
● As a car leaves, the exit switch triggers the down counter
output instruction and decrements the accumulated count by 1.
● Because both the up- and down-counters have the same
address, C5:1, the accumulated value will be the same in both
instructions as well as the preset.
● Whenever the accumulated value of 150 equals the preset
value of 150, the counter output is energized by the done bit to
light up the Lot Full sign.
● A reset button has been provided to reset the accumulated
count.
Examples on RS logix
https://www.youtube.com/watch?v=8PM0NQhSdNc

https://www.youtube.com/watch?v=f75mjo21zaQ

https://www.youtube.com/watch?v=X9XKP9RuxMQ

https://www.youtube.com/watch?v=1vTsERUEUDM
Programming examples
● To detect high and low level of liquid in the tank, two level switches
are used which gives output in digital terms, that is when
corresponding levels are detected, it gives output high otherwise
remain low.
● To control level of this system, Single Acting Piston valve can be
used which has two states, either fully open or fully close and to
heat the liquid, heater is used.
● Low Level Switch is mounted at the bottom of the tank and Level
High switch is mounted at the side-upper most position.
● Heater is installed inside the tank and temperature sensor such as
RTD or Thermocouple may be used to detect the temperature of
liquid in the tank.
List of Inputs and Outputs

I:1/0 = Level High Switch (Input)

I:1/1 = Level Low Switch (Input)

O:2/0 = Inlet Valve (Output)

O:2/1 = Outlet Valve (Output)

O:2/2 = Heater (Output)

I:1/14 = Start (Input)

I:1/15 = Stop (Input)

N7:1 = Temperature Data (Register)


Program Description
● RUNG000 is simply for latching a coil and master start-stop buttons.
● RUNG003 is to control the outlet valve through O:2/1. This is done when Temperature is
above 50°C. When temperature is greater than 50°C, outlet valve starts draining the liquid.
XIO of Level Low Switch is connected in series so that when Level Low is detected, it goes
true closing the outlet valve.
● Similarly in RUNG001, it works exactly same. It is energized when Level Low is detected.
The only difference in RUNG001 is that extra I:1/14 contact in parallel with LLS.
● Suppose when the system is started and the tank is partially filled, neither LHS nor LLS is
detected, in this case heater output does not get energized and heating is not controlled.
● To eliminate this error, I:1/14 (Start) is connected in parallel to LLS I:1/1 contact. This
checks if LHS (I:1/0) is detected or not. If LHS is not detected, then it opens the inlet valve
until LHS is detected and heating is started.
● In RUNG002, heater coil O:2/2 energizes when LHS I:1/0 is detected and heating is
started. This is done until temperature reaches 50°C, O:2/1 is energized de-energizing
O:2/2 which in turn stops heating.
This is a PLC Program to Sort Parts for Quality Control on Conveyor.

Problem Description
Parts are moving on the conveyor from one process line to other
with a constant speed. Out of 1000 part, one part is taken out for
quality check. Implement automation of this process in PLC using
Ladder Diagram programming language.
Problem Solution
● To detect the parts, detector such as proximity switch, optical
sensors or any other sensor is used.
● Connect output of this detector to Input Module of PLC which sets
and resets image memory according to parts’ detection.
● Give this detection, as an input to Up Counter which is incremented
with each part’s detection.
● Set counter preset value to 1000.
● Operate Solenoid for a few seconds until the part is diverted for
quality check
List of Inputs and Outputs

I:1/14 = Start (Input)

I:1/15 = Stop (Input)

I:1/0 = Detector input (Input)

B3:0/0 = Latching Coil (Bit)

O:2/0 = Conveyor Motors (Output)

O:2/1 = Solenoid to operate gate (Output)

C5:0 = Up Counter to count 1000 parts (Counter)

T4:0 = Timer to operate solenoid (Timer)

-(RES)- = Reset counter value (Timer/Counter)


Program Description
● RUNG000 is Master Start and Stop the process.
● RUNG001 operates Conveyor Motors with address O:2/0 to start moving parts
to other process. This is started as soon as Start PB I:1/14 is pressed.
● RUNG002 comprises Up Counter which counts the number of parts detected by
the detector which is connected to I:1/0. Whenever a part is detected, I:1/0 goes
high incrementing accumulator value of C5:0 Counter.
● When 1000 parts are counted, done bit is generated which is used to operate
Solenoid Coil in RUNG003. It allows the current to pass and solenoid is
operated.
● Assuming that it takes 2secs to divert the part for quality check, 2secs of timer
T4:0 is used. This timer bit T4:0/DN resets the counter value to 0 which in turn
unlatches solenoid coil O:2/1 taking gate to its main position.
PLC Program for Cleaning and Rinsing Bottles in Beverage
Industries.

Problem Description
Number of bottles are moving on the conveyor belt.
Cleaning and Rinsing of these bottles is to be performed.
Implement automation of this process in PLC using Ladder
Diagram programming language.
Problem Solution
● A huge cylinder carries all the bottles through this process which rotates on a fixed
RPM.
● Use a switch to sense the bottle from the conveyor belt.
● Conveyor belt also has a fixed speed.
● Mechanical clip is used to hold the bottle tightly throughout the process. This
mechanical switch has two positions, hold and return.
● Motor is used to turn the bottles. Motor is used such that it rotates only at 180o angle
turning bottles upside down.
● Along with the cylinder, water supply tubes are fixed in the position and solenoid
valves are used to sprinkle water inside the bottles.
● Proximity switch is used to detect the upside position of a bottle to perform rinsing
and cleaning.
● There are total 30 number of bottles cleaned and rinsed simultaneously in a process
stream. Let us program cleaning of a single bottle.
Program Description
● RUNG001 is to operate Clipping of a bottle. When I:1/0 is detected which is an
address of Bottle Enter proximity switch, O:2/0 energizes which is connected to
perform first position of the clip which holds the bottle.
● RUNG002 & RUNG003 are to energize O:2/1 which operates rotating of a bottle by
rotating motor in forward direction by 1800, bottle is turned upside down after 2secs
bottle is held.
● RUNG004 & RUNG005 are used to energize O:2/2 which is connected to the
solenoid valve coil to sprinkle water inside from the bottom of upside down bottle.
This is done when I:1/1 proximity detects the presence of upside down bottle. Water
sprinkling is done for 2secs and solenoid coil is de-energized.
● RUNG006 is used to de-energize motor forward coil and energize motor reverse coil
with which is connected to O:2/3 to take bottle back to its main position. This is
performed when I:1/2 detects the presence of a bottle to leave.
● RUNG007 and RUNG008, when O:2/3 is energized, after 3secs, Bottle is released by
the clip. O:2/3 is the output to activate 2nd position of the clip which is to leave a
Prepare a ladder diagram for solving following
equation
The following calculation will be made when input I:1/0 is true.

x=2^y √(2+Sin y)
If the result x is between 1 and 10 then the Output 0 will be turned
on. The value of x will be output as an Analog voltage. Perform
this operation in PLC using Ladder Diagram programming
language.
Problem Solution
● Perform tasks individually as defined below.
● Assign integer number addresses to store the 16/32bit data into
registers.
● Use this addresses in the mathematical instructions as Source and
Destination.
● Use XPY (X to power Y) instruction to find the input 2 to power y.
● Use SIN instruction to find Sin y. Add this with 1 by using ADD
instruction.
● Square Root this 2 + Sin y by using SQR instruction and multiply the
output of XPY and SQR.
● Compare this data with the lower and upper limit and control output.
PLC Program to Maintain the Capacity of a Particular Classroom.

Problem Description
A classroom has a capacity of maximum 120 students. There are
two doors, one for Entry and the other for Exit. When number of
students in the classroom is less than 120, Entry door has a Green
light on it which remains ON. When number of students in the
classroom is 120 or more than that, Red light goes ON turning OFF
the Green light which indicates that the classroom has reached its
maximum capacity and is full.
Problem Description
● Considering the availability of two separate doors for Entry and Exit,
two separate Proximity Switches can be used to detect entry and exit of
students.
● One proximity switch is mounted at the Entry door and the other at the
Exit door.
● Both the switches will generate two different outputs which can be then
fed to PLC to operate the lights according to the Ladder Logic Program
written in its memory.
● Counter must be used to count the number of students entering and
exiting.
● Comparator must also be used to compare the count value with the
given maximum capacity of 120.
Program Description
● For this problem maximum limit is set to 120.
● RUNG000- Whenever a student enters in the class, Proximity Switch 1
generates a pulse which increments counter by 1.
● RUNG001- Whenever a student exits from the class, Proximity Switch 2
generates a pulse which decrements counter by 1.
● RUNG002- When the number of students in the class is less than 120,
Green Light goes ON.
● RUNG003- When the number of students in the class is 120 which is
the maximum capacity of the class, Red Light goes ON.
● RUNG004- It terminates the program and the scan cycle is repeated
again.
PLC Program to Separate Big and Small Parts.

Problem Description
Two different sized particles are being moved on the conveyor belt. To
pack these particles, two different boxes are used separately. These
products must not be packed in the same box. Separation of these
particles is to be controlled. Implement automation to perform this
operation in PLC using Ladder Diagram programming language.
Problem Solution
● Small parts do not need to be detected as it has a straight conveyor
path.
● Big parts are to be diverted to the adjacent conveyor which is
connected with the main conveyor as shown in diagram above.
● Detection of big particles has to be done in order to divert the path
of such particles.
● To detect big parts, Proximity Limit switch is used.
● Conveyor has a fixed speed, hence timer is to be set to energize
Gate Solenoid which diverts big parts to the adjacent conveyor.
List of Inputs and Outputs

I:1/14 = Start (Input)

I:1/15 = Stop (Input)

O:2/0 = Master Coil (Output)

I:1/0 = Proximity to detect big parts (Input)

O:2/1 = Gate solenoid coil (Output)

T4:0 = Timer to operate gate (Timer)


Program Description
● RUNG000 is to Master Start and Stop the separation process.
● RUNG001 and RUNG002 operates solenoid coil.
● When Proximity switch detects a big part, it energizes and latches Solenoid
Coil which is connected to O:2/1.
● Let us assume it takes approximately 2secs for a big part to transfer from
main conveyor to the adjacent one.
● When Solenoid coil is energized, Timer T4:0 is started.
● Solenoid coil remains energized for 2secs that is when part is being
diverted to the adjacent conveyor.
● After 2secs, when a big part is diverted to the adjacent conveyor, XIO of
T4:0/DN de-energizes O:2/1 and the Gate is returned back to its main
position to let Small parts move on the main conveyor.
PLC Program to Jump to Other Process.

Problem Description
Implement Jumping from one process to another process in PLC using Ladder Diagram
programing language.
Problem Solution
● This type of operation is most widely used in hazardous area where some
action must be taken immediately despite of the status of currently running
process.
● Use JMP instruction to perform this task.
● This Jump instruction does not differ from any Microcontroller Jump
instruction, this Jump instruction also must be used with LBL (Label)
instruction.
● Simply explaining, when JMP is activated, all the outputs between JMP and LBL
are disabled until this is active. By saying ‘all outputs’, it does not include latch –
(L)– outputs.
List of Inputs and Outputs

I:1/0 = Input to Jump to Label (Input)

I:1/1 = Input A (Input)

I:1/2 = Input B (Input)

I:1/3 = Input C (Input)

I:1/4 = Sensor Input (Input)

O:2/0 = Output 0 (Output)

O:2/1 = Output 1 (Output)

O:2/2 = Output 2 (Output)

O:2/3 = Output 3 (Output)

Q2:0 = Jump (JMP and LBL) (I/O)


Program Description
● RUNG000 comprises of a Manual input which may be a toggle button or
sensor output by which operation is performed.
● Until I:1/0 is pressed, JMP does not energize, that means program is being
scanned rung by rung and it does not affect program or process at all.
● When I:1/0 is pressed, program is directly jumped to the LBL and scans
RUNG004.
● If Sensor Input I:1/4 is true, it energizes O:2/3 turning ON Output 3.
● As long as JMP is energized, all the output between JMP and LBL rungs
are skipped and Input I:1/1 to I:1/3 do not affect O:2/0 to O:2/2 at all.
● Important thing to note here is that if Latch Output is used between JMP-
LBL rungs and is active then it is not unlatched when JMP energizes.
PLC Program to Measure Time Taken by an Event.

Problem Description
There are certain objects moving on conveyor belt. Time of an object
to reach from one end to another end of the conveyor is to be
measured. Implement this in PLC using Ladder Diagram
programming language.
Problem Solution
● Install two proximity switches, one at the head end and another at
the tail end.
● When first proximity detects an object, it latches and output starting
timer.
● When another proximity placed at the tail end detects the same
object, timer is stopped.
● Move preset value to any register or output displays.
● This shows time taken by an event.
● Similar phenomena can be applied to measure time taken to fill an
empty tank.
List of Inputs and Outputs

I:1/0 = Start Measurement (Input)

I:1/1 = Stop Measurement (Input)

I:1/2 = Head proximity (Input)

I:1/3 = Tail Proximity (Input)

T4:0 = Retentive Timer to measure time (Timer)

N7:0 = Register to store measured time (Register)

O:6 = (Display) To display measured time (Output)

-(RES)- = Reset Retentive timer (Reset)


Program Description
● RUNG001 & RUNG002 operate Timer T4:0 through Timer Coil O:2/1. When
Head Proximity Switch detects an object, it latches timer coil activating
Timer T4:0.
● RUNG003 operates moving and converting of timer accumulator value.
When Tail Proximity detects an object, this de-energizes Timer Coil
stopping timer T4:0. And as soon as timer stops when I:1/3, it activates
RUNG003 and TOD and MOV instruction are executed.
● MOV instruction moves T4:0.ACC value intro register N7:0 and TOD
instruction converts Decimal data into equivalent BCD code to operate
Display with address O:6. Digits displayed on the display is time taken by
an event.
● Retentive timer is used here so that when Tail Proximity detects the object
and Master Coil is de-energized, value in the accumulator do not change.
PLC Program to Detect Burned Chips and Remove Them.

Problem Description
Potato chips are made and ready to be packed. But before that, it
goes through a conveyor in which final quality check is done, burnt
chips are detected and removed from the process line. Implement
automation of this process in PLC using Ladder Diagram
programming language.
Problem Solution
● To detect burned chips, light source and sensors are used.
● Light source is used so light detectors such as Light Dependent Resistors are used to
detect the burned chips.
● Blowers are used to throw burned chips away from the conveyor when detected.
● There are total number of 8 blowers. Number of blowers to be used depends on the width
of a conveyor belt.
● Time measurement of an event to take place can be used here to measure what time
burned chips take to reach from light source to blowers when detected.
● Set this time as preset of a timer to operate particular blower.
● There are 8 blowers, so 8 light detecting circuits must be used in order to operate all
blowers.
● Let us assume we are using Light Dependent Resistor. To use this resistor, threshold has
to be set that is darkest color to be passed as a good quality product. If chips are darker
than the desired level, light source detects it and activates corresponding circuit.
● So output of this circuit is normally high and to activate blower, normally low logic has to be
set while programming or we can even invert output from LDR circuit.
List of Inputs and Outputs
I:1/14 = Start (Input)
I:1/15 = Stop (Input)
O:2/15 = Master Coil (Input)
O:2/8 = Conveyor (Output)
O:2/9 = Light Source (Output)
I:1/0 to I:1/7 = Light Dependent Resistors (Input)
B3:0/0 to B3:0/7 = Bit latching (Bits)
O:2/0 to O:2/7 = Blowers (Output)
T4:0 = Timer to activate blower after 1sec (Timer)
Program Description
● RUNG001 operates conveyor and light source. When Start PB is pressed, it
energizes conveyor motor coil and light source.
● There are total 8 LDR circuits are mounted next to each other. LDR1 activates
Blower1, LDR2 activates Blower2 and so on.
● Ladder diagram has shown just two LDRs and Blowers. Further programming for all
other blowers and LDRs remain same.
● When any defected part is detected, for example if LDR1 detects a defected part,
then it latches the corresponding coil bit B3:0/0 which in turn activates timer.
● 1sec is assumed time taken by a part to reach from Light Source to Blower and hence
timer has preset 10.
● When 1sec is over, it activates Blower1 with address O:2/0. Blower energizes and
immediately de-energizes giving just a push to detected part.
● Similarly it works for all LDR circuits.
● Many PLCs provide Time Base of 0.01 which may be used for more accuracy.
Problem Solution

1. They are so many ways to write a program for traffic light control ex:
sequencer output method but in this normal input, outputs and timers are

used.

2. Timers are used to give time delay for output to turn ON and OFF.
3. Reset coil is used at the end to run the program continuously.
4. Comparator blocks are used to reduce the number of timers used.
PLC Logic Description for 3-way Traffic Control System

RUNG000 :

This is a Latching rung to operate the system through Master Start and Stop PB.

RUNG001 and RUNG0002 :

Starting the timer to turn ON first output West Green so east and west should be in
red.

Comparators in Parallel rung are used to turn OFF East red after 15 sec. Timer T4:2
timing bit in parallel contact used to turn ON East red again in 5th and 6Th Step.
(Refer Above Tabular column for clarification)

RUNG 0003 :

Turning ON North Red up to 3rd step using T4:0 and T4:1’s timer timing bit and
comparator blocks.
Rung 0004 :

Turn ON East yellow for 5 sec using comparator blocks. (Step 2nd)

Rung 0005-0006-0007-0008-0009-0010 :

The same procedures followed to turn ON further outputs. ( Refer Tabular column for a
sequence of operation)

RUNG 0011 :

Reset coil is turned ON using T4:2 ‘s done bit to restart the cycle from beginning

The program runs continuously until STOP PB is pressed

Conclusion:

The above-explained 3 ways traffic light control using PLC is for example only. It may vary from
real-time. We can use this example program to understand the working of timers and
comparator block function in AB PLC.
Design a program on paper and prepare a PDF
of it and upload. Give your pdf name as roll
number….
https://drive.google.com/drive/folders/1Zdu4YyYjSgu
5Ib2S6c6VUmd7QO1goHay?usp=sharing

You might also like