MVP 2021 Joe Tauser Posted September 17, 2014 MVP 2021 Report Share Posted September 17, 2014 I went to help a customer the other day and he wanted to track part presence around a 50 position indexer. No problem (I thought), we'll just use the SHL instruction. Nay, Nay! I discovered SHL and SHR only work with one MI, not a block. I needed to shift the bits through 4+ words. Moving on to the "Shift Left" instruction (VEC. SHIFT) I determined that it moves whole bytes at a time. I was out of ideas for an easy solution, and envisioned a convoluted multiple network mess that AB can do with one instruction. We are blessed with a good team at Support HQ here in the US. I called them and they got back within an hour with a solution. Turns out the Vector Copy commands will take MB as an argument even though they default to MI and all the Help shows examples with MIs. So it can be done with one block. I never thought to slide up and look for MB on the source of the block. Turns out you can teach an old dog new tricks. Thanks, Unitronics Support! I've attached a sample program if anybody wants to see the magic in action. Joe T. Bit Shift Register.vlp 1 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.