beautypg.com

Rockwell Automation GMLC Reference Manual User Manual

Page 498

background image

Publication GMLC-5.2 - November 1999

The Numeric Keypad

461

Precedence

All expression 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 minimizes computation
time, when the motion controller evaluates the expression.

For example, the following two expressions do not produce the same
result:

The expression 100 * 2 + 10 is evaluated as:

100 * 2 + 10 = 200 + 10 = 210

The expression 2 + 10 * 100 is evaluated as:

2 + 10 * 100 = 12 * 100 = 1,200

( )

Parentheses

Using parentheses in an expression changes the default left-to-right
precedence of operations. When parentheses are used, the motion
controller evaluates an expression from the innermost parentheses
outward. Up to 16 levels of parentheses can be used in an expression.

You can insert parentheses into an expression using the

( )

key on the

numeric keypad, or by using the keyboard’s open and close parenthesis
keys. Selecting the numeric keypad’s

( )

key inserts both an open and a

close parenthesis into the expression and leaves the cursor between them,
ready for the parenthetical expression.