Sunteți pe pagina 1din 4

Menu

1 of 1

http://plcguide.mrplc.com/menu.shtml

Menu
Command Index
Basic Instructions
Timer & Counter
Compare
Data
Math
Register and Sequencer
Program Control
Communication
Programming References
Example Programs
PLC GuestBook
Links
Down Loads

Send Comments

2001-2006
All Rights Reserved
Your IP Address is: 117.222.1.67

02-07-2013 16:03

PLC Programming Command Guide Reference Web Site

1 of 3

http://plcguide.mrplc.com/regsequ/bsr.html

BIT SHIFT RIGHT (BSR)


[Introduction Page] [Command Index] [Programming References]

The BSR command loads data into a bit array one bit at a time.
The data is shifted through the array, then unloaded one bit at a
time. An example for the use of this instruction might be for
tracking bottles through a bottling line where each bottle
constitutes a bit.

The BSR command


is an output instruction that loads data into a bit array one bit at a time. When the
rung goes from false to true, the enable bit (EN bit 15) is set and the data block is shifted to the right (to a
lower bit number) one bit position.The specified bit at the bit address is shifted into the last bit position. The
first bit is shifted out of the array and stored in the unload bit (UL bit 10) in the status byte of the control
element. The shift is completed immediately. This command is equivalent to the BSL command except for the
fact that the designated register shifts in the opposite direction.

The following procedures occur when True.


Processor sets enable bit (EN bit 15)
Data block shifted to right one bit position
Specified bit at the bit address is shifted into first bit position
Last bit is shifted out of array and stored in the unload bit (UL bit 10)

The wraparound operation is completed when the position of the bit address to the last bit of the array or to the
UL bit, whichever applies.

Instruction Parameters
Several parameters must be set when programming this instruction. A definition and explanation is
given for each parameter below.
File - The file indicator number must be used in the bit array address. The array must start at a 16-bit
boundary.
Control - The control address stores the binstruction's status bits, the size of the array, and the bit
pointer.
Bit Address - The location of the bit which will be added to the array.

02-07-2013 16:03

PLC Programming Command Guide Reference Web Site

2 of 3

http://plcguide.mrplc.com/regsequ/bsr.html

Length - The total number of bits to be shifted by the BSR. Bits located to the right of the last bit in the
array, up to the next word boundary cannot be used.

Programming Problem
Develop a process using the BSR command.
An example of the BSR process is given and this example corresponds with the ladder logic. The enable bit ,
operated by sensor #2, loads a bit into the register sequetially. Sensor #1 labels the bit that is loaded with a
high or low signal corresponding to the contents of the bottle. If the bottle is full, a high signal is stored in the
shift register while a low signal is stored in the shift register if the bottle is empty. The Process Illustration
shows an example of this process where the shift register, shown below the illustration, corresponds with the
volume of fluid in the bottles directly above the shift register.The enable bit then loads, labels, and stores more
bits corresponding with the assembly line. An example of this ongoing process is shown in the Process
Assembly Line. The order of ongoing shifts are labeled from the left to the right in numerical order. The empty
bottle "low signal" can be observed moving towards the ejector during the sequence of shifts. At the time
when the empty bottle "low signal" reaches the output sensor, a low signal registers in the ejector bit. This low
signal is passed through the ejector bit switch shown in the ladder logic and a single pulse is sent through that
rung. The pulse triggers the ejector and ejects the bottle.

LADDER LOGIC

PROCESS ILLUSTRATION

02-07-2013 16:03

PLC Programming Command Guide Reference Web Site

3 of 3

http://plcguide.mrplc.com/regsequ/bsr.html

PROCESS ASSEMBLY LINE

[Back] [Next Command]

02-07-2013 16:03

S-ar putea să vă placă și