This document provides information about Allen Bradley timers used in Programmable Logic Controllers (PLCs). It discusses different timer types including TON, TOF, and RTO timers. It describes the functionality and memory usage of timers and provides examples of how to program timer instructions and address timer status bits in Allen Bradley SLC-500, LogixPro, and ControlLogix platforms.
1. Allen Bradley Timers
Timers
Chapter 04
Sections: 4-4 through 4-13
Covered in class
Northampton Community College 1
2. Programmed Timer Instructions
Northampton Community College 2
PLC timers are output instructions. They provide the same function as
electromechanical and solid state timers. Output instructions in the
SLC500 series and the LogixPro simulator are always placed against
the right power rail. In the ControlLogix platform output device can be
placed against the right power rail or in series on the rung.
Some advantages to PLC timers:
Their settings can be easily altered and can
also be altered on-the-fly.
The number of PLC timers used can be
increased or decreased by programming
changes without making any wiring changes.
The accuracy of PLC timers is extremely high
and repeatable.
Nola PLC Programming http://nolaplcprogramming.com/
3. SLC-500/LogixPro Default File Types
FILE TYPE IDENTIFIER FILE
NUMBER
Output O 0
Input I 1
Status S 2
Bit B 3
Timer T 4
Counter C 5
Control R 6
Integer N 7
Float Point * F 8
* Available in SLC-5/03 OS301, OS302 & SLC-5/04 OS400, OS401 &
SLC-5/05 processors
*Not available in LogixPro
Northampton Community College 3
4. SLC-500 User Defined File Types
FILE TYPE IDENTIFIER FILE NUMBER
Bit B 9 - 255
Timer T 9 - 255
Counter C 9 - 255
Control R 9 - 255
Integer N 9 - 255
Float Point * F 9 - 255
String* St 9 - 255
ASCII * A 9 - 255
File #9 has a special purpose. It is called the “Computer Interface File” (CIF) and
is used when communications is required between early AB PLCs
* Available in SLC-5/03 OS301, OS302 & SLC-5/04 OS400, OS401 & SLC-
5/05 processors
Note: User defined files are not available in LogixPro
Northampton Community College 4
5. Allen Bradley Timer Instructions
Northampton Community College 5
Allen Bradley SLC-500’s, ControlLogix and LogixPro have
three timers available:
TON – Timer On-Delay
TOF – Timer Off-Delay
RTO – Retentive TON
6. Timer On-Delay Timer (TON) – SLC500s & LogixPro
AB timers have four instruction parameters:
Timer number or
Address of the
timer
Time Base: in the
SLC-500 the choice
is: 1.0S or 0.01S
LogixPro Time Base
is fixed at 0.1S
Preset – How long the
timer should time.
TotalTime = Preset * TB
Accumulator –
The current time
value of the timer
Northampton Community College 6
7. Timer Parameters – SLC500s & LogixPro
Northampton Community College 7
Timer
The address of the timer. Timers are stored in data file #4 and use a
file designator of ‘T’. Valid range of timers is: 0 to 255. Therefore, for
this example we’ll use: T4:0, the first timer in the file.
Time Base
The number of “ticks” on the clock. The SLC-500 series can be set to
1.0-second or 0.01-seconds, meaning that each “tick” is either 1-
second in duration or 0.01-second in duration. LogixPro timers are
fixed at 0.1 seconds.
Preset Value (PRE)
The preset value is the length of time the timer should time before its
contacts change state. The valid range is: 0 to 32,767. The total time
of the timer is determined by:
Total_Time = Preset_Value * Time_Base
Accumulator Value (ACC)
Stores the current time of the timer.
8. Timer Memory – SLC500s & LogixPro
Northampton Community College 8
Each timer, of any type, requires three, 16-bit words in timer
memory.
Word 0 – Stores the status bits of the timer
Word 1 – Stores the preset value
Word 2 – Stores the accumulator value
Timers have three status bits that are stored in word 0:
Bit 13 or Bit (DN) – Done Bit
Bit 14 or Bit (TT) – Timer Timing Bit
Bit 15 or Bit (EN) – Timer Enable Bit
9. Timer On-Delay, TON, Timer Memory Map – SLC500s &
LogixPro
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 0 EN TT DN NA NA NA NA NA Reserved
Word 1 Preset Value
Word 2 Accumulator Value
Northampton Community College 9
Enable Bit (EN)
Sets to a logic ‘1’ when the rung containing the timer is true, otherwise it is a
logic ‘0’.
Timer Timing Bit (TT)
Sets to a logic ‘1’ when the rung containing the timer is true and the timer is
timing; ACC < PRE. Sets to a logic ‘0’ when the timer is not timing; ACC =
PRE or the rung containing the timer is false.
Done Bit (DN)
Sets to a logic ‘1’ when the rung containing the timer is true and the ACC =
PRE. Sets to a logic ‘0’ when the rung containing the timer is false or when
the rung is true and the ACC ≠ PRE.
10. Timer On-Delay, (TON), Functionality – SLC500s & LogixPro
Northampton Community College 10
When the rung containing the timer
becomes true, the timer starts timing.
The EN and TT bits will set to a ‘1’ and
the ACC will start counting up at the rate
of the time base.
When the ACC = PRE the timer is done.
The TT bit resets to a ‘0’ and the DN bit
sets to a ‘1’.
When the ACC = PRE the timer is done.
When the rung containing the timer
becomes false, the timer ACC will reset
to zero even if has not reached the PRE
value and the EN, TT and DN bits will
reset to ‘0’.
Rung EN TT DN ACC
0 0 0 0 0
1 1 1 0 2
1 1 1 0 5
1 1 0 1 10
0 0 0 0 0
1 1 1 0 3
0 0 0 0 0
11. Timer Addressing
Northampton Community College 11
Timers, by default, are stored in data file #4 and has a file
designator of ‘T’. Therefore, timer number zero is addressed
as T4:0
There are two main forms of addressing in AB; Bit level and
Word level. To address the status bits of a timer use bit level
addressing as follows:
T4:0/13 or T4:0/DN = Done Bit
T4:0/14 or T4:0/TT = Timer Timing Bit
T4:0/15 or T4:0/EN = Enable Bit
12. Timer Adressing
Northampton Community College 12
Word level addresses are used to address the value of a
16-bit word. Therefore, to read the value of the timer
accumulator or preset use a word level address as follows:
T4:0.1 or T4:0.PRE = Value of timer zero’s preset
T4:0.2 or T4:0.ACC = Value of timer zero’s accumulator
Almost any word in the AB memory structure can be
addressed to bit level, here is an example:
T4:0.ACC/8
This is a bit level address that is referencing bit-8 in the accumulator
word of timer zero.
13. Example of Programming TON Status Bits –
SLC500s & LogixPro
Northampton Community College 13
14. Timer Status Bits and Timing Diagram – SLC500s
& LogixPro
Northampton Community College 14
15. Timer On-Delay Timer (TON) – ControlLogix
Timer tag name:
Ex. Pump_Timer
Time Base: The TB
is fixed at 0.001
sec. (1mS)
Therefore there is
no parameter field
Preset – How long the
timer should time.
TotalTime = Preset * TB
Accumulator –
The current time
value of the timer
ControlLogix timers function exactly like timers in the SLC500 series
and LogixPro
Northampton Community College 15
16. Timer Parameters – ControlLogix
Northampton Community College 16
Timer
The tag name of the timer. Example: Pump_Timer. The tag is
created as a Timer Data Type. The Timer data type is a Structure
because each timer uses more than one word.
Time Base
The number of “ticks” on the clock. The ControlLogix timers are fixed
at 0.001 sec. or 1mS therefore there is no parameter field for the
time base.
Preset Value (PRE)
The preset value is the length of time the timer should time before its
contacts change state. The valid range is: 231 - 1 (0 to
2,147,483,647). The total time of the timer is determined by:
Total_Time = Preset_Value * Time_Base
Accumulator Value (ACC)
Stores the current time of the timer.
17. Timer Memory – ControlLogix
The plus (+) sign is
used to expand a
structure. The minus
(-) is used to
collapse a structure
Northampton Community College 17
Timers use a timer data type called a Timer Structure. The
timer structure consists of three, 32-bit words.
The ControlLogix timers have three status bits. These bits
function exactly like the SLC500 and LogixPro timer status
bits. The only difference is how they are referenced.
Done Bit – Timer_Tag.DN
Timer Timing Bit – Timer_Tag.TT
Timer Enable Bit – Timer_Tag.EN
Structure
members
Data types of
the members of
the structure.
18. ControlLogix Timer
What is the length of time for the DN bit to turn on?
0.001 Seconds * 30,000 = 30 Seconds
Northampton Community College 18
19. Timer Off-Delay Timer (TOF) – SLC500s & LogixPro
AB timers have four instruction parameters:
Timer number or
Address of the
timer
Time Base: in the
SLC-500 the choice
is: 1.0S or 0.01S
LogixPro Time Base
is fixed at 0.1S
Preset – How long the
timer should time.
TotalTime = Preset * TB
Accumulator –
The current time
value of the timer
Northampton Community College 19
20. Timer Parameters – SLC500s & LogixPro
Northampton Community College 20
Timer
The address of the timer. Timers are stored in data file #4 and use a
file designator of ‘T’. Valid range of timers is: 0 to 255. Therefore, for
this example we’ll use: T4:1, the second timer in the file.
Time Base
The number of “ticks” on the clock. The SLC-500 series can be set to
1.0-seconds or 0.01-seconds, meaning that each “tick” is either 1-
second in duration or 0.01-second in duration. LogixPro is fixed at
0.1 seconds.
Preset Value (PRE)
The preset value is the length of time the timer should time before its
contacts change state. The valid range is: 0 to 32,767. The total time
of the timer is determined by:
Total_Time = Preset_Value * Time_Base
Accumulator Value (ACC)
Stores the current time of the timer.
21. Timer Memory – SLC500s & LogixPro
Northampton Community College 21
Each timer, of any type, requires three, 16-bit words in timer
memory.
Word 0 – Stores the status bits of the timer
Word 1 – Stores the preset value
Word 2 – Stores the accumulator value
Timers have three status bits that are stored in word 0:
Bit 13 or Bit (DN) – Done Bit
Bit 14 or Bit (TT) – Timer Timing Bit
Bit 15 or Bit (EN) – Timer Enable Bit
22. Timer Off-Delay, TOF, Timer Memory Map – SLC500s &
LogixPro
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 0 EN TT DN NA NA NA NA NA Reserved
Word 1 Preset Value
Word 2 Accumulator Value
Northampton Community College 22
Enable Bit (EN)
Sets to a logic ‘1’ when the rung containing the timer is true, otherwise it is a
logic ‘0’.
Timer Timing Bit (TT)
Sets to a logic ‘1’ when the rung containing the timer is false and the timer is
timing; ACC < PRE. Sets to a logic ‘0’ when the timer is not timing; ACC =
PRE, or the rung containing the timer is true.
Done Bit (DN)
Sets to a logic ‘1’ when the rung containing the timer is true and not timing.
When the rung becomes false the timer starts timing. When the ACC = PRE
the DN bit resets to a logic ‘0’ until the rung becomes true again.
23. Timer Off-Delay, (TOF), Functionality – SLC500s & LogixPro
Northampton Community College 23
When the rung containing the timer
becomes false, the timer starts timing.
The EN bit will reset to a ‘0’ and the TT
and DN bits will be set to a ‘1’. The ACC
starts timing at the rate of the TB.
When the ACC = PRE the timer is done.
The TT bit and the DN bit reset to a ‘0’.
When the rung containing the timer
becomes true, the timer ACC will reset to
zero, even if it has not reached the PRE
value. The EN and DN bit will set to a ‘1’
and the TT bit will reset to a ‘0’.
Rung EN TT DN ACC
1 1 0 1 0
0 0 1 1 150
0 0 1 1 375
0 0 0 0 500
1 1 0 1 0
0 0 1 1 356
1 1 0 1 0
24. Example of Programming a TOF Status Bits –
SLC500s & LogixPro
Northampton Community College 24
25. TOF Status Bits and Timing Diagram
Northampton Community College 25
26. ControlLogix TOF Timer
Northampton Community College 26
The ControlLogix TOF timer functions exactly like the
SLC500 series and LogixPro TOF timer.
It uses a Timer Structure.
The Time Base is fixed at 0.001 sec. (1mS).
27. RTO Functionality – SLC500s, LogixPro and ControlLogix
SLC500 Timer shown
Northampton Community College 27
An RTO timer works exactly like a TON timer
with one exception. When the rung containing
the RTO timer becomes false, the ACC will
retain the timed value. When the rung returns
to true, the timer will start timing from where it
left off.
To reset the ACC of an RTO timer a reset
(RES) instruction with the same address as
the RTO timer is required. When the RES
rung is true, the timer ACC resets to zero. If
the RES rung remains true and the timer rung
is also true, the timer will time, but will
immediately be reset to zero.
Rung RES EN TT DN ACC
1 0 1 1 0 1
1 0 1 1 0 3
0 0 0 0 0 3
1 0 1 0 1 5
X 1 0 0 0 0
1 1 0 0 0 0
0 1 0 0 0 0
28. Example of Programming an RTO with Status Bits – SLC500s and
LogixPro
SLC500 Timer shown
Northampton Community College 28
29. Example of Programming an RTO with Status Bits – ControlLogix
What is the length of time for the DN bit to turn on?
0.001 Seconds * 47,000 = 47 Seconds
Northampton Community College 29
30. RTO Status Bits and Timing Diagram
Northampton Community College 30
31. Maximum Amount of Time a Timer can Time To
Northampton Community College 31
What is the maximum amount of time that a SLC500 and
LogixPro timer can time to?
SLC500 Timers
1.0 Second * [(215 – 1) or 32,767] = 32,767 Seconds
Which is: 9-hours 6-minutes 7-seconds
LogixPro Timers
LogixPro instructions can be a-bit tricky because LogixPro is actually 32-
bits, in some instructions. Timers are one of these.
0.1 Seconds * [(231 – 1) or 2,147,583,647] = 214,748,364.7 Seconds
Which is:
6-years 295-days 12-hours 19-minutes 24.7-seconds OR
6-years 9-(30 day months) 25-days 12-hours 19-minutes 24.7-seconds
What is the maximum amount of time that a ControlLogix
timer can time to?
0.001 Seconds * [(231 – 1) or 2,147,583,647] = 2,147,483.647 Seconds
Which is: 24-Days 20-Hours 31-Minutes 23.647 Seconds
32. Cascading Timers
Northampton Community College 32
If longer timing periods are required that are beyond the
maximum time of a single timer, timers can be cascaded as
shown here.
What is the total time
when T4:11 is done?
32,767 Seconds + 23,000 Seconds = 55,757 Seconds
or 15 hours 12 minutes 47 seconds
33. Self Resetting Timer
Northampton Community College 33
If a timer needs to reset and start over at the end of a timing
event, its own DN bit can be used to accomplish an
automatic reset as shown here.
34. Oscillator Circuit
Northampton Community College 34
Two timers can be used to create an oscillator that
oscillates at almost any frequency and duty cycle within the
range of the timers. An oscillator circuit is shown here.
Coil O:2/8
will be:
ON for ½
second
and OFF
for a ½
second
35. Oscillator Circuit Timing Diagram
Northampton Community College 35
This is the timing diagram for the oscillator circuit shown on
the previous slide.
36. Startup Warning Signal Circuit
Northampton Community College 36
When the startup PB is pressed, the horn will sound for 10-
seconds alerting bystanders that the machine or process is
about to start.
38. Oneshot or Transitional Instructions
Northampton Community College 38
The transitional or oneshot instruction is a retentive input
instruction that triggers an event to occur one time. It is
triggered on a false to true rung transition.
Some PLC manufacturers also provide a oneshot that
triggers on a true to false rung transition.
PLC manufacturers use different methods to produce a
oneshot event. The following slides show some examples.
39. Oneshot or Transitional Contact Program
I:1/11
I:1.0
11
I:1.0
11
Onshot
Contact
Onshot
Output
Onshot
Coil
Northampton Community College 39
This transitional or oneshot
contact program uses standard
contacts and coils to produce a
oneshot. The program is
designed to generate an output
pulse that, when triggered, turns
ON for the duration of one
program scan and then turns
OFF. The order of the rungs in
this program is important. Try
reversing the rung order and
running the program.
The oneshot can be triggered
from a momentary signal or from
a signal that comes on and stays
on for a length of time.
Click anywhere to start the animation
40. Types of Transitional Contacts
Off
On
Northampton Community College 40
Off-to-On Transitional Contact
Programmed to provide a
oneshot pulse when the
referenced trigger signal makes
a positive (false-to-true)
transition.
Symbol
Off
On
One
scan
Symbol
One
scan
Off
Off
On
On
On-to-Off Transitional Contact
Programmed to provide a
oneshot pulse when the
referenced trigger signal makes
a (true-to-false) transition.
41. Types of Transitional Contacts – SLC500s,
LogixPro and ControlLogix
Northampton Community College 41
Allen Bradley uses a “Oneshot Rising” (OSR) instruction. The SLC500
and LogixPro instruction requires a bit level address from either the Bit
file, file #3 or the Integer file, file #7. (We did not talk about the Integer
file, file #7 yet.)
ControlLogix uses an instruction named (ONS) that can be assigned a
tag of data type BOOL or a bit from a tag of type DINT, INT or SINT.
42. Types of Transitional Contacts – SLC500s,
LogixPro and ControlLogix
Northampton Community College 42
When the rung conditions preceding the OSR or ONS instruction
transition from false-to-true, the OSR or ONS instruction will be true for
one scan. After one scan is complete, the OSR or ONS instruction
becomes false, even if the rung conditions preceding it remain true. The
OSR or ONS instruction will only become true again if the rung
conditions preceding it transition from false-to-true.
ONS using a tag of type BOOL
ONS using bit 3 of a tag of type DINT
43. OSR Instruction – SLC500s & LogixPro
Northampton Community College 43
The controller allows the use of one OSR instruction per
output on a rung.
The address used for the OSR instruction must be unique.
Do not use it anywhere else in the program. Do not use an
input or output address on an OSR instruction.
44. OSR Instructions with the SLC-5/01 and SLC-5/02
In the top rung, the OSR instruction is not permitted inside a
branch. An error will occur when the OSR is in this position.
Northampton Community College 44
In the bottom rung, the OSR is not in the branch, so the
rung is legal. These two processors allow only one OSR
instruction per rung.
Important note:
When using these
two processors, do
not place input
conditions after the
OSR instruction on
a rung. Unexpected
operation may
occur.
45. OSR Instruction, SLC-5/03 or Higher
Northampton Community College 45
When using the SLC-5/03 processor and higher, including
the MicroLogix controllers, more than one OSR instruction
can be used on a rung, but only one per output instruction
as shown this ladder rung.