Rockwell Automation 5370-CMPK Color CVIM Module MATH-PAK User Manual
Page 39

Chapter 4
Defining Formulas
4–24
Absolute value operator:
ABS
Format/Usage: The absolute value operator (
ABS
) provides the absolute
value of the operand or expression enclosed in the following parentheses. To
use the absolute value operator, enter the ABS operator – which includes the
open parenthesis “(” – then enter the operand or expression, and then enter
the close parenthesis “).”
The absolute value operator can be used with 1) single operands, 2) operator/
operand expressions, such as arithmetic expressions, 3) operator/operand
portions of the formula – that is, operators of the type that are followed by a
parenthetical listing of operands.
Example usage: Use the absolute value operator with a parenthetical
subtraction operation, to ensure a positive result value:
ABS (GAGE2
–
GAGE1)
Square operator:
SQ
Format/Usage: The square operator (
SQR
) computes the square (an
operand multiplied by its own value) of an operand or expression enclosed in
the following parentheses. To use the square operator, enter the SQ operator
– which includes the open parenthesis “(” – then enter the operand or
expression, and then enter the close parenthesis “).”
The square operator can be used with 1) single operands, 2) operator/
operand expressions, such as arithmetic expressions, 3) parenthetical
operator/operand expressions, and 4) operator/operand portions of the
formula – that is, operators of the type that are followed by a parenthetical
listing of operands.
Example usage: Use the square operator with a linear gaging measurement to
calculate the area of a square object.
SQ
(GAGE2) – WINDOW1.11
Square root operator:
SQR
Format/Usage: The square root operator (
SQR
) computes the square root of
the operand or expression enclosed in the following parentheses. To use,
enter the SQR operator – which includes the open parenthesis “(” – then
enter the operand or expression, and then enter the close parenthesis “).”
Negative operand value: If the operand used returns a negative value, the
square root operator result is zero (0).
The square root operator can be used with 1) single operands, 2) operator/
operand expressions, such as arithmetic expressions, 3) parenthetical