Chapter 13 PLC Logic and Bit Shift Instructions 283
Bit shift right
(BSR) instruction:
Instruction that shifts the
bits in the data file to the
right once for every low-
to-high transition on its
input.
the bit shift left (BSL) instruction rotates this high bit through B3/0,
B3/1, and B3/2 in order to turn on the white pilot light (White_PLT),
red pilot light (Red_PLT), and then again the green pilot light (Green_
PLT) every 3 seconds. Figure 13-10 displays the bit data file B3:0.
When the PLC starts operating, the green pilot light (Green_PLT)
turns on. Closing the switch in rung 0000 starts the timer. After three
seconds, the timer done status coil (T4:0/DN) energizes. Then, the
normally closed contact in rung 0000 (T4:0/DN) opens and the nor-
mally open contact in rung 0001 (T4:0/DN) closes.
When the normally closed contact in rung 0000 opens, the non-
retentive timer ON-delay zero (T4:0) resets the content of its accumulated
register to zero (T4:0.ACC = 0). When the normally open contact in rung
0001 closes, the BSL instruction shifts the bit in B3/0 to the left.
Now the B3/1 bit is high. Therefore, the white pilot light
(White_PLT) turns on.
Notice that the non-retentive timer ON-delay (T4:0) resets when
normally closed contact (T4:0/DN) opens. After another three sec-
onds, the timer done coil (T4:0/DN) energizes again. Then, the BSL
instruction shifts the bits to the left once more. Now, the red pilot light
(Red_PLT) turns on and the white pilot light (White_PLT) turns off.
Consequently, each of the pilot lights (O:2/0, O:2/1, and O:2/2)
turns on in sequence for three seconds. After four bits shift left, the
normally open contact (R6:0/DN) closes and resets the BSL instruc-
tion. Now, the green pilot light (O:0/0) turns on. The process continues
until the switch in rung 0000 is opened to stop the timer instruction.
Closing the normally open pushbutton in rung 0005 can also reset the
BSL instruction.
13.4 Shift Right Instruction
Operation of the bit shift right instruction is similar to the opera-
tion of the bit shift left instruction. When a bit shift right (BSR)
instruction is energized, it shifts a bit to the right for every program
Figure 13-10. Bit data word B3:0 is used in the
bit shift left instruction.