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

Page 50

Advertising
background image

Chapter 4

Defining Formulas

4–35

Conditional Operators

A conditional operator compares two operands, and returns a true (1) or false
(0) value for the indicated condition. The conditional operators include
= (equal to), <> (not equal to), <= (less than or equal to), => (greater than or
equal to), < (less than) , and > (greater than).

Format / Usage: Use two operands or parenthetical expressions with the
operator, placing the conditional operator in the formula between the two
operands.

Example conditional operators: This formula compares the numerical result
of gage 1 to gage 2 to see if the two are equal, and also compares the
numerical result of gage 2 to that of gage 3, to see if they are not equal.

(GAGE1 = GAGE2) AND (GAGE2 <> GAGE3)

In this case, the result of the formula is 1 (true), if the gage 1 result equals the
gage 2 result, and if the gage 2 result does not equal the gage 3 result.
Otherwise, the result is 0 (false).

Additional Formula Examples

This section presents additional formula examples, to illustrate some of the
additional functionality and flexibility possible through the use of formulas.

Flagging Consecutive Rejects

This example requires the use of two formulas, the result of which is to
provide an output signalling the occurrence of 10 consecutive rejects.

Assume that the example application requires the use of gages 1 and 2, and
of windows 1 and 2.

Formula 1 would be as follows:

GAGE1.2 AND GAGE2.2 AND WIN1.2 AND WIN1.2

The result of formula 1 will be 1 if all tools pass, otherwise, the result will be
0 (zero).

Formula 2 would be as follows:

(RSLT2 + NOT RSLT1)

*

NOT RSLT1

Advertising