Academic Session 2017/2018 (Semester 2)
PLT 307 – PROGRAMMABLE LOGIC CONTROLLER
EXPERIMENT 3
LADDER DIAGRAM TIMER AND COUNTER
NAME :…………………………………………………….
STUDENT ID :………………………………………………….....
PROGRAMME :………………………………………………….....
GROUP MEMBER :………………………………………………….....
MARKS:
DATA COLLECTION/ DISCUSSION/
INTRODUCTION TOTAL
ANALYSIS CONCLUSION
(4Marks) (153.1 Marks)
( Marks) (6Marks)
Lab tasks :
/ 40.1
Design Question:
/ 80
Lab Excercise:
/ 23
%
Programmable Logic Controller (PLT307/3) Laboratory Module
EXPERIMENT 3
LADDER DIAGRAM TIMER AND COUNTER
OBJECTIVES
1. To apply the basic concept of the self - holding circuit
2. To program PLC using basic logic instructions for AND LD and OR LD.
3. To recognize the applications of cascading timers.
4. To differentiate the usage of the timer and counter in Ladder Diagram.
INTRODUCTION
1.1 AND LD, OR LD and combination of AND LD and OR LD instruction.
Basic programming instruction: LD, A, O, NOT, =, END, A LD, OR LD
Instructions Description
A LD This is used to connect two blocks in serial
O LD This is used to connect two blocks in parallel
Figure 3.1 Ladder diagram with AND LOAD instruction
UNIVERSITI MALAYSIA PERLIS – Lab 3 2
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Figure 3.2 Ladder diagram with OR LOAD instruction
1.2 Self holding circuit/ seal-in circuit
Figure 3.3 Self Holding circuit
The self holding circuit enables the output to stay ON even though when the status of the
input which triggered it is already OFF. Self holding in Figure 3.3 has a function as SET-
RESET. For example, in Figure 3.3, the contact of output, lamp4 enables output lamp4 to
remain ON after the contact, Pb5 is turned OFF. Lamp4 is OFF when Pb6 is RESET.
UNIVERSITI MALAYSIA PERLIS – Lab 3 3
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
TIMER
A common approach is to consider timers to behave like relays with coils which when energised result in
the closure or opening of contacts after some preset time. The timer is thus treated as an output for a rung
with control being exercised over pairs of contacts. Figure 3.4. shows the timer to be a delay item in a rung,
rather than as a relay, the example being for Siemens. When the signal at the timer’s start input changes
from 0 to 1, the timer starts and runs for the programmed duration, giving its output then to the output coil
Figure 3.4 Timer Ladder Diagram
There are a number of different forms of timers that can be found with PLCs. With small PLCs there is
likely to be just one form, the on-delay timers. These are timers which come on after a particular time delay
(Figure 3.5(a)). Off-delay timers are on for a fixed period of time before turning off (Figure 3.5(b)).
Another type of timer that occurs is the pulse timer. This timer switches on or off for a fixed period of time
(Figure 3.5(c)) and the timer symbols as in Figure 3.6
Figure 3.5 Timers: a) On-delay b) Off-delay c) Pulse
Figure 3.6 Standard Symbols For Timers
UNIVERSITI MALAYSIA PERLIS – Lab 3 4
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
TIMER : PROGRAMMING EXAMPLE
Consider a program (Figure 3.7) that could be used to flash a light on and off as long as there is some
output occurring. Thus we might have both timer 0 and timer 1 set to 1 s. When the output occurs, then
timer 0 starts and switches on after 1 s. This closes the timer 0 contacts and starts timer 1. This switches on
after 1 s and, in doing so, switches off timer 0. In so doing, it switches off itself. The lamp is only on when
timer 0 is on and so we have a program to flash the lamp on and off as long as there is an output.
Figure 3.7 Standard Symbols For Timers
COUNTER
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. There
are two types of counter, though PLCs may not include both types. These are down-counters and up-
counters.
• Down-counters count down from the preset value to zero, i.e. events are subtracted from the set
value. When the counter reaches the zero value, its contacts change state. Most PLCs offer down
counting.
• Up-counters count from zero up to the preset value, i.e. events are added until the number reaches
the preset value. When the counter reaches the set value, its contacts change state.
Figure 3.8 Up and down counting with a Siemens PLC
UNIVERSITI MALAYSIA PERLIS – Lab 3 5
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Counters can be considered to consist of two basic elements: one relay coil to count input pulses and one to
reset the counter, the associated contacts of the counter being used in other rungs as in Figure 3.9.
Figure 3.9 CD is count down input, LD is for loading the input, PV is for the preset value, CV the current
count value, CU is count up input, and R is for the reset input.
Figure 3.10 shows a basic counting circuit. When there is a pulse input to In 1, the counter is reset. When
there is an input to In 2, the counter starts counting. If the counter is set for, say, 10 pulses, then when 10
pulse inputs have been received at In 2, the counter’s contacts will close and there will be an output from
Out 1. If at any time during the counting there is an input to In 1, the counter will be reset and start all over
again and count for 10 pulses.
Figure 3.10 Basic Counter Program
Figure 3.11 shows the program with a Siemens PLC. With this ladder program, the counter is considered to
be a delay element in the output line. The counter is reset by an input to I0.1 and counts the pulses into
input I0.0. The CU indicates that it is a count-up counter, a CD would indicate a count-down counter. The
counter set value is indicated by the LKC number.
Figure 3.11 Counter Ladder Diagram For Seimens
UNIVERSITI MALAYSIA PERLIS – Lab 3 6
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Name: _______________________________ Matrix No: ____________________
Date: ________________
LAB TASKS
By using STEP 7 Micro/WIN, program the PLC with the following Ladder Diagrams
then complete the instruction list table. Prove your program using hardware device.
1. (AND LD)
/3.3marks
Input Output
I0.1 I0.2 I0.3 I0.4 I0.5 I0.6 I0.7 Q0.1
ON ON OFF OFF OFF OFF OFF
ON ON ON ON OFF OFF OFF
ON ON ON ON ON ON ON
ON ON ON ON ON ON OFF
ON OFF OFF ON ON OFF ON
/0.5marks
UNIVERSITI MALAYSIA PERLIS – Lab 3 7
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Name: _______________________________ Matrix No: ____________________
Date: ________________
2. (OR LD)
/2.4marks
Input Output
I0.3 I0.2 I0.1 I0.6 I0.7 Q0.1
ON ON OFF OFF OFF
ON ON OFF OFF ON
OFF OFF ON ON ON
ON ON ON ON ON
OFF ON OFF ON ON
/2.4marks
UNIVERSITI MALAYSIA PERLIS – Lab 3 8
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Name: _______________________________ Matrix No: ____________________
Date: ________________
3. (TIMER)
By using the STEP7 software, prove the output from the timer ladder diagram then
fill in an instruction list table.
PT
T#6s
i. Simulate your program and describe the operation for this ladder diagram.
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
ii. Give the type of timer used in this operation and its time delay.
_________________________________________________________________
iii. Draw the timing diagram (with time delay, input and output condition) for this
operation.
iv. Construct a ladder diagram using on-delay timers to turn ‘off’ the motor
connected to output Q0.4, 10 seconds after it is triggered ‘on’ using a momentary
switch connected to input I0.3.
/16.5marks
UNIVERSITI MALAYSIA PERLIS – Lab 3 9
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Name: _______________________________ Matrix No: ____________________
Date: ________________
4. (COUNTER)
By using the STEP7 software, prove the output from the counter ladder diagram then
fill in an instruction list table.
i. Simulate your program and describe the operation for this ladder diagram.
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
_____________________________________________________________
ii. Draw the timing diagram (with accumulated value, input and output condition) for this
operation.
/15marks
UNIVERSITI MALAYSIA PERLIS – Lab 3 10
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Name: _______________________________ Matrix No: ____________________
Date: ________________
DESIGN QUESTION
1. PLC is used to control a compressor motor in an air-conditioning system. This is
possible by using two push button switches, one contact relay and one compressor
motor as shown in the picture below. The start push button switch indicated as S1
while S2 represented the stop push button switch. The contact relay and compressor
motor are indicated as R0 and M respectively.
Figure 3.6 Ladder diagram for controlling a compressor motor
The input and output assignments are shown in the following tables:
Input Device Output Device
I0.1 S1 Q0.1 R0
I0.2 S2 Q0.3 M
UNIVERSITI MALAYSIA PERLIS – Lab 3 11
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Create the ladder diagram and instruction list for the system in order to execute the
following sequence:
a) When the start push button switch pressed, the contact relay will energize and the
compressor motor will running although the start push button switch already
released.
b) The compressor motor will turn off after the stop push button switch pressed.
Simulate your answer using STEP7 Micro/WIN and prove it using hardware device.
Answer:
/10marks
UNIVERSITI MALAYSIA PERLIS – Lab 3 12
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Name: _______________________________ Matrix No: ____________________
Date: ________________
2. The control circuit is used to detect and count the number of product being carried on
an assembly line. When it counts five products, the circuit energizes a solenoid. The
solenoid is energized for a period of two second and is then shut off, causing it to
retract. Table below show the working operation and the input/output assignment.
INPUT DEVICE OUTPUT DEVICE OTHERS DEVICE
I0.1 sensor Q0.1 conveyer C0 Product counter
Q0.2 solenoid T0 Solenoid energized
timer
Answer:
/27marks
UNIVERSITI MALAYSIA PERLIS – Lab 3 13
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Name: _______________________________ Matrix No: ____________________
Date: ________________
3. ABCD Co., Ltd needs to install running light system for their new shop lot. The
system consists of 4 unit lights. When a switch is activated, the first light blink once
for 0.3 second, followed by light 2 and so forth. These sequences will continue for 5
rounds. Create the ladder diagram and mnemonic code for this system given the
input/output assignments are as follows:
Device Input Devices Output
assignment assignment
Light 1 Q0.1
Light 2 Q0.2
Switch I0.1
Light 3 Q0.3
Light 4 Q0.4
Create the ladder diagram and instruction list.
Answer:
/43marks
UNIVERSITI MALAYSIA PERLIS – Lab 3 14
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Name: _______________________________ Matrix No: ____________________
Date: ________________
LAB EXCERCISE
Answer all the question.
1. Analog signals are converted into a …………… format by PLC.
2. Three types of timers available in the S7-200 are On-Delay, ……………. On-Delay
and ………………. -Delay.
3. The maximum time available on a 100 milisecond time base timer is ……………….
seconds.
4. The count of 25 on a 10 milisecond time base timer represents a time of
……………… miliseconds.
5. There are ……….timers in S7-200.
6. Three types of counters used in S7-200 are …………………… , ………………….
and ………………….. .
7. Counter can count to a maximum of ………………….. .
8. Events that require an action from the PLC before the scan cycle is complete are
controlled by ……………………. instructions.
9. Depending on the counter, there are up to …………………. Modes available to
high-speed counters.
10. The …………….. is a position control module.
/20marks
UNIVERSITI MALAYSIA PERLIS – Lab 3 15
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Name: _______________________________ Matrix No: ____________________
Date: ________________
Figure 1
11. Figure 1 shows a Siemens program involving an up- and down-counter. Decide
whether each of these statements is True (T) or False (F).
When the count is less than 50:
(i) There is an output from Q2.0.
(ii) There is an output from Q2.1.
A (i) T (ii) T
B (i) T (ii) F
C (i) F (ii) T
D (i) F (ii) F
12. When the count reaches 50:
(i) There is an output from Q2.0.
(ii) There is an output from Q2.1.
A (i) T (ii) T B (i) T (ii) F
C (i) F (ii) T D (i) F (ii) F
UNIVERSITI MALAYSIA PERLIS – Lab 3 16
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Figure 2
13. Decide whether each of these statements is True (T) or False (F).
Figure 2 shows a counter program in Siemens format. After 10 inputs to I0.0:
(i) The lamp comes on
(ii)The motor starts.
A (i) T (ii) T
B (i) T (ii) F
C (i) F (ii) T
D (i) F (ii) F
/3marks
UNIVERSITI MALAYSIA PERLIS – Lab 3 17
Prepared by Ilham Shafini & Mohd Azri -version 1
Programmable Logic Controller (PLT307/3) Laboratory Module
Name: _______________________________ Matrix No: ____________________
Date: ________________
Discussion
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
_______________________________________________________________________
Conclusion
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
UNIVERSITI MALAYSIA PERLIS – Lab 3 18
Prepared by Ilham Shafini & Mohd Azri -version 1