Rockwell Automation 1761-HHP-B30 MicroLogix 1000 with Hand-Held Programmer (HHP) User Manual

Page 282

Advertising
background image

Chapter 14
Using High-Speed Counter Instructions

14–32

File 2, Rung 2

Forces a high–speed counter low preset interrupt to occur each RRUN mode
entry. An interrupt can only occur on the transition of the high–speed
counter accum to a preset value (accum reset to 1, then 0). This is done
to allow the high–speed counter interrupt subroutine sequencers to
initialize. The order of high–speed counter initialization is: (1)load
high–speed counter parameters (2)execute HSL instruction (3)execute true
HSC instruction (4)(optional) force high–speed counter interrupt to
occur.

FUN GRAPHIC PARAMETER
CODE SYMBOL MNEMONIC NAME ADDRESS VALUE FORCES
–––– ––––––– –––––––– –––– ––––––– ––––– ––––––
20 |–] [– LD 1’st Pass

S1/15 0

132 RAC
High Speed Counter
CNTR C0
SRC 1

7 RES
High Speed Counter
C0

Rungs 2.0 and 2.2 are required to write several parameters to the high-speed
counter data file area. These two rungs are conditioned by the first pass bit
during one scan when the controller is going from RPRG to RRUN mode.

The high-speed counter is used to control the conveyer position. It counts
pulses supplied by the conveyer’s encoder via hardware inputs I/0 and I/1.
Hardware inputs I/2 (reset) and I/3 (hold) are connected to a photo-switch
ensuring the HSC instruction only counts encoder pulses when a manual is in
front of the drill and that the high-speed counter is reset at the leading edge
of each manual.

The high-speed counter clears the conveyer drive output bit (O/0) each time a
high preset is reached. As a result, the drive decelerates and stops the
conveyer motor. The high-speed counter clears the output within
microseconds ensuring accuracy and repeatability.

The high-speed counter sets the conveyer drive output bit (O/0) each time a
low preset is reached. As a result, the drive accelerates and maintains the
conveyer motor.

When the manual has travelled the specified distance set by the high-speed
counter high preset value, the high-speed counter interrupt subroutine signals
the main program to perform the drilling sequence. For more information
regarding the interrupt subroutine used in this program, refer to the
application example in chapter 13.

This example uses the Quadrature Encoder with reset and hold instruction.
The high-speed counter accumulator increments and decrements based on the
quadrature relationship of the encoder’s A and B inputs (I/0 and I/1). The
accumulator is cleared to zero when the reset is activated or when the RES
instruction is executed.

Advertising