ADC Chapter 4
ADC Chapter 4
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.
You can set time-based activity with the help of the PLC programming
timer instruction. Every PLC having different timer functions.
Addressing format for timer instruction with the three status bits.
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
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
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:
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
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
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
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
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
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
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.
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
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