Rockwell Automation 5370-CVIM2 Module User Manual
Page 365

5
Chapter
Chapter 7
Inspection Tools
7–127
test –– The “
test
” logic operator evaluates the expression following the
parenthesis. If the value of the expression is non–zero, the output from the
“
test
” operation will be a logic “1.” Conversely, if the value of the
expression is zero, the output from the “
test
” operation will be a logic “0.”
In a simple example, the result from one tool is “tested” in a formula, as
follows:
test({Tool3})
In this example, if the
Tool 3
result is 12, the formula will output a logic “1,”
since the tool result is non–zero.
rng –– The “
rng
” (range) logic operator evaluates the expression following
the parenthesis to determine whether a particular value lies within a specified
range of values. If the value does satisfy the range test, the output from the
“
rng
” operation will be a logic “1.” Conversely, if the value does not satisfy
the range test, the output from the “
rng
” operation will be a logic “0.”
The value and range limits are entered from the keyboard immediately after
the open parenthesis in this order: minimum range limit, value, maximum
range limit. The entries must be separated by commas.
In a simple example, the result from one tool is range–checked in a formula,
as follows:
rng(300,{Tool3},320)
In this example, the minimum range limit is 300, the value (
Tool 3
result) is
312.000 pixels, and the maximum range limit is 320. Since the value,
312.000, does lie within the 300 to 320 range limits in this case, the formula
will output a logic “1.” If the value were <300 or >320, the formula would
output a logic “0.”
Bit Functions
When you pick the
key, the
Bit Functions
panel appears, as shown by
the example in Figure 7.99 (page 7–128).
The
Bit Functions
panel lists all of the bit–level logic operators that are
available to a math tool.
The “
band
,” “
bor
,” and “
bxor
” logic operators perform logical operations
when placed between two values in a formula, whereas the “
bnot
” operator
is placed ahead of an expression containing other logic operators.