L9_BROT: Bit Rotate
(Original Document)
Naming
Name in LL984 Editor
Function Block Name
name of legacy 984 instruction
name in other tools and editors like:
  • Type Library Browser
  • Data Editor
  • Animation Tables
  • Search Results
Function Description
The L9_BROT procedure shifts or rotates the bit pattern in a source matrix, then writes the changed bit pattern into a destination matrix. The bit pattern shifts or rotates left or right by 1 position per scan, overwriting the destination matrix’s previous contents.
NOTE: The L9_BROT procedure will not write to and change the state of any BOOL that has been forced in the Control Expert Animation Table.
Both the source and destination matrices consist of 16-bit sequences of outputs located in %M or %MW memory, depending on the respective procedure. The LENGTH value determines the number of 16-bit sequences included in the shift or rotate operation. The location of the source matrix is defined by the SOURCE parameter, and the location of the destination matrix is defined by the DEST parameter.
The operation begins when the input to the ENABLE pin is turned ON. If the LEFT pin is turned ON, the source matrix will move left 1 position; if the LEFT pin is turned OFF, the source matrix will move right 1 position.
If the ROT bit is ON, the selected matrix will rotate and the exiting bit will wrap around to the opposite side of the source matrix. If the ROT bit is OFF, the selected matrix will shift, the exiting bit will be dropped, and a 0 will fill-in on the opposite side of the source matrix.
The OUT output turns ON upon the successful completion of the operation. The CARRY output holds the value of the exiting bit.
Representation
Parameters
Input Pin
Name
Data Type
Address Range
Meaning
Top
ENABLE
OFF to ON initiates the operation.
Middle
LEFT
BOOL
ON shifts left, OFF shifts right.
Bottom
ROT
BOOL
ON = rotate; the exiting bit wraps.
OFF = shift; the exiting bit is dropped.
Node
Node Type
Name
Data Type
Address Range
Meaning
Top
IN
SOURCE
ANY_ARRAY_UINT or ANY_ARRAY_EBOOL
%M, %I, %IW, %MW
The source matrix as an ARRAY OF UINT or EBOOL, can be located or unlocated.
Middle
IN/OUT
DEST
ANY_ARRAY_UINT or ANY_ARRAY_EBOOL
%M, %MW
The destination matrix as an ARRAY OF UINT or EBOOL, can be located or unlocated.
Bottom
IN
LENGTH
UINT
1...100
The number of 16-bit Boolean sequences to be included in the shift or rotate operation.
Valid range: 1 to 100.
Output Pin
Name
Data Type
Address Range
Meaning
Top
OUT
BOOL
ON indicates the operation succeeded. (Echoes the status of the ENABLE input).
Middle
CARRY
BOOL
Holds the value of the bit rotated or dropped.