Shift Bits - GE PACSystems RX7i Cpu Programmer's Reference Manual

Hide thumbs Also See for PACSystems RX7i:
Table of Contents

Advertisement

Chapter 4. Ladder Diagram (LD) Programming
4.2.10

Shift Bits

Mnemonics:
SHIFTL_DWORD
SHIFTL_WORD
SHIFTR_DWORD
SHIFTR_WORD
Shift Left
When the Shift Left (SHIFTL_WORD) function receives power flow, it shifts all the bits in a word or
group of words to the left by a specified number of places, N. When the shift occurs, the specified
number of bits is shifted out of the output string to the left. As bits are shifted out of the high end of
the string (Most Significant Bit (MSB)), the same number of bits is shifted in at the low end (Least
Significant Bit (LSB)). The SHIFTL_DWORD function operates in a similar manner on DWORDs instead
of WORDs.
Shift Right
When the Shift Right (SHIFTR_WORD) function receives power flow, it shifts all the bits in a word or
group of words a specified number of places to the right (N). When the shift occurs, the specified
number of bits is shifted out of the output string to the right. As bits are shifted out of the low end of
the string (LSB), the same number of bits is shifted in at the high end (MSB).
Shift Left and Shift Right
A string length (Length) of 1 to 256 words can be specified.
The bits being shifted into the beginning of the string are specified via input parameter B1. If the
value of N is greater than 1, each bit is filled with the same value (0 or 1). This can be:
The Boolean output of another program function.
All 1s. To do this, use the #AWL_ON (always on) system bit (in memory location %S7), as a
permissive to input B1.
All 0s. To do this, use the #ALW_OFF (always off) system bit (in memory location %S8), as a
permissive to input B1.
The Shift Bits function passes power flow to the right, unless the number of bits specified to shift is
zero or is greater than the array size.
Output Q is the shifted copy of the input string. If you want the input string to be shifted, the output
parameter Q must use the same memory location as the input parameter IN. The entire shifted
string is written on each scan that power is received. Output B2 is the last bit shifted out. For
example, if four bits were shifted, B2 would be the fourth bit shifted out.
82
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pacsystems rx3iPacsystems rsti-ep

Table of Contents