beautypg.com

Relational operators, How string operands are evaluated, How string operands are evaluated -11 – Rockwell Automation 9301 Series RSView32 Users Guide User Manual

Page 524

background image

Creating expressions

14–11

Relational operators

Relational operators compare two numeric or string values to provide
a true or false result. If the statement is true, a value of 1 is returned. If
false, 0 is returned.

The relational operators are:

How string operands are evaluated

String operands are evaluated by case and by alphabetical order. Upper
case letters are greater than lower case letters. For example, H is
greater than h. Letters later in the alphabet are greater than those
earlier in the alphabet. For example, B is greater than A.

Symbol

Operator

Numeric Examples

1

String Examples

2

1

For the numeric examples, tag1 = 5 and tag2 = 7

2

For the string examples, serial_no = ST009

EQ, ==

equal

tag1 == tag2
false

serial_no == “ST011”
false

NE, <>

not equal

tag1 <> tag2
true

serial_no <> “ST011”
true

LT, <

less than

tag1 < tag2
true

serial_no < “ST011”
true

GT, >

greater than

tag1 > tag2
false

serial_no > “ST011”
false

LE, <=

less than or equal to

tag1 <= tag2
true

serial_no <= “ST011”
true

GE, >=

greater than or equal to

tag1 >= tag2
false

serial_no >= “ST011”
false