Rockwell Automation GMLC Reference Manual User Manual
Page 505

Publication GMLC-5.2 - November 1999
468
The Expression Builder
For example, if Input_Group is defined to consist of inputs 2 - 5, in the
following expression discrete inputs 2 - 5 are logically
AND
ed with the
value 13
10
(1101
2
) when the expression is evaluated.
Input_Group & 13
The result is that discrete input 3 is masked
OFF
and only inputs 2, 4 and 5
are read. The state of input 3—when
AND
ed with the 0 at that bit
position—always results in a 0 regardless of whether the input is
ON
or
OFF
.
Specifically, if inputs 2 - 5 are currently in the following states, the
expression above evaluates as 9 (1011
2
& 1101
2
= 1001
2
= 9
10
).
Input 2 =
ON
Input 3 =
ON
Input 4 =
OFF
Input 5 =
ON
Bitwise OR
|
Use the pipe (vertical bar) to logically
OR
together the corresponding bits
in the binary representation of the two elements. It is particularly useful
for forcing unwanted bits in an input or output group
ON
.
For example, if Input_Group is defined to consist of inputs 2 - 5, in the
following expression discrete inputs 2 - 5 are logically
OR
ed with the
value 2
10
(0010
2
) when the expression evaluates.
Input_Group | 2
The result is that discrete input 3 is masked
ON
and only inputs 2, 4 and 5
are read. The state of input 3—when
OR
ed with the 1 at that bit position—
always results in a 1 regardless of whether the input is
ON
or
OFF
.
!
ATTENTION: Do not use the Bitwise OR operator on
user or system variables.