Chapter 13 PLC Logic and Bit Shift Instructions 289
the positions of B3:0. Lights connected to the outputs at addresses
O:2/0, O:2/1, and O:2/2 illuminate when a bit is rotated into their
corresponding binary position: B3:0/0, B3:0/1, and B3:0/2. Lights first
turn on and then off in ascending order. This process continues until
the start switch at address I:1/0 is opened. The reset pushbutton at
address I:1/1 is used to reset the control register R6:0 and set the bit
pointer to the beginning location B3:0/0.
Example 13-6
The diagram in Figure 13-16 shows the programming for a rotat-
ing bit shift right function. Pressing the pushbutton at address I:1/0
shifts the bits in file #B3 to the right once. Closing the switch at address
I:1/1 will generate pulses with a one-second duty cycle that will auto-
matically shift the bits in file #B3 to the right once every one-second
time interval. Closing the switch at address I:1/2 re-enters the unload
bit (R6:0/UL) to the beginning bit address in file #B3. This unloading
and moving of the bit creates a rotate bit right function. The re-entry
process of file #B3 is displayed in the binary table in Figure 13-16.
Pressing the pushbutton at address I:1/3 resets the control register
R6:0 and sets the bit pointer to the beginning location B3:0/7.
Bit Shift Right (BSR); Bits are shifted to the right starting from B3:0/7 to B3:0/0.
000
I:1/0
T4:0/DN
Manual Mode Pushbutton
EN
DN
BSR
Bit Shift Left
File #B3:0
Control R6:0
Bit Address B3:0/7
Length 6
Close input I:1/1 to create and automatic BSR.
001
I:1/1
Auto-Shift Mode
T4:0/DN
EN
DN
TON
Timer On Delay
Timer T4:0
Time Base 0:1
Preset 10
Accum 9
The bit on the far right-hand side (B3:0/0) controls the light (O:2/0).
002
B3:0/0 O:2/0
G-LT
Figure 13-16. PLC ladder logic diagram and binary table for Example 13-6. Programming the bit
shift right (BSR) function in the LogixPro simulator.
(Continued)