Shift Bit Register (%SBR)
Shift Bit Register (%SBR)
Shift Bit Register (%SBR)
Section 4.4
Shift Bit Register (%SBR)
148
Page
Description
149
Configuration
150
Programming Example
152
EIO0000001474 11/2014
Software Objects
Description
Introduction
The Shift Bit Register function block
or 1).
Illustration
This illustration is the Shift Bit Register function block:
The current value of the Shift Bit Register is displayed in the centre of the function block:
Decimal value eg 7
Binary value eg 111
Hex value eg 16#7
Inputs
The Shift Bit Register function block has the following inputs:
Label
Description
Value
CU
Shift to left input (or instruction) On a rising edge, shifts a register bit to the left.
CD
EIO0000001474 11/2014
149
Software Objects
Configuration
Parameters
To configure parameters, follow the Configuring a Function Block procedure (see page 133) and
read the description of Memory Allocation Modes in the SoMachine Basic Operating Guide.
The Shift Bit Register function block has the following parameters:
Parameter
Description
Value
Used
Address used
Address
Symbol
Symbol
Comment
Comment
Objects
The Shift Bit Register function block has the following objects:
Object
Description
Value
%SBRi
Register number
0 to 7
It can be modified in an animation table.
Operation
This illustration shows a bit pattern before and after a shift operation:
This is also true of a request to shift a bit to the right (bit 15 to bit 0) using the CD instruction. Bit 0
is lost.
If a 16-bit register is not adequate, it is possible to use the program to cascade several Register.
150
EIO0000001474 11/2014
Software Objects
Special Cases
This table contains a list of special cases for programming the Shift Bit Register function
block:
Special Case
Description
EIO0000001474 11/2014
151
Software Objects
Programming Example
Introduction
The Shift Bit Register function block provides a left or right shift of binary data bits (0 or 1).
Programming
In this example, a bit is shifted to the left every second while bit 0 assumes the state to bit 15.
In reversible instructions:
Rung
Reversible Instruction
BLK %SBR0
LD
%S6
CU
END_BLK
LD
ST
%SBR0.15
%SBR0.0
In non-reversible instructions:
Rung
Non-Reversible Instruction
LD
CU
LD
ST
%S6
%SBR0
%SBR0.15
%SBR0.0
NOTE: Refer to the reversibility procedure (see page 14) to obtain the equivalent Ladder Diagram.
152
EIO0000001474 11/2014