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

Advertising
background image

9

Chapter

9 -1

Expressions, Variables and Operators

This chapter describes:

On page:

expressions

9 -1

relational expressions

9 -1

constants

9 -1

variables

9 -2

order of operations

9 -3

arithmetic operators

9 -5

bitwise operators

9 -7

relational operators

9 -9

trigonometric operators

9 -10

functional operators

9 -11

logarithmic operators

9 -13

string operators

9 -14

special function operators

9 -17

what’s next?

9 -20

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

Advertising