Register  |  Login
 
PLC Training Forum
Forum
 
  Forum  PLC Programming  General PLC Que...  Bit shift instructions
Previous Previous
 
Next Next
New Post 3/13/2009 9:26 AM
Resolved
  Site Question
13 posts
Newbie


Bit shift instructions 

Why use a bit shift L or R?

 
New Post 3/13/2009 9:27 AM
  AutomationNC
72 posts
Helper


Re: Bit shift instructions 

Actually, my use of the BSR and BSL instructions is rare.  They are not the most common instructions you will find.  Also use is dependent on industry.  My expertise is heavily weighted in process control and machine control.  I do however have a fair amount of experience in conveying and tracking items throughout a system.  An area such as this is where the Bit shift instructions have merit.  Take for example a photo eye detecting a part and moving a 1 into the bit shift register.  as that part moves down the system you could use the bit shift to track its progress down the line.  As additional parts come into the system additional 1's are moved into the register and you have a method of easily tracking their location in reference to each other.  Or better yet maybe there is a specific type of package that you want to track and you only move a 1 into the register when that type comes on to your system.  On the discharge side you may have an arm that pushes your package off the belt when the shift register shows it is in the proper location - but ignores other packages on the belt. 

Another classic use of these instructions - really not applicable now in my opinion - is multiplying and dividing binary numbers by 2.  If you play around with a binary number, you will find that shifting the bits left and right will multiply and divide by 2 (ie, 010 binary which is 2 in decimal will become 100 on a BSL which is 4 in decimal OR 001 which is 1 in decimal.  With the advent of Multiply and Divide instructions that really isnt useful these days, but informative to know.

Finally let me add that I put these instructions in my avoid if possible category.  I think a well written PLC program is simple, thus easy to follow and understand by my clients' support staff.  Generally those guys will not have much experience with these instructions so I try to avoid them. 

 
Previous Previous
 
Next Next
  Forum  PLC Programming  General PLC Que...  Bit shift instructions
  
 

 

  
Like this Site?

Check out our PLC Training Facebook site and "like" us!

Click Here!

  
Squidoo

Checkout our new Squidoo lens!  We have posted an interview with Russell White on PLC training.

To see it Click Here!

Let't wake up Squidoo and let them know we are here!

  
Terms Of Use  |  Privacy Statement
Home  |  Subscriptions  |  Training Videos  |  PLC Training  |  Articles  |  PLC Training Forum  |  Contact  |  About Us
Copyright © 2008 - 2011 by Automation Technologies, Inc. - All Rights Reserved