You are on page 1of 11

AIR UNIVERSITY

DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING

EXPERIMENT NO 6

Lab Title: COUNTERS

Student Name: Izza Jamal Reg. No: 191850


LAB ASSESSMENT:

Excellent Good Average Satisfactory Unsatisfactory


Attributes
(5) (4) (3) (2) (1)
Ability to Conduct
Experiment
Ability to assimilate the
results
Effective use of lab
equipment and follows
the lab safety rules

Total Marks: Obtained Marks:

LAB REPORT ASSESSMENT:


Excellent Good Average Satisfactory Unsatisfactory
Attributes
(5) (4) (3) (2) (1)

Data presentation

Experimental results

Conclusion

Total Marks: Obtained Marks:

Date: Signature:
AIR UNIVERSITY, ISLAMABAD
DEPARTMENT OF ELECTRICAL & COMPUTER ENGINEERING
Electrical Measurements & Instruments Lab

Lab Instructor: Wasim Iqbal

COUNTERS Lab#06

Submitted by
Izza Jamal (191850)

Fall-21

BEEP V-B
DATE:22/11/21
EXPERIMENT.NO.06
COUNTERS
Objective:
 To get familiar with the concept of Counters.
 Get to know about the implementation of counters on the software.

Apparatus:
 PLC Allen Bradley.
 LogixPro software.

Introduction:
A PLC counter is a function block that counts up or down until it reaches a limit. When the limit
is reached the output is set. The thing is that counting is in fact widely used in PLC
programming. Often you will have the need to counts different things. An example of this could
be to keep track of how many times a process has been completed. Or how many products has
been produced. PLC counters are also used to assist logging to SCADA systems by counting the
amount of times these events has happened or setting alarms when an event has happened a
certain amount of times.
Up Counter (CTU):

The first counter instruction I will introduce you to is the up counter, also known as just CTU. As
the name implies, this PLC counter is used for counting up.The way is works is that it will set an
output, when is has counted a certain amount of times. To be a little more specific this is how it
works.

How it works:

Each pulse on the count input (CU) will increase the current counter value (CV) by 1. When CV
is greater than or equal to the counter limit (PV) the output (Q) is set. A pulse on the reset input
(R) will reset the value of CV to 0.

Example:

Up counters are usually used to keep track of how many times an event has happened. Let’s say
you want a process to complete 10 times before cleaning needs to happen.
Down Counter (CTD):

Counting down is another operation that is widely used in PLC programming. In some cases you
want to know how many counts are remaining before the limit is reached. With the up counter
you can use some math to do it. But you can do it easily with a down counter.Because with the
down counter you will count down from a certain number until it reaches 0.

How it works:
Each pulse on the count input (CD) will decrement current counter value (CV) by 1. When CV is
less than or equal to 0 the output (Q) is set. A pulse on the load input (LD) will assign the value
of counter limit (PV) to CV.

Example:

Imagine you have a semi-automatic process where the operator needs to do a manual task to start
a process. The process need to be completed 10 times but when there is 2 times left the operator
needs to inspect. It is important that the operator can see how many processes are left, since the
total amount of processes can vary.This is where the down counter comes in handy. What you
need to do here is to assign the total amount of process times to the counter limit (PV) and then
give at pulse at the load input (LD). Now you have to total amount as the current counter value
(CV).
RES (Reset):

 Resets the accumulated value and status bit of a timer or counter.

 Use a RES instruction to reset timers or counters. When the RES instruction is enabled, it
resets the Timer On Delay, Retentive Timer, and Counter Up, Counter Down instruction having
the same address as the RES instruction.

LAB TASKS:

Lab Task 1:

Let us consider a system in which we have a switch to turn on a light when the switch is pressed
10 times the light should energize. We should also have a reset button.

In this task we were supposed to turn on the light after pressing the switch 10 times.For this
purpose we made a start button connected to a counter up whose preset =10 i.e it will count 10
times.After running for 10 times the DN pin of the counter will turn on the light.
Lab Task 2:

A motor will be controlled by two switches. The Go switch will start the motor and the Stop
switch will stop it. If the Stop switch was used to stop the motor, the Go switch must be thrown
twice to start the motor. When the motor is active a light should be turned on. The Stop switch
will be wired as normally closed (Active Low).

In this task we were supposed to turn on the light and motot simultaneously after pressing the
switch 10 times.For this purpose we made a start button connected to a counter up whose
preset =2 i.e it will count 2 times.After running for 2 times the DN pin of the counter will turn on
the light as well as the motor and the reset pin will reset the counter.
Lab Task 3:

Write a ladder logic program that does what is described below.

 When button A is pushed, a light will flash for 5 seconds.

 The flashing light will be on for 0.25 sec and off for 0.75 sec.

 If button A has been pushed 5 times the light will not flash until
the system is reset.

 The system can be reset by pressing button B

In this task,when button A will be pressed it will turn on the light for 5 seconds with blinking of
0.25 and 0.75 seconds.When the button A will be pressed 5 times we will reset the counter else
the system will not work.For resetting the counter button B will pressed.
Lab Task 4:

 Start the process when start is press.

 System can be stop at any time by pressing stop and remain continue working from its
previous state.

 Fill each box with five balls and start conveyor 2 for 5 sec.
When the start button is present the system begins to work.The sensor counts the 5 balls and then
starts the conveyor for 5 seconds . Meanwhile when the system is turned off at any instant it
starts from the previous state where it was stopped due to RTO.

Conclusions:

In this lab we learnt what are counters and how are these simulated on the software.We learnt
two types of counters CTU & CTD i.e up counter and down counter. These two counters are
used in many daily life applications for instance an embedded system on main door to count how
many people entered.Moreover we performed certain tasks in order to have better understanding
of counter simulation.

*--------------------------------*

You might also like