beautypg.com

Rockwell Automation 1771-IJ_IK IK ENCODER/COUNTER MODULES User Manual

Page 58

background image

7–4

Special Programming

Publication 1771ĆUM006B-EN-P - June 2002

Rung Descriptions (Figure 7.2)
Rung 0 – This rung strips the upper byte of the count value and
stores the value.

A = BTR status
B = Mask
R = Temporary count storage with upper byte
removed

A = Temporary count storage with upper byte
removed
R = New count value

Rung 1 – This rung subtracts the old count value from the new value
and stores the difference with its sign.

A = New count value
B = Old count value
R = Difference of new count value less old value

Rung 2 – This rung looks at the sign and magnitude of the difference
from rung 1 and compares it with a constant (a constant less than
999/2 or 4095/2). If positive, the up counter is incremented by one;
if negative, the down counter is decremented by one.

Rung 3 – This rung moves the new count value (A) to the old count
storage location (R).

A = New count value
R – Old value storage location