You are on page 1of 21

The Islamic University of Gaza

Electrical Engineering Department


PLC Lab (EELE 5161)

Lab 4: Timers & Counters


By: Eng. Malak Ehab Al-Ashi

14/10/2020
Introduction

• In this lab we will learn about counters and timers and add some of our
previous ladder programming skills in to the mix.
• Timers and counters are used for the continuous operation in the PLC.
Timers times up to the value set by the user and counter counts up to the
value set by the user.
• Starting with basic delta plc programming and CNT (counters).
Counters
• Counters can be used to do various things, such as count batches,
movements in a process or cycle, production numbers, or even keep track of
which step in the process we are at.
• Let’s start with a basic counter example just to get you into the swing of
things.
Example 1

Counters
Enable Condition

No. of Counter

Set value

N.O. Contact
Design Example:
• Control Purpose:
Once the photoelectric sensor detects 10 products, the
robotic arm will begin to pack up.
When the action is completed, the robotic arm and the
counter will be reset.
• Devices:
Control program
Program Description:

• Once the photoelectric sensor detects a product, X0 will go from OFF to ON


once, and C0 will count for one time.
• When the present value in C0 reaches 10, the Normally Open contact C0 will
be closed.Y0 = ON, and the robotic arm will begin to pack.
• When the packing is completed, the robotic arm action completed sensor
will be enabled. X1 will go from OFF to ON and RST instruction will be
executed.Y0 and C0 will be reset for the next packing task.
Timers
• To use a TMR we need to know a few things.
• First of all at what rate the timer runs. In delta plc’s the timer generally runs
at 100ms. Here below is a table of the different timers you can use in your
delta plc programs.
Timers

• So if you want to have your timer run at 100ms intervals you need to choose
a timer between T0 – T63. If you are looking to run a timer which has 10ms
intervals you need to use T64 – T126.
• For 1ms intervals you only have the one timer which runs on T127.
• For the 10ms interval you also need to energize memory register M1028.
Creating the always on in run mode

M1000 is a special memory


register which is always
energized while your plc is in
the run mode.
Timers

• Let’s do one more example just to make sure that you fully grasp counters
and let’s revise some previous functions we have done.
• Let’s create a ladder diagram which when X0 is pressed we turn on a timer
which runs for 3 seconds.
• When the 3 seconds are up we need to increase the counter by one. When
the counter reaches 3 counts we energize Y0.
Example 2
Summary of what we doing here
• So let’s just quickly back up what are we doing here. We are resetting T0 so
that we can wait again to turn Y0 on again. Then we reset T1 so that when T0
runs out we can start our count from 0 again.
• We reset Y0 because we now want it to be off. So run your program in
simulation mode. You should now have Y0 off for 5 seconds, on for 3 seconds
and then off again etc in a infinite loop.
• This is often useful in applications where you need to open a solenoid or
expose a substance to UV light for x amount of time. Timers have a many
uses and are extremely common in plc programming applications so
become comfortable with them.
On
Delay

Timers

Cyclic OFF
Timer Delay
On Delay
• This case enables the indicator to be ON after a specific time delay and off
immediately by the switch like the first example.

X1
5sec
T0

Y1
OFF Delay
• This case enables the indicator to be ON immediately and OFF after a
specific time delay by the switch.
5sec
X1

T0

Y1
OFF Delay
HW4
• Explain devices, control program and program description for the following
design problems:
• Q1: Design a 24-hour Clock Operated by 3 Counters.
• Hint: Use 3 counters together with the flag of M1013 (1s clock pulse) to
operate a 24-hour clock.
HW4

• Q2: Design a Sequential Delay Output (Starting 3 Motors Sequentially).


HW4

• Control Purpose:
Starting the oil pump motor immediately when START is pressed. The main
motor will be started after a 10 sec delay and then the auxiliary motor after a 5
sec delay. In addition, stopping all motors immediately when STOP is pressed.
• Draw the timing diagram for all inputs and outputs in this question.
Instructions

Note:
• Font: Times new Roman, Size: 14-18 for titles and 12 for texts.
• Convert the word to PDF ( word files will not be accepted).
• Report name: EELE5161_220150622_Lab004

• Deadline: 22/10/2020 at 11:59 PM

You might also like