290 Programmable Logic Controllers: Hardware and Programming
Example 13-7
The diagram in Figure 13-17 demonstrates how to use a timer on
delay (TON) function and a bit shift right (BSR) function to turn on and off
lights in descending order every two seconds. The timer on delay controls
the bit shift right function, which moves a bit through 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 descending 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 begin-
ning location B3:0/7.
End
005
R6:0/UL
Reset will bring the data file #B3:0 to its original setting.
**Close input I:1/2 to re-enter the lost bit that comes out of the right
side (R6:0/UL). Therefore, creating Rotate Right.
003
I:1/2
Rotate Mode
Reset
B3:0/7
Rotate Entry Location
004
I:1/3 R6:0
RES
Figure 13-16. Continued.
Previous Page Next Page