0% found this document useful (0 votes)
64 views13 pages

Lab 6

The document describes a lab experiment on counters. The objective was to understand counters and their applications in industrial automation. Counters keep track of how many times an event occurs. They can count up or down and are used to control processes. Exercises demonstrated using counters to turn on a light after 10 button presses, control a motor with two switches, flash a light for 5 seconds when a button is pressed 5 times, and fill boxes on a conveyor belt. The lab showed how counters are versatile and useful for tracking production and controlling time-based automation processes.
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)
64 views13 pages

Lab 6

The document describes a lab experiment on counters. The objective was to understand counters and their applications in industrial automation. Counters keep track of how many times an event occurs. They can count up or down and are used to control processes. Exercises demonstrated using counters to turn on a light after 10 button presses, control a motor with two switches, flash a light for 5 seconds when a button is pressed 5 times, and fill boxes on a conveyor belt. The lab showed how counters are versatile and useful for tracking production and controlling time-based automation processes.
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/ 13

Department of Mechatronics and Biomedical Engineering

MT-451 Manufacturing Automation lab

Lab No: 06

Roll No. 191057

Name Abdul Hannan

Semester VIII

Section A

Submitted To Engr. Ali Mukhtar

Date 22 – 04 – 2023
Lab # 6 Counters

Objective:
 Understanding the concept of counters.
 Understanding the applications of countersin industrial automation.
 Designing and implementing a control system that uses counter function to control a
process or machine.

Introduction:

Counters:

In automation, counters are a type of variable that is used to keep track of the number of
times a particular event has occurred. They are commonly used to count the number of
cycles, operations, or events that occur during a process.

Some important bits for counters are as follows:

Count Up (CU) Bit: The Count Up enable bit indicates the CTU instruction is enabled. The
data type used is Boolean indicated as BOOL.

Count Down (CD) Bit: The Count Down enable bit indicates the CTD instruction is enabled.

Done (DN) Bit: The done bit changes state whenever the accumulated value reaches the
preset value. The data type used is Boolean indicated as BOOL.

Overflow (OV) Bit: The overflow bit indicates the counter exceeded the upper limit of 2,
147, 483, 647. The counter then roles over to -2, 147, 483, 648 and begins counting up again.
The data type used is Boolean indicated as BOOL.

Underflow (UN) Bit: The underflow bit indicates that the counter exceeded the lower limit
of -2, 147, 483, 647. The counter then roles over to 2, 147, 483, 647 and begins counting
down again. The data type used is Boolean indicated as BOOL.

Preset (PRE) Bit: It specifies the value which the accumulated value must reach before the
instruction sets the done bit. The data type used is Double integer indicated as DINT.

Accumulator (ACC) Bit:It specifies the number of transitions the instruction has counted.
The timing diagram illustrates the functioning of all the bits in sequence.
Types of Counters:

Counters can be either incrementing or decrementing. Incrementing counters increase in


value each time the event occurs, while decrementing counters decrease in value each time
the event occurs. Counters are often used in conjunction with timers to control the duration of
an operation or to determine when a certain number of events have occurred.

Count Up
A count up counter is one that increments its count value by 1 each time it receives a clock
pulse. For example, if the initial count value is zero and the
counter receives a clock pulse, the count value will become 1.
With each subsequent clock pulse, the count value will
increase by 1, such as 2, 3, 4, and so on.

Count Down
A count down counter, on the other hand, decrements its count value by 1 each time it
receives a clock pulse. For example, if the initial count value is
10 and the counter receives a clock pulse, the count value will
become 9. With each subsequent clock pulse, the count value
will decrease by 1, such as 8, 7, 6, and so on.

Timing diagram for count up:

When the rung condition changes from low to high, the accumulator value increases by 1.
When the accumulated value becomes equal to preset, the done bit of the counter turns on.

Timing diagram for countdown:


When the rung condition changes from low to high, the accumulator value decreases by 1.
When the accumulated value becomes equal to zero, the done bit of the counter turns on.

Applications of counters:

 Industrial automation: Counters are commonly used in industrial automation to track


the number of products manufactured, parts processed, or errors detected during
production. This information can be used to optimize processes and improve efficiency.
 Traffic control: Counters are used in traffic control systems to monitor the number of
vehicles passing through an intersection or along a particular road. This information can
be used to adjust traffic signal timings and improve traffic flow.
 Retail: Counters are used in retail environments to track the number of customers
entering and leaving a store. This information can be used to optimize staffing levels and
improve customer service.
 Sports: Counters are used in many sports to keep track of points, laps, or other statistics.
This information can be used to determine winners, track performance, and provide
feedback to coaches and athletes.
 Scientific research: Counters are used in scientific research to track the number of times
a particular event occurs, such as the number of particles detected in an experiment or the
number of times a particular gene is expressed.
 Software automation: Counters are frequently used in software automation to count the
number of times a particular action or event occurs, such as the number of times a user
clicks on a button or the number of times a script executes a certain function. This
information can be used to optimize software performance and improve user experience.
Procedure:
The general procedure followed in the lab is as follows:

1. Make the truth table of the given function.


2. Using the equation, make the ladder diagram declaring the inputs and outputs.
3. Implement the ladder diagram in software.
4. Simulate and check the output for different inputs while verifying the truth table.
5. Upload the program to the hardware and check output for different inputs.
6. The procedure for creating ladder diagram in LogixPro is as follows
7. Open LogixPro and create a new project.
8. Create a new ladder diagram within the project. Add rungs and implement the logic in
each rung.
9. Test the ladder diagram using the simulation tools provided by LogixPro. Simulate input
signals and see the output response of the PLC based on the ladder diagram.
10. If necessary, make modifications to the ladder diagram until it functions correctly.

Tasks:
Exercise 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.

Ladder Diagram
Light on

Counter Reset:

Exercise 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).
Ladder Diagram:

Motor on:

Stop button presses:


Exercise 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

Ladder Diagram:
Light flashing:

A pressed 5 times:
Exercise 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.
Ladder Diagram:

Start button pressed:

System Reset:
Conveyor on:

Stop switch pressed:


Conclusion:

This lab covered the significance of counters in automation systems, which are used to keep
track of the number of events that occur. Count up and count down counters were explored,
and several exercises were completed to demonstrate their applications. The exercises
included controlling a light to turn on after a switch was pressed ten times, controlling a
motor with two switches and an indicator light, flashing a light for a specific duration when a
button was pushed, and controlling the filling of boxes on a conveyor belt. These exercises
showed how counters can be used in various automation systems to perform different tasks,
from tracking production quantities to controlling time-based processes. Overall, this lab
demonstrated the versatility and usefulness of counters in automation systems.

You might also like