Lab 9 Counter
Lab 9 Counter
ACIM 5010
LAB 9 Page 1 of 9
Name: _______________________________ Date: ______________________________
LAB 9 Page 2 of 9
Lab 9 – PLC Counters
Objectives
Test a program for a Compactlogix PLC (=CTU) UP counter.
References
Documentation: The RS Studio 5000 software has information about the controller and its
installed modules.
Equipment
Compactlogix PLC lab workstation panel. Refer to figure 1 on page 3 and the figure 2 on
page 4.
Banana jumpers
Fluke digital multimeter
USB flash drive
Safety
Eye protection is required when working with power circuits energized at more than 30 volts.
Identify the emergency stop buttons located near the entrance to lab SE1-116.
Before making jumper connections and at the end of this lab session, turn off all power sources
connected to the Compactlogix PLC.
Be aware that in future labs there may be more than one live source that will have to be turned
on for the lab to work and to be turned off to make the test area safe.
Substantial footwear is required in the lab area.
Refer to Figure 1 to review the arrangement for the PLC workstation console.
At programming time, a counter is given a Preset value. The Preset value is how far you want
the counter to count before it ‘counts out’. A counter ‘counts out’ when the counter
Accumulator value has reached the Preset value. When counting is ‘DoNe’, the (DN) counter
output coil becomes true.
LAB 9 Page 3 of 9
The counter (DN) coil is examined by examine type instructions that have been given the
address of the counter DN bit to control an event that must be initiated after a preset number
of counts.
An up counter in Allen-Bradley PLC's is abbreviated as CTU. A counter is not given an explicit
address since it is internal to the PLC. Instead, a CTU counter instruction is simply given a tag
with no corresponding base tag.
To reset a counter, a reset instruction must be used. Reset is abbreviated RES in Allen-Bradley
PLC's. After a reset, the counter Accumulator value returns to 0 (zero).
Counters are retentive, i.e., they retain their current accumulated count even if the PLC CPU
power is lost. This is essential where a production tally is being kept or the progress of a multi-
step process is being tracked.
Example: This control system moves boxes under a heater on a slow-moving conveyor. Storage
space on the outfeed (downstream) end of the dryer conveyor limits the number of boxes that
can be stored there to six.
DRYER BEACON
PHOTO-EYE
CONVEYOR
The PLC program is shown on the next page and the wiring diagram BOX
CONVEYOR
for STORAGE
the system is on page 5.
The operation as follows:
1. Stop and Start pushbuttons control the dryer conveyor which starts first; and then the
infeed conveyor starts via interlocking to the the dryer conveyor.
2. The photo-eye is wired to a PLC input that is OFF when NO object is sensed.
The purpose of the photo-eye is to stop both conveyors once the sixth box has passed the
photo-eye.
A beacon alerts a roving production worker that the boxes must be removed from the idler
rollers box storage conveyor. The production worker restarts the conveyor once the boxes
have been manually removed.
LAB 9 Page 4 of 9
LAB 9 Page 5 of 9
LAB 9 Page 6 of 9
LAB 9 Page 7 of 9
Procedure – Acquire and test a program for a PLC UP (=CTU) counter
2. Make the connections according to the diagram in Figure 2. Use a N.O. limit switch contact
for the Photo-eye.
3. Acquire the RS Studio 5000 program called ACIM_5010_Lab_9.ACD from the J:\
7. Download the program and put the processor into RUN mode.
8. Test the program functionality, as follows:
FUNCTIONALITY TO BE TESTED √
#
a Pressing the Jog Reverse pushbutton causes the Dryer Conveyor to run in reverse.
b The initial counter ACCumulator value is 0 & the initial Preset value is 6.
The Forward pushbutton runs both conveyors in the forward direction and the Forward
c
Light comes on.
The 6th time the Photo-eye is blocked the Beacon comes on but the conveyors continue
e
to run until the box is past the photo-eye.
f The conveyors cannot be restarted in the forward direction until the Stop button has
been pressed.
g Pressing the Stop button resets the counter only when the outfeed is full.
LAB 9 Page 8 of 9
normally. You investigate and find that the program has a flaw in it.
The problem with the program is as follows: if the stop button is pressed to stop the system
while the 6th box is blocking the photo-eye, the conveyor will stop but the counter will
increment to 1 immediately after it has been reset by the stop button.
1. Save the original program under three new names and make each proposed change and
test it.
C. Delete the photo-eye instruction in rung 0 and change the photo-eye instruction in
rung 3 to examine if off.
Shut down the computer and remove all the jumpers if nearing the end of this lab session.
LAB 9 Page 9 of 9
1. √
2. √
3. √
4. √
5. √
6. √
7. √
8. √√√√√√√
9. √√√
A and B both work.
10. √
11. √
LAB 9 Page 10 of 9