How to Use the Shift and Rotate Instructions in PLC Programming

How to Use the Shift and Rotate Instructions in PLC Programming

The Shift and Rotate Instructions can be a useful for creating/incrementing sequences and the like. This instruction allows you to shift a bit pattern within a word.

Subscribe Watch Trailer Share
How to Use the Shift and Rotate Instructions in PLC Programming
  • 170. Shift Right Integer – Part 1

    In this lesson we are going to discuss one of the instructions that are in the Basic or Main instruction set, in a folder named shift and rotate.

    We will do a little work with the instruction called Shift Right. This can be a useful instruction for creating/incrementing sequences and the like...

  • 171. Shift Right Integer – Part 2

    When you're creating or incrementing sequences, it's good to understand what happens to the bits in a shift right instruction so that you know how it can be applied to your project. In this lesson we're going to take a look at the numbers we use with the shift right instruction, and how those val...

  • 172. Shift Right Integer – Part 3

    So we've learned about the shift right instruction and how it handles integers. If the integer range is -32,768 to 32,767, then what happens if we want to use the shift right instruction for a number outside of that range?

    In this lesson, we'll uncover how the shift right instruction can be u...

  • 173. Shift Right Double Integer

    We now know how the shift right instruction works for integers and double integers. What about words or double words? The shift right instruction operates slightly different when handling word or double word values as compared to integers or double integers.

    In this lesson we'll compare the s...

  • 174. Shift Right Word and Double Word

    We now know how the shift right instruction works for integers and double integers. What about words or double words? The shift right instruction operates slightly different when handling word or double word values as compared to integers or double integers.

    In this lesson we'll compare the s...

  • 175. Turning on PLC Outputs in Sequential Order – Part 1

    In previous lessons we’ve discussed instructions that are in the folder called shift and rotate. In a continuation of that training, this lesson goes into some more detail about the shift instruction. One useful application for this shift instruction is to create different patterns of turning on ...

  • 176. Turning on PLC Outputs in Sequential Order – Part 2

    In the previous lesson we’ve discussed the sequence in which the lamps will light using a shift instruction. In this lesson we are going to write the logic to make the lamps turn on sequentially as well as turn all of them off at the same time with the press of the stop switch. After we have writ...

  • 177. Turning on PLC Outputs in Sequential Order – Part 3

    In a continuation of instruction training for the shift instruction located in the folder called shift and rotate, this lesson continues from the previous lesson where we had written some code but found that it didn’t quite function as we wanted. We pressed the S1 button and the first lamp turned...

  • 178. Turning on PLC Outputs in Sequential Order – Part 4

    In this lesson we continue working with the shift instruction located in the folder called shift and rotate. In the previous lesson we found a solution to our problem that was turning on the first lamp as we expected however, the remaining lamps turned on at once with the press of the S2 switch. ...

  • 179. Turning on PLC Outputs in Sequential Order – Part 5

    In the previous lesson we discussed how we can use the shift instruction to allow us to turn lamps on in sequential order. In continuation of that training this lesson will go into how we can use the shift right instruction to allow us to turn our lamps on in a different pattern. One useful appli...

  • 180. Turning on PLC Outputs in Sequential Order – Part 6

    In the previous lesson we discussed how we can use the shift right instruction to allow us to turn our lamp on one position at a time. In continuation of that training this lesson will continue with how we use the shift right instruction as well as some common mistakes that can be made while tryi...

  • 181. Shift Left Word and Double Word – Part 1

    In the previous lessons you learned all the ins and outs of the shift right instruction. In this lesson we will see how we can use the shift left instruction and see that the shift left instruction works the exact same way of the shift right instruction however the bits are shifted to the left in...

  • 182. Shift Left Word and Double Word – Part 2

    In the previous lessons you learned that when you use the shift right instruction for integers or double integers, the instruction works like a divide function. In this lesson we will see how the shift left instruction works more like a multiply function and how you can easily figure out what the...

  • 183. Turning on PLC Outputs in Sequential Order using the SHL Instruction

    In the previous lesson titled Shift Left Word and Double Word Part 2 we discussed how we can use the Shift Left Word and Double Word instruction and how this instruction works more like a multiply instruction. In this video we will become familiar with how to turn on PLC outputs in sequential o...

  • 184. Rotate Right Double Word

    In addition to the shift instructions we also have the rotate right and rotate left instructions in this folder.
    The rotate right instruction works by rotating bits to the right according to the value entered in the IN input by whatever bit you define for it located in the N input.
    Unlike the...

  • 185. Rotate Left Double Word

    The rotate left instruction works in the exact opposite way of the rotate right instruction.