Rockwell Automation 5370-CVIM2 Module User Manual
Page 366
Chapter 7
Inspection Tools
7–128
Figure 7.99 Example: Selecting the Bit Functions Panel
ЗЗЗЗЗ
ЗЗЗЗЗ
ЗЗЗЗЗ
The value(s) used with a bit–level logic operator are usually numeric
inspection results of some kind. These values can be thought of as “inputs” to
the logic operator, which converts them to binary equivalent values first, and
then performs the selected bit–level logic operation.
The result or “output” from all of these bit–level logic operators is always a
decimal number, not a logic “1” or “0.”
band –– The “
band
” (bit and) logic operator is inserted between two
expressions (such as inspection results values) in a formula. The values of
the expressions (“inputs”) on both sides of the “
band
” operator are
converted to binary equivalents and are “anded” at the binary level. The
binary result of the logic operation (“output”) is then converted back to
decimal form.
In a simple example, two values are “bit–anded,” as follows:
87band119
In this example, the ASCII value of the uppercase character “W” (87
10
) is
bit–anded with the ASCII value of the lowercase “w” (119
10
). The effect is
to convert the lowercase “w” to uppercase “W” by changing bit 5 to 0, as
follows:
87
10
= 1010111
2
119
10
= 1110111
2
1010111
2
= 87
10
AND
bnot –– The “
bnot
” (bit not) logic operator is used with expressions
containing other logic operators, and its effect is to invert the normal logic
results from such expressions to their 32–bit “1’s” complement. The “
bnot
”
operator must be inserted ahead of the expression that it modifies.
Thus, if the “
bnot
” operator is appended to the “
bxor
” example formula
above, it will appear as follows:
bnot87bxor119