0% found this document useful (0 votes)
16 views3 pages

EMI Lab#6

Uploaded by

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

EMI Lab#6

Uploaded by

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

Instrumentation & Measurement Lab Air University Islamabad

Lab#6
Counters

Objective
To understand the operation of Counters and simulate the given tasks in Allen Bradley PLC.

Introduction
In this section we will cover the count up count down and reset instruction. Counters are very
essential in ladder logic programming. Counters are used to index, increment or decrement values.
Definition

The following is a list of counter instructions:


 CTU - Count Up
 CTD - Count Down
 RES - Reset

CTU Count UP
Symbol

Definition
 Increments the accumulated value at each false to true transition and retains the accumulated
value when the instruction goes false or when power cycle occurs.
 The CTU is an instruction that counts false to true transition. When this transition happens the
accumulated value is incremented by one count.
 A CTU accumulation is reset by the RES instruction.
 If the accumulation value is over the maximum range then the overflow (OV) bit will be true.

Each counter address is made of a 3-word element.


Word 1 is the control word
 Bit 0-7: Internal Use
 Bit 10: UA - Update accumulation value.
 Bit 11: UN - Underflow bit.
 Bit 12: OV - Overflow bit.
 Bit 13: DN - Done
 Bit 14: CD - Count down is enabled.
 Bit 15: CU - Count up is enabled.
Word 2 stores the preset value. (PRE)
 Specifies the value, which the counter must reach before the controller sets the done bit.
When the accumulator value becomes equal to or greater than the preset value, the done status
bit is set. You can use this bit to control an output device.

Page 1
Instrumentation & Measurement Lab Air University Islamabad

 Preset value is from -32,768 to 32,767


 If a timer-preset value is negative an error will occur.
Word 3 stores the accumulated value. (ACC)
 This is the number of times of false to true transitions that have occurred since the counter
was last rest.

CTD Count Down


Symbol

Definition
 Decrements the accumulate value at each false to true transition and retains the accumulated
value when the instruction goes false or when power cycle occurs.
 The CTD is an instruction that counts false to true transition. When this transition happen the
accumulated value is decrements by one count.
 A CTD accumulation is reset by the RES instruction.
 If the accumulation value is below the minimum range then the underflow (UN) bit will be
true.

· Each counter address is made of a 3-word element.


Word 1 is the control word
 Bit 0-7: Internal Use
 Bit 10: UA - Update accumulation value.
 Bit 11: UN - Underflow bit.
 Bit 12: OV - Overflow bit.
 Bit 13: DN - Done
 Bit 14: CD - Count down is enabled.
 Bit 15: CU - Count up is enabled.
Word 2 stores the preset value. (PRE)
 Specifies the value, which the counter must reach before the controller sets the done bit.
When the accumulator value becomes equal to or greater than the preset value, the done status
bit is set. You can use this bit to control an output device.
 Preset value is from -32,768 to 32,767
 If a timer-preset value is negative an error will occur.
· Word 3 stores the accumulated value. (ACC)

RES Reset
Symbol

Definition
 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.

Page 2
Instrumentation & Measurement Lab Air University Islamabad

LAB 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.

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 start/stop switches are supposed
to be push buttons.

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

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.

Page 3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy