PLC Timers and Counters
PLC Timers and Counters
Internal Relays
• In PLCs there are elements that are used to hold data or bits,
and behave like relays, being able to be switched on or off
and switch other devices on or off. These are called internal
relays which is sometimes referred as auxiliary relays,
markers, flags, coils, or bit storage.
• Such internal relays do not exist as real-world switching
devices but are merely bits in the storage memory that
behave in the same way as relays.
Prepared by M. Jualayba
3
Internal Relays
• Internal relay is a relay that is use by the program only.
• It is used when you are not required to turn ON/OFF
external I/O devices.
• For programming, they can be treated in the same way as an
external relay output and input. Thus, inputs to external
switches can be used to give an output from an internal
relay. This then results in the internal relay contacts being
used, in conjunction with other external input switches to
give an output.
Prepared by M. Jualayba
4
Internal Relays
Prepared by M. Jualayba
5
Internal Relays
• Internal relays can be programmed with as many sets of
associated contacts as desired.
• To distinguish internal relay outputs from external relay
outputs, they are given different types of addresses.
Different manufacturers tend to use different terms for
internal relays and different ways of expressing their
addresses.
Prepared by M. Jualayba
6
Timers
• In many control tasks there is a need to control time thus,
PLCs have built-in timer devices.
• Timers count fractions of seconds or seconds using the
internal CPU clock.
• PLC manufacturers differ on how timers should be
programmed.
Prepared by M. Jualayba
7
Timers
• A common approach is to consider timers to behave like
relays with coils which when energized result in the closure
or opening of contacts after some preset time. The timer is
treated as an output for a rung with control being exercised
over pairs of contacts elsewhere.
Prepared by M. Jualayba
8
Timers
• There are number of different forms of timers that can be
found with PLCs:
❑ On-Delay Timers
❑ Off-Delay Timers
Prepared by M. Jualayba
9
Timers
• The on-delay timers are timers which come on after a
particular time delay.
• Turns ON after a set interval after the trigger input has
turned ON.
Prepared by M. Jualayba
10
Timers
• The off-delay timers are timers which the output starts as on
and remains on until the time delay has elapsed.
• Stays ON while the trigger input is ON and turns OFF after a
set interval after the trigger input has turned OFF.
Prepared by M. Jualayba
11
Counters
• A counter is set to some preset number value and, when this
value of input pulses has been received, it will operate its
contacts. Thus, normally open contacts would be closed,
normally closed contacts opened.
• Counters are also built-in elements in PLCs and allow the
number of occurrences of input signals to be counted.
Prepared by M. Jualayba
12
Counters
• Counters are used where items have to be counted as they
pass along a conveyor belt, or the number of revolutions of
a shaft, or perhaps the number of people passing through a
door.
Prepared by M. Jualayba
13
Counters
• There are two types of counter:
❑ Down-counters
❑ Up-counters
Prepared by M. Jualayba
14
Counters
• Down-counters count down from the preset value to zero,
example events are subtracted from the set value. When the
counter reaches the zero value, its contacts change state.
• Up-counters count from zero up to the preset value,
example events are added until the number reaches the
preset value. When the counter reaches the set value, its
contacts change state.
Prepared by M. Jualayba
15
Counters
Prepared by M. Jualayba
16
Sources
• Bolton, W. (2006). Programmable Logic Controllers. Elsevier Newnes. ISBN-10: 0-
7506-8112-8
• Manesis, S. and Nikolakopoulos, G. (2018). Introduction to Industrial Automation.
CRC Press. ISBN 13: 978-1-3510-6908-3
• OMRON (2001). A Beginner’s Guide to PLC. OMRON Asia Pacific PTE. LTD.
• OMRON (2008). ZEN Programmable Relay Operation Manual.
Prepared by M. Jualayba