9 - expressions, variables and operators, What’s in this chapter, Expressions – Rockwell Automation 1771-DB BASIC MODULE User Manual
Page 111: Relational expressions, Constants, Expressions, variables and operators

9
Chapter
9 -1
Expressions, Variables and Operators
This chapter describes:
On page:
expressions
relational expressions
constants
variables
order of operations
arithmetic operators
bitwise operators
relational operators
trigonometric operators
functional operators
logarithmic operators
string operators
special function operators
what’s next?
An expression is a logical mathematical expression that uses operators,
constants, and variables to produce a result. Expressions can be simple or
complex.
simple
expression:
A+B–C or 10*X/20
complex
expression:
12*(SIN(A)*SIN(A)+COS(A))*(COS(A)/2)
A stand alone variable or constant is also considered an expression.
Relational expressions involve the operators EQUAL (=), NOT EQUAL
(<>), GREATER THAN OR EQUAL TO (>=), and LESS THAN OR
EQUAL TO (<=). You use them in control statements to test a condition
(ex. IF A<100 THEN...). Relational expressions always require two
operands. See relational operators on page 9 -9 for more information.
A constant is a real number that ranges from
±
1E
–127
to
±
.9999999 9E
+127
.
A constant can be an integer.
What’s in This Chapter?
Expressions
Relational Expressions
Constants