Chapter - 5 Programming Timers
Chapter - 5 Programming Timers
Programmable
Logic Controllers
(10651572)
Office: 11-4-130 1
Chapter 5*
Programming
Timers
* Chapter 7 in the book (Petruzella 2016) 2
Chapter Objectives 3
Dr. Mohammad Abuabiah
• Program the control of outputs using the timer instruction control bits.
5.1 Mechanical Timing Relays 4
• There are very few industrial control systems that do not need at least
Dr. Mohammad Abuabiah
one or two timed functions. Mechanical timing relays are used to delay
the opening or closing of contacts for circuit control. The operation of a
mechanical timing relay is similar to that of a control relay, except that
certain of its contacts are designed to operate at a preset time interval,
after the coil is energized or de-energized.
An-Najah National University
5.1 Mechanical Timing Relays 5
• Figure 7-7 shows an off-delay timer circuit that uses a normally closed,
Dr. Mohammad Abuabiah
S5T#XY
– where X is the time number and Y is the time type (Houser: H, Minute: M, Second: S).
• For example, if you want a time to be 4 second, the instruction for TV will be:
❑ S5T#4S
• Another example, if you want a time to be 1 Hour 10 Minute 10 Second, the instruction
for TV will be:
An-Najah National University
❑ S5T#1H10M10S
5.2.1 S_PULSE (Pulse Timer) 14
• This timer starts when there is a positive change from 0 to 1 at the set bit(S). The timer runs
Dr. Mohammad Abuabiah
for the preset time as long as the signal at the set bit is 1.
• When the timer is running and the signal at the set bit(S) changes from 1 to 0, the timer will
be stopped and the status at the output will be 0.
• A timer is reset when there is a change from 0 to 1 at the Reset bit(R) while the timer is
running. The remaining value also sets to 0 in both BI and BCD.
• A positive change at the set bit(S) is always necessary to activate the timer again.
An-Najah National University
5.2.2 S_PEXT (Pulse Extended Timer) 15
• This timer starts running when there is a positive change from 0 to 1 at the set
Dr. Mohammad Abuabiah
bit(S). The timer runs for the preset time even if the signal state at the set bit(S)
changes to 0 before the preset time is elapsed.
• The status of the timer block is 1 as long as the timer is running. A positive
change at the set bit(S) is always necessary to activate the timer again.
• A timer is reset when there is a change from 0 to 1 at the Reset bit(R) while the
timer is running. The remaining value also sets to 0 in both BI and BCD.
An-Najah National University
Example 5.1 Running 3 Motors 16
• Write a ladder program to run three motors using single start/stop push
Dr. Mohammad Abuabiah
seconds.
3) This process repeats as long as the
stop switch isn’t pressed.
Water
4) The gas and liquid valves do not
open when the other valve is open .
Example 5.2 CW and CCW with Delay 21
• The ODT timer starts running when there is a positive change from 0 to 1 at the set bit(S). A
Dr. Mohammad Abuabiah
• The timer runs for the preset time value(TV) as long as the signal at the set bit(S) is 1. The
status bit(Q) is 1 after the timer has completed its preset time without any error until the
signal state of set bit(S) is positive.
• When the signal at the set bit(S) changes from 1 to 0 while the timer is running or stopped,
in this case, the status at the output will be 0.
• A timer is reset when there is a change from 0 to 1 at the Reset bit(R) while the timer is
running. The remaining value also sets to 0 in both BI and BCD.
An-Najah National University
Example 5.3 Two Hands Control 24
• The ODTS timer starts running when there is a positive change from 0 to 1 at the set bit(S).
Dr. Mohammad Abuabiah
The timer runs for the preset time value(TV) even if the signal state at the set bit(S) changes
to 0 before the preset time value(TV) is completed.
• The status bit(Q) is 1 after the timer has completed its preset time without regard to the
signal state at the set bit(S). The timer will be re-triggered with the preset time value(TV)
when there is a change at the set bit(S) while the timer is running.
• A timer is reset when there is a change from 0 to 1 at the Reset bit(R) while the timer is
running. The remaining value also sets to 0 in both BI and BCD.
An-Najah National University
5.2.5 S_OFFDT (Off-Delay Timer) 29
• The OFFDT timer block starts running when there is a negative edge at the set bit(S). A
Dr. Mohammad Abuabiah
signal change at the set bit(S) is always necessary to start the timer again.
• The status bit(Q) is 1 as soon as the signal state at the set bit(S) is positive and while the
timer is running.
• The timer is reset when the signal state at the set bit(S) goes from 1 to 0 while the timer
is running. A timer is reset when there is a change from 0 to 1 at the Reset bit(R) while
the timer is running. The remaining value also sets to 0 in both BI and BCD.
An-Najah National University
HW 5.3 Boxes Handling 30
Diffuse
• Write a PLC ladder program such that: Emitter Sensor Emergency
Dr. Mohammad Abuabiah