0% found this document useful (0 votes)
21 views10 pages

Lab3 TIMER

Uploaded by

ductuan.12011996
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views10 pages

Lab3 TIMER

Uploaded by

ductuan.12011996
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

INTERNATIONAL UNIVERSITY

SCHOOL OF ELECTRICAL ENGINEERING

Programmable Logic Control (PLC) Lab- EEAC007IU

LAB 3: TIME FUNCTIONS

Full name: …………………………………………


Student’s ID: …………………..………………….
Class/Group: ……………………………………....
Date: ……………………………………………….

Programmable Logic Control (PLC) Lab Page 1 of 10


INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING

I. OBJECTIVES
 Understand Siemens s7-1200 TIMER
 Be able to apply to some examples
II. INTRODUCTION
1. Timers
Timers are devices that count increments of time. Timers are represented by boxes in ladder
logic. When a timer receives an enable, the timer starts to time. The timer compares its current
time with the preset time. The output of the timer is a logic 0 as long as the current time is less
than the preset time. When the current time is greater than the preset time the timer output is a
logic 1. For S7-1200, there are 4 basic Timers: TP (Pulse generation), TON (ON Delay), TOFF
(OFF delay), TONR (Accumulating ON delay).
The time functions, which are discussed next slide, are referred to as IEC Time Function to
indicate that they are different from S7 300/400 Time Functions.
2. Time functions
2.1. Timer LAD/ FBD/SCL Categories
Categories

Table 1. Timer instructions


Note: The input parameters and output parameters for TP, TON, TOF are identical.

Programmable Logic Control (PLC) Lab Page 2 of 10


INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING

Input /Output parameters


Name Declaration Data Type Description
IN Input BOOL Start input
PT Input TIME Preset Duration
R Input BOOL Reset input
Q Output BOOL Output
ET Output TIME Elapse time
Table 2
2.2. TP (Pulse generation)
Symbol

The pulse generation extends or shortens an input signal to the programmed duration. The
transition from 0 to 1 of IN will set the Q output for a programmed duration PT.

Figure 1. Timing diagram for TP

Programmable Logic Control (PLC) Lab Page 3 of 10


INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING

2.2. TON (On-Delay)


Symbol

When the On-Delay timer (TON) receives an enable (logic 1) at its input (IN), a predetermined
amount of time (preset time - PT) passes before the timer bit (T-bit) turns on. The T-bit is a
logic function internal to the timer and is not shown on the symbol. The timer resets to the
starting time when the enabling input goes to logic 0.

Figure 2. Timing diagram for TON

2.3. TOF (Off-Delay)


Symbol

The Off-Delay timer is used to delay an output off for a fixed period of time after the input
turns off. When the enabling bit turns on the timer bit turns on immediately and the value is set
to 0. When the input turns off, the timer counts until the preset time has elapsed before the
timer bit turns off.

Programmable Logic Control (PLC) Lab Page 4 of 10


INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING

Figure 3. Timing diagram for TOF

2.4. TONR- Retentive On-Delay


Symbol

The Retentive On-Delay timer (TONR) functions in a similar manner to the On-Delay timer
(TON). There is one difference. The Retentive On-Delay timer times as long as the enabling
input is on, but does not reset when the input goes off. This timer must be reset with a RESET
(R) instruction.

Figure 4. Timing diagram for TONR

Programmable Logic Control (PLC) Lab Page 5 of 10


INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING

2.5. Time functions comparisons

Time functions Effects in changing parameters PT and IN

TP  Change at either PT or IN does not affect the operation of this timer


 Change at PT does not affect the operation of this timer

TON  Change at IN to “FALSE” while functioning will reset and stop the
timer
 Change at PT does not affect the operation of this timer

TOF  Change at IN to “TRUE” while functioning will reset and stop the
timer
 Change at PT does not affect the operation of this timer while
functioning but it does have effect when the timer is restored.

TONR  Change at IN to “FALSE” while functioning will stop but not resetting
the timer. Then, change at IN to “TRUE” will let the timer recalculate
the time value from the accumulated time value

III. EXERCISES (PRE-LAB)


Exercise 1. Write a PLC program to describe how the switch controls a light (LED) using
TON.
a) Known that,
 The light will turn on 15 seconds after the input switch is closed;
 If the switch were opened before 15 seconds had passed, then reclosed, the timer would
again begin timing at 0.
b) If the switch is considered to be NC. What happens?
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
Exercise 2. Write a PLC program to describe how the switch controls a light (LED) using
TONR.
Known that,
 When the switch is closed, the timer will begin timing at 10seconds;
 After 10 seconds, the switch is opened and the timer stops;

Programmable Logic Control (PLC) Lab Page 6 of 10


INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING

 The light will turn on 5 seconds after the switch has been closed the second time;
 Reset R can be added to reset the timer. If after 10 seconds the switch has been opened,
the timer can be reset by momentarily triggering this reset. As a result, the timer will be
reset to 0 and begin timing from 0 when the switch is closed again.

IV. EXPERIMENTS - USING TIMER


Experiment 1. Garage Light
Write a PLC algorithm to show the operation of a garage light which is put in front of the
garage. Known that, this light does not turn off immediately when pressing the button; it keeps
illuminations about 1 mins for the guests.

Experiment 2. Pouring liquid from container


Write a PLC algorithm to show the process of pouring liquid from container. The process is
shown in the following figure and is described as follows.
 When pressing the button S1, an empty box leaves from a box storage and it is put on a
conveyor belt. A solenoid Y2 acts as a sensor to detect whether the empty box is in its
correct position on the conveyor belt or not.
 When this box is detected by a sensor S2, the belt stops. Valve Y1 is then opened to let
liquid pouring from a liquid tank into the box. This process happens around 5s to fill up
the box. When the valve Y1 is closed, another empty box is selected from the box
storage and put on the conveyor belt. This new box will follow the same procedure as
the previous box.
 The whole procedure keeps repeating until the liquid tank is empty which is known
when a buzzer H1 with frequency 1Hz activates. Besides, if the box storage is out of
stock, the conveyor belt will be stopped automatically after 15s since the last box has
been filled up.

Figure 5

Programmable Logic Control (PLC) Lab Page 7 of 10


INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING

Experiment 3. Packaging process


Write a PLC algorithm to show the process of packaging. The process is shown in the
following figure and described as follows.
 The conveyor belt will carry the product to the position of packaging
 For normal process, the sensor SE2 which is used to count the number of products is
triggered when there is a product passing by. When reaching 8 products, the belt stops
for packaging. After 5 seconds, the system runs again.
 For emergency, press STOP to cancel the current work.

Figure 6

Experiment 4. Reverse direction under time control


Consider a 3-phase generator which can reverse the direction of rotation. This generator works
as follows
 When pressing the “right rotation” button, S1, the generator has right rotation, which is
indicated by a light H1 (ON).
 When pressing the “left rotation” button, S2, the generator has left rotation, which is
indicated by a light H2 (ON).
 The generator can stop at any time if pressing button S3 or by the activation of a
protective device Q1 (due to an overload happening with the generator). When the
machine stops, a light H0 is ON.
 The reverse can not be performed if the button S3 has been pressed and the machine has
to wait 5s to be stopped completely.
 The light H3 with frequency 1Hz is used to indicate the waiting time for the machine to
be stopped completely.
Write a PLC program to describe the operation of the considering generator.

Programmable Logic Control (PLC) Lab Page 8 of 10


INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING

Experiment 5. Time function control for 3 conveyor belts


Consider a system which involves 3 conveyor belts. This system works as follows:
 Press START, the first conveyor belt runs. After 3 seconds, the second conveyor belt
automatically runs. Then, for the next 3 seconds, the third conveyor belt will
automatically run.
 There are lights (LED) corresponding to each conveyor belt. When these belts run, the
lights are ON.
 Press STOP, the first conveyor belt stops. After 5 seconds, the second conveyor belt
will automatically stop. Then, for the next 5 seconds, the third conveyor belt will
automatically stop.
Write a PLC program to describe the operation of the system above.

Experiment 6. 3 Motors
Consider the following 3 motors: Oil Motor, Auxiliary Motor, and Main Motor. Known that,
the 3 Motors run sequentially with delay. In particular,
 Oil motor is started immediately when START is pressed.
 The Main motor will be started after a 10 seconds delay and then the Auxiliary Motor
after a 5 seconds delay.
 Stopping all motors immediately when STOP is pressed.

Figure 7
Write a PLC program to describe the operation of the 3 motors.

Programmable Logic Control (PLC) Lab Page 9 of 10


INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING

Experiment 7. Mixing liquid


Consider the following process of infusing liquid
 When START button (X0) is pressed, the first valve Y0 will be opened for infusing
liquid A to flow through until the level reaches the low-level float Sensor 2 (X1).
 When the level reaches the low-level float Sensor 2 (X1), the second valve Y1 will be
opened for infusing liquid B to flow through until the level reaches the high-level float
Sensor 1 (X2).
 When the level reaches the high-level float Sensor 1 (X2). Motor (Y3) will be ON and
activates the agitator attached to the motor. Also, timer T0 will start to count for 60
seconds. After 60 seconds, T0 will be ON, and the agitator motor Y3 will stop working.
The third valve Y2 will be opened to let the mixture drain out of the container.
 When the third valve Y2 is opened, timer T1 will start to count for 120 sec. After 120
seconds, T1 will be ON and Y2 will be closed leading to the draining process to be
stopped.
 When an error occurs, press EMERGENCY STOP button (X10). This button will
disable all the outputs and the system will then stop running.
The above description shows the automatically process of infusing the container with liquids A
and B when START button is pressed. Write a PLC program to describe the operation of this
process.

Figure 8

Programmable Logic Control (PLC) Lab Page 10 of 10

You might also like