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

Page 46

Advertising
background image

Chapter 4

Defining Formulas

4–31

Median operator:

MED

The maximum operator returns the median value among the operands and/or
expressions listed in parentheses following the operator. The median value is
the value for which there are an equal number of values in the list above and
below the value. For example, for the list (2, 5, 7, 4, 3), the median is 4.

Note: If there is an even number of operands in the list, there cannot be an
equal number of values below and above the median value. In this case, the
median value returned is the value with one less value above than below in
the list. For example, for the list (2, 5, 4, 7), the median is 5.

Example usage: The formula below finds the median value among the
results of 3 gages:

MED(GAGE1,GAGE2,GAGE3)

In this example, each of three gages is set for linear gaging, in order to
measure the distance between the center of two objects (see Figure 4.16,
page 4–30). The formula above yields the median value among the
measurements of the three gages. For example, if the three gages returned
the values 1.250, 1.291, and 1.242, the median value would be 1.250, since
one value is above (1.291) and one value is below (1.242).

Minimum operator:

MIN

The minimum operator returns the minimum value among the operands
and/or expressions listed in parentheses following the operator.

Example usage: The formula below finds the minimum value among the
results of 3 gages:

MIN(GAGE1,GAGE2,GAGE3)

In this example, each of three gages is set for linear gaging, in order to
measure the distance between the center of two objects (see Figure 4.16,
page 4–30). The formula above yields the minimum value among the
measurements of the three gages. In this example, if the minimum value is
below a certain level, the part is rejected.

Mode operator:

MOD

The mode operator returns the value among the listed operands and/or
expressions which occurs most often. If more than one value occurs most
often, the lower of these values is returned.

Advertising