Professional Documents
Culture Documents
Programmable Logic Controllers: Frank D. Petruzella
Programmable Logic Controllers: Frank D. Petruzella
Logic Controllers
Third Edition
Frank D. Petruzella
McGraw-Hill
Chapter 7
Programming
Timers
Timers
There are very few industrial control systems that do not
need at least one or two timed functions. They are used to
activate or de-activate a device after a preset interval of
time.
Time delay relays and solid-state timers are used to provide a time
delay. They may have displays, pots or other means of operator
interface for time settings and electromechanical or solid state
outputs.
Time Delay
Relay
Solid-State
Timer
L2
S1
L1
10 s
Output
S1 open, TD de-energized,
TD1 open, L1 is off.
S1 closes, TD energizes,
timing period starts,
TD1 still open, L1 is still off.
10 s
Input
Sequence of operation
ON
OFF
Timing Diagram
L2
S1
Sequence of operation
L1
S1 open, TD de-energized,
TD1 closed, L1 is on.
S1 closes, TD energizes,
timing period starts, TD1
is still closed, L1 is still on.
10 s
10 s
Input
Output
On
Off
Timing Diagram
S1 is opened, TD de-energizes,
TD1 closes instantly, L1 is
switched on.
L2
S1
Sequence of operation
S1 open, TD de-energized,
TD1 open, L1 is off.
L1
10 s
10 s
Input
S1 closes, TD energizes,
TD1 closes instantly,
L1 is switched on.
S1 is opened, TD de-energizes,
timing period starts, TD1 is
still closed, L1 is still on.
On
Output
Off
Timing Diagram
L2
Sequence of operation
S1
S1 open, TD de-energized,
TD1 closed, L1 is on.
L1
10 s
10 s
Input
Output
On
Off
Timing Diagram
S1 closes, TD energizes,
TD1 opens instantly,
L1 is switched off.
S1 is opened,
TD de-energizes, timing
period starts, TD1 is still
open, L1 is still off.
After 10 s, TD1 closes,
L1 is switched on.
(c) instantaneous
(d) NC
Off
Timing Diagram
L2
S1
L1
10 s
a. as long as S1 is closed
b. for 10 seconds after coil TD is energized
c. for 10 seconds after coil TD is de-energized
d. both a and c
a. as long as S1 is closed
b. as long as S1 is open
c. for 10 seconds after S1 is closed
d. both b and c
Timer/Counter
Command
TON
Name
Timer On-Delay
Description
Counts time base
intervals when the
instruction is true
Timer/Counter
Command
TOF
Name
Timer Off-Delay
Description
Counts time base
intervals when the
instruction is false
RES
Timer/Counter
Command
Name
RTO
Retentive Timer
ON
RES
Reset
Description
Counts time base
intervals when the
instruction is true and
retains the accumulated
value when the
instruction goes "false" or
when power cycle occurs
When this instruction is
"true" it resets the count
of the RTO counter
Output line
Input
True
False
Timed period
On delay
time duration
True
Timer
False
OFF
ON
T4:0
/EN
/TT
/DN
T4:0
EN
EN
EN
DN
T4:0
/EN
/TT
/DN
.PRE
.ACC
T4:0
1.0
15
0
EN
DN
L1
Input A
Input A
TON
TIMER ON DELAY
Timer
T4:0
Time base
1.0
Preset
10
Accumulated
0
10
EN
DN
Output B
Output C
Output D
Output B
T4:0
EN
T4:0
Output C
TT
Output D
T4:0
DN
Off
On
Off
On
Off
On
Timer-done bit
Off
Timer accumulated 0
value
4s
4s
Internal use
Preset value PRE
Accumulated value ACC
0
1
2
Stop
Start
L2
1TD
1TD-1
(instantaneous
contact)
M
1TD-2
(5 s)
(timed contact)
Stop
Internal
relay
Start
Output
L2
L1
Stop
Start
Motor
Internal
relay
Motor
M
Timer
PR: 5
TB: 1 s
Output
line
Start-up
PB1
Reset
PB2
CR1
CR1-1
1TD
CR1-2
Horn
CR1-3
1TD-1
(10 s)
L2
Inputs
Output
Start-up
PB1
Reset
PB2
PB1
PB2
T4:0
EN
T4:0
TON
TIMER ON DELAY
Timer
T4:0
Time base
1.0
Preset
10
Accumulated
0
10
Horn
T4:0
DN
EN
EN
DN
Horn
Input
Output
L2
L1
Switch
SW_1
SW_1
timer_1.dn
TON
Timer On Delay
Timer
timer_1
Preset
12000
Accumulated 12000
0
EN
DN
Valve
Valve
L1
Start
PB2
Stop
PB1
Lube oil
pump motor
L2
OL
M1
M1-1
PS1
Main drive
motor
OL
M2
(lube oil
pressure switch)
1TD
OL
M3
1TD-1
(15 s)
Feed
motor
PB1
PB2
M1
Outputs
OL
PB1
M1
M1
PB2
PS1
OL
PS1
M2
M2
OL
M3
TON
TIMER ON DELAY
Timer
T4:0
Time base
1.0
Preset
15
15
Accumulated
0
T4:0
DN
EN
DN
M3
Input
Output
L2
L1
S1
I:1.0/0
TOF
TIMER OFF DELAY
I:1.0/0
EN
TIMER
Time base
Preset
Accumulated
T4:3/DN
T4:3
1.0
15
0
15
DN
O:2.0/1
O:2.0/1
PL
False
Timed period
Off delay
timed duration
True (logic 1)
False (logic 0)
Timed output
O:2.0/1
Input
5000
10000
15000
Output
L2
Relay Ladder
Schematic
Diagram
L2
Outputs
L1
L2
Operation
Before starting, PS1 must be closed.
When the pump start button is pressed, the pump starts. The
button can then be released and the pump continues to operate.
When the stop button is pushed, the pump stops.
PS2 and PS3 must be closed for 5 s after the pump starts. If
either PS2 or PS3 opens, the pump will shut off and will not not
be able to start again for another 14 s.
Inputs
Output
L1
L2
05
Retentive Timer
A retentive timer accumulates time whenever the device
receives power, and maintains the current time should
power be removed from the device. Once the device
accumulates time equal to its preset value, the contacts of
the device change state. The retentive timer must be
intentionally reset with a separate signal for the
accumulated time to be reset.
Electromechnical Retentive Timer
Cam operated
contact
Motor-driven
cam
Same address
039
Accum = Preset
L2
L1
60000
0
Bearing Lubrication
Program
Sequence Of Operation
To start
10
0
15
10800
Cascading Timers
The programming of two or more timers together is
called cascading. Timers may be interconnected, or
cascaded to satisfy any required control logic.
Relay Schematic
Diagram
Three motors started
automatically in
sequence with a 20-s
time delay between
each motor startup.
20000
2000
0
30000
12000
Red
30 s
Green
25 s
Amber
5s
30
25
c. either a or b
b. an output instruction
d. both a or b
21. For the program shown, the pilot light will be:
a. on at all times
b. off at all times
c. switched on 15 s after the switch has been actuated
from the open to the closed position
d. switched off 15 s after the switch has been actuated
from the on to off position