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

Page 34

Advertising
background image

Chapter 4

Defining Formulas

4–19

Table 4.D (part 2 of 2)
Operator Definitions

Key / Symbol

Operator Type

*Result

Type

Operator Usage

Format

Operator Function

Statistical

AVG

Average

INT/FP

AVG(X, Y, ...)

Computes the average of a list of operands.

MAX

Maximum

INT/FP

MAX(X, Y, ...)

Finds the maximum numeric value among operands.

MED

Median

INT/FP

MED(X, Y, ...)

Finds the middle numeric value in a list of operands by
sorting the list in ascending order and returning the
value located at the center position in the sorted list.

MIN

Minimum

INT/FP

MIN(X, Y, ...)

Finds the minimum numeric value in a list of operands.

MOD

Mode

INT/FP

MOD(X, Y, ...)

Finds the listed value that appears most often. If no
value appears more than once, finds the lowest value.

VAR

Variance

FP

VAR(X, Y, ...)

Computes the variance of a list of operands. The
variance is the sum of the square of the difference
between each operand and the average value of the
operands, divided by the number of operands.

Conditional

=

Equal

INT/FP

X = Y

Produces a “1” result if the left operand is equal to the
right operand; otherwise, produces a “0” result.

Not equal

INT/FP

X

Y

Produces a “1” result if the left operand is not equal to
the right operand; otherwise, produces a “0” result.

>

Greater than

INT/FP

X > Y

Produces a “1” result if the left operand is greater than
the right operand; otherwise, produces a “0” result.

<

Less than

INT/FP

X < Y

Produces a “1” result if the left operand is less than the
right operand; otherwise, produces a “0” result.

>=

Greater than or

equal

INT/FP

X >= Y

Produces a “1” result if the left operand is greater than
or equal to
the right operand; otherwise, produces a
“0” result.

<=

Less than or

equal

INT/FP

X <= Y

Produces a “1” result if the left operand is less than or
equal to
the right operand; otherwise, produces a “0”
result.

Other

.

Decimal point

––

––

Used when entering a fixed point decimal value. Also
used in designating an operand sub-code.

,

Comma

––

––

Used to separate the operands in a list of operands.

(

Open

––

––

Used with “)” to prioritize operations with a formula.

)

Close

––

––

Used with “(” to prioritize operations with a formula.
Also used to end operand listing for some operators.

*

INT=integer format. FP = fixed point (decimal) format

Advertising