Bit Operation Functions Bit Test - GE VersaMax PLC User Manual

Table of Contents

Advertisement

Input/
Output
enable
IN
N
ok
Q
%I0001
ROL
WORD
IN
Q
%R0001
CONST
N
+00003
130
GFK-1503E
For public disclosure
10.1.7.1 Parameters of the Rotate Bits Right / Left Functions
Choices
flow
I, Q, M, T, S, G, R, AI, AQ
I, Q, M, T, G, R, AI, AQ,
constant
flow, none
I, Q, M, T, SA, SB, SC, G,
R, AI, AQ
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.
%R0001
%R0002
%R0002 after
%I0001 is set

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.
Enable
Bit to be tested
Bit number of IN
Description
When the function is enabled, the rotation is
performed.
IN contains the first word to be rotated.
N contains the number of places the array is to be
rotated.
The OK output is energized when the rotation is
energized and the rotation length is not greater than
the array size.
Output Q contains the first word of the rotated array.
MSB
1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
MSB
1 1 0 0 0 0 0 0 0 0 0 0 0
BIT_
TEST_
WORD
Output
IN
Q
BIT
LSB
LSB
1 1 1
VersaMax PLC User Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents