10.1.7.1 Parameters of the Rotate Bits Right / Left Functions
Input/
Output
Choices
Description
enable flow
When the function is enabled, the rotation is
performed.
IN
I, Q, M, T, S, G, R, AI, AQ
IN contains the first word to be rotated.
N
I, Q, M, T, G, R, AI, AQ,
constant
N contains the number of places the array is to be
rotated.
ok
flow, none
The OK output is energized when the rotation is
energized and the rotation length is not greater than
the array size.
Q
I, Q, M, T, SA, SB, SC, G,
R, AI, AQ
Output Q contains the first word of the rotated array.
10.1.7.2 Example
In the example, whenever input %I0001 is set, the input bit string in location %R0001 is
rotated 3 bits. The result is placed in %R0002. The input bit string %R0001 is not
changed by the function. If the same reference is used for IN and Q, a rotation will occur
in place.
%I0001
%R0001
CONST
+00003
ROL
WORD
IN
N
Q %R0002
1
10.1.8 Bit Operation Functions Bit Test
The Bit Test function tests a bit within a bit string to determine whether that bit is
currently 1 or 0. The result of the test is placed in output Q.
Each sweep power is received, the Bit Test function sets its output Q to the same state as
the specified bit. If a register rather than a constant is used to specify the bit number, the
same function block can test different bits on successive sweeps. If the value of BIT is
outside the range (1 < BIT < (16 * length) ), then Q is set OFF.
A string length of 1 to 256 words can be selected.
Bit to be tested
Enable
BIT_
TEST_
WORD
IN
Output
Q
Bit number of IN
BIT
130 GFK-1503E VersaMax PLC User Manual
For public disclosure