The function passes power flow to the right, unless the number of bits specified to be
shifted is zero. 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.
10.1.6.1
Parameters of the Shift Right / Left Functions
Input/ Output
Choices
Description
enable
flow
When the function is enabled, the shift is
performed.
IN
I, Q, M, T, S, G, R, AI, AQ
IN contains the first word to be shifted.
N
I, Q, M, T, G, R, AI, AQ,
constant
N contains the number of places (bits) that the
array is to be shifted.
B1
flow
B1 contains the bit value to be shifted into the
array.
B2
flow, none
B2 contains the bit value of the last bit shifted out
of the array.
Q
I, Q, M, T, SA, SB, SC, G,
R, AI, AQ
Output Q contains the first word of the shifted
array.
10.1.7
Bit Operation Functions Rotate Bits Right,
Rotate Bits Left
The Rotate Left function rotates all the bits in a string a specified number of places to the
left. When rotation occurs, the specified number of bits is rotated out of the input string to
the left and back into the string on the right.
The Rotate Right function rotates the bits in the string to the right. When rotation occurs,
the specified number of bits is rotated out of the input string to the right and back into the
string on the left.
A length of 1 to 256 words can be selected for either function. The number of places to
rotate must be more than zero and less than the number of bits in the string.
The Rotate Bits function passes power flow to the right, unless the number of bits
specified to be rotated is greater than the total length of the string or is less than zero. The
result is placed in output string Q. If you want the input string to be rotated, the output
parameter Q must use the same memory location as the input parameter IN. The entire
rotated string is written on each scan that power is received.
Word to be rotated
OK
Enable
ROL
WORD
IN
Output
Q
Number of bits
N
Instruction Set Reference
GFK-1503E User Manual 129
For public disclosure
Summary of Contents for VersaMax PLC
Page 16: ...Notes 16 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 38: ...Notes 38 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 50: ...Notes 50 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 92: ...Notes 92 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 112: ...Notes 112 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 224: ...Notes 224 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 292: ...Notes 292 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 316: ...Notes 316 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 317: ......