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

TIMER AND COUNTER

Uploaded by

gilbertgekwe0742
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)
26 views

TIMER AND COUNTER

Uploaded by

gilbertgekwe0742
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/ 28

FLAG, TIMER AND COUNTER

LATCH SWITCH
➢ A latch contact occurred when coil address will come in parallel
to input as NO.
➢ It will be called latch contact not parallel contact.
➢ Any bit address (Input, Output or Flag) can be given to contacts
(NO/ NC) but to coil only Output or Flag address can be given
not input address.
➢ How will a latch contact make a coil continue on?
FLAG
✓ Flag is one instruction without which it would be impossible to
make big industrial system program.
✓ Flag is an internal bit memory which has no any physical
existence outside of PLC.
✓ Flag is a bit memory like input and flag. It also gets on and off.
✓ Outside PLC it has no any existence; it is in program only and
supports our logic. If you compare flag and output, you will find
some similarities like; output is a bit memory, flag is also a bit
memory. In coil we use output and in coil we use flag too.
FLAG
✓ Then what is the difference? In your program if you have a coil with
output address suppose Q0, when this coil is on, something outside
PLC will get on. Q0 has physical existence.
✓ First existence of Q0 is Q0 terminal on PLC which gets on and further
motor, fan, lamp, relay etc. are the physical existence of output Q0.
✓ In your program if you have a coil with flag addresses suppose M0 (it is
denoted by M in most of PLC), when this coil is on, there is nothing on
outside of PLC called flag. It has no physical existence. It is used to
support our logic.
FLAG
Where and why is a flag used in PLC program?
✓ Flag is used to store temporary bit signal. Let us understand it by one
example.
✓ Suppose there is an on-delay timer
✓ There is a push button I0. When we press I0 push button, on-delay
timer should run for 15 minutes. How shall we write its ladder
✓ Is this correct? No, it is not correct because an on-delay timer
✓ needs continue supply to run but I0 is a push button which we are not
going to press for 15 minutes. I0 is a temporary signal here.
FLAG
Where and why is a flag used in PLC program?
✓ Flag is used to store temporary bit signal. Let us understand it by one
example.
✓ Suppose there is an on-delay timer
✓ There is a push button I0. When we press I0 push button, on-delay
timer should run for 15 minutes. How shall we write its ladder
✓ Is this correct? No, it is not correct because an on-delay timer
✓ needs continue supply to run but I0 is a push button which we are not
going to press for 15 minutes. I0 is a temporary signal here.
FLAG
Where and why is a flag used in PLC program?
✓ There is a push button I0. When we press I0 push button, on-delay
timer should run for 15 minutes. How shall we write its ladder
✓ Is this correct? No, it is not correct because an on-delay timer
✓ needs continue supply to run but I0 is a push button which we are not
going to press for 15 minutes. I0 is a temporary signal here.
TIMER
❖ Timer is the main instruction to make any machine automatic.
❖ Whenever we have delay required in any sequence of input/
output operation, timer is used.
❖ Consider a manual drill machine is transformed to an
automatic. There are 3 valves;
➢ V1 for air which will remove
dust from the job,
➢ V2 for some chemical and
➢ V3 for coolant.

Automatic operator
A proximity/ metal detector
sensor to sense the job
presence
❖ As sensor is on for 1 second V1 should get on automatically
without pressing any switch.
❖ As V1 is on, it should be on for 3 seconds.
❖ After 3 seconds V1 is off and V2 is on for 5 seconds
automatically.
❖ After 5 seconds V2 is off and V3 is on for 4 seconds. After 4
seconds V3 is off and drill is on.
There are four types of timer
There are four types of timer
On Delay Timer: TON require continuous power supply to be on.
It has 4 parameters: EN, PV, ACC and DN.
a) EN/ Enable bit: Enable bit is the signal from which timer starts
running and for on delay timer it should be continuous on.
b) PV/ Pre-set valve: pre-set value is the set point. How long you want
to run the timer you need to mention there. It can be millisecond/ MS,
second/ S or hour/H.
c) ACC/ Accumulator: accumulator is the running/ present/ current
value of timer. You can say it is a display which monitor the running
value of timer.
d) DN/ Done bit: Done bit is the confirmation signal of timer. When ACC
is equal to PV, done bit is on.
There are four types of timer
There are four types of timer
TOF/ off delay timer: this timer has also all four parameters.
This timer’s accumulator starts running when its enable is off. Its done bit
gets high as enable is high and the done bit gets off when accumulator is
equal to PV
There are four types of timer
TP/ pulse timer: Pulse time is very much similar to TOF.
TOF accumulator runs when enable is off and TP accumulator runs when
enable is high. It does not matter whether enable is a continue signal or a
high pulse. Done bit status is similar to TOF.
Once it starts running, it does not matter whether enable is on or off; accumulator will
keep running when enable is off also. As accumulator is equal to PV, TP will get reset
itself.
There are four types of timer
RTC/ real time clock: This timer contains year, month, day, hour, minute
and second in its pre-set value.
It is used to control outputs hourly/ daily/ weekly/ monthly yearly wise.
For example,
i. To stop your machines daily during lunch time or tea break time automatically.
ii. To switch off lights and fans daily during lunch time and during off time of your office.
Important step in programming timer

✓To switch on use NO contact of the condition signal.


✓To switch off use NC contact of the condition signal.
✓When there is a start signal, it should latch it with some flag.
✓When there is any stop signal, it should break the latch directly from
it.
examples
Consider you have given a push button I0 and a motor Q0. When I0 is
pressed, Q0 is turned ON for 10 seconds.
examples
Consider you have given a push button I0 and a motor Q0. When I0 is
pressed, Q0 is turned ON for 10 seconds.
Writing program
❖Make ladder step wise.
❖Don’t start thinking randomly.
❖Go step wise and start from first
step.
❖When you think about 1st step,
don’t think about any other step.
Writing program
❖Make ladder step wise.
❖Don’t start thinking randomly.
❖Go step wise and start from first
step.
❖When you think about 1st step,
don’t think about any other step.
Step 1 Step 4

Step 2

Step 3
✓To switch on use NO contact of the condition signal.
✓To switch off use NC contact of the condition signal.
✓When there is a start signal, it should latch it with some flag.
✓When there is any stop signal, it should break the latch directly from
it.
✓ The last signal in our program is used break all latches from it. (It means that
lastly after one cycle all coils must get off. If any coil will remain on after one
cycle then machine will not run in next cycle.)
From the given steps write the ladder diagram which performs the
process
From the given steps write the ladder diagram which performs the
process
There are 3 outputs Pump, valve and
motor. There are two inputs I0 and I1 for
start and stop. When I0 is pressed, pump
Q0 is turned on for 10 seconds. After 10
seconds Q0 off and valve Q1 is turned on
for 5 seconds. After 5 seconds Q1 off and
motor Q2 is turned on for 7 seconds. Write
the ladder logic diagram for the system
There are 3 outputs Pump, valve and
motor. There are two inputs I0 and I1 for
start and stop. When I0 is pressed, pump
Q0 is turned on for 10 seconds. After 10
seconds Q0 off and valve Q1 is turned on
for 5 seconds. After 5 seconds Q1 off and
motor Q2 is turned on for 7 seconds. The
cycle should be repeated automatically,
without pressing start button.
Write the ladder logic diagram for the
system
Counter
The counter instruction operates similar to the timer instruction in the PLC. The
major difference between the counter and the timer is the timer instruction will
continually increment its accumulative value at a rate determined by the time base
when its contacts that enable power to the instruction is closed. On other hand
counter see a complete contact transition from open to close each time it
increment the accumulative value. Counter does not care how long the contacts
stay closed Once they transition; it looks only for transition.

Types of the counter


a. Up-counter
b. Down-counter
Counter
Counter Relays:
These are used to count pulses, usually from inputs.
A total is kept, visible on the parameter screen, and when a preset total is reached,
the counter's contacts will switch over.
Counters can count in either direction, plus or minus.
Shown here in the circuit diagram, I1 pulses the CC1 counter coil and the count is
incremented by 1 for each pulse.
If I2 activates the direction coil DC1, then pulses from I1 will count down I3 can
be used to reset the counter back to zero.
As the preset amount is reached, contact C1 activates output relay Q1
On the parameter display, the left number (9999) is the preset amount, and the
right
number (1234) is the running total.
The maximum preset is 9999, and maximum count is 9999.
The operating speed of the counters is dependent on the complexity of the program.
With a simple program they can count up to 100 pulses per second (100 Hz).

You might also like