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

Page 259

Advertising
background image

Chapter 14
Using High-Speed Counter Instructions

14–9

Using the Bidirectional Counter and the Bidirectional Counter with Reset
and Hold

Bidirectional counters are used when the parameter being measured can
either increment or decrement. For example, a package entering and leaving
a storage bin is counted to regulate flow through the area.

The Bidirectional Counters operate identically except for the operation of
inputs 1 and 0. For the Pulse and Direction type, input 0 provides the pulse
and input 1 provides the direction. For the Up and Down type, input 0
provides the Up count and input 1 provides the Down count. Both types are
available with and without reset and hold. Refer to page 14–5 for more
information regarding Bidirectional Counter types.

For the Bidirectional Counters, both high and low presets are used. The low
preset value must be less than the high preset value or an error (37H) occurs.
The hardware low preset default is –32,768.

Bidirectional Counters operate in the –32,768 to

+

32,767 range inclusive and

can be reset to zero using the Reset (RES) instruction.

Operation

When the HSC instruction is first executed true, the:

Instruction accumulator is loaded to the hardware accumulator.

Instruction high preset is loaded to the hardware high preset.

After the first true HSC instruction execution, data can only be transferred to
the hardware accumulator via the RES or RAC instruction or to the hardware
high and low presets via the HSL instruction.

Any instruction accumulator value between –32,768 and

+

32,767 inclusive

can be loaded to the hardware.

The Following Condition

Occurs when

either the hardware accumulator transitions from the
hardware high preset –1 to the hardware high preset, or

A high preset is reached

the hardware accumulator is loaded with a value greater
than or equal to the hardware high preset, or

the hardware high preset is loaded with a value that is less
than or equal to the hardware accumulator.

Advertising