Programming instructions
94
WSFL – Word Shift Left
WSFR – Word Shift Right
The Word Shift Left and Word Shift Right commands will move a word (or
multiple words) of data in the same way as shown above for the bit shift
instructions. The command takes the same 4 parameters. The first parameter
is the location of the data to be shifted into the register(s). The second
parameter is the first address of the shift data. The third parameter is length of
the shift data. The fourth parameter is the number of words left or right to shift
the data.
13.17 EXERCISE Bit Shift Register
Write a bit shift register to move bits across the 8 outputs on the PLC. Use the
discrete I/O simulator screen for this exercise. Use X10 to trigger a shift of one
bit into the shift register. Use X11 as the source bit to shift in.
The end result should be that when X11 is on and X10 is pressed, an on bit
should be shifted into the register. If X11 is off when X10 is pressed, an off bit
should be shifted into the register. Y0 thru Y7 are your output bits. Use a shift
left or shift right command.