beautypg.com

Relational operators – Rockwell Automation GMLC Reference Manual User Manual

Page 507

background image

Publication GMLC-5.2 - November 1999

470

The Expression Builder

Relational Operators

Use relational operators to make numerical and logical comparisons, for
example, in an On Expression block with If Expression selected. Unlike
the other expression operators, that combine elements in an expression,
relational operators compare one element to another element or an
expression. Therefore, the relational operators are used only if the
comparison yields a resultant value of true or false.

The relational operators are shown below:

=

(equal sign) — Equal to

!=

(exclamation point with an equal sign) — Not Equal to

>

(right arrow) — Greater Than

<

(left arrow) — Less Than

>=

(right arrow with an equal sign) — Greater Than or Equal to

<=

(left arrow with an equal sign) — Less Than or Equal to

Precedence

All expression operators—including the relational operators—have equal
precedence in an expression. This means that expressions are always
evaluated from left to right regardless of what operators are used in the
expression. This is done to minimize computation time in the motion
controller when evaluating the expression.

Because of the left-to-right precedence of operations, when comparing an
expression to an element, make sure that the expression is on the left side
of the relational operator for proper operation. For example, the following
two expressions do not produce the same result.

Cut_Length + 10 = Actual_Position_AXIS0
Actual_Position_AXIS0 = Cut_Length + 10