Using variables and constants – Rockwell Automation T3833 ICS Regent Math Package for Winterpret User Manual

Page 7

Advertising
background image

Math Package for W

INTERPRET

(T3833)


P D - 6 0 4 3 M a r c h , 0 6

7

Logical Operators

Logical operators perform logical, or boolean, operations on
numeric values. Just as the relational operators are usually
used to make decisions regarding program flow, logical
operators are used to connect two or more relations and return
a true or false value to be used in a decision.

A logical operator takes a combination of true/false values and
returns a true or false result. An operand of a logical operator
is considered to be true if it is not equal to zero, or false if it is
equal to zero. The result of the logical operation is a number
which is, again, true if it is not equal to zero, or false if it is
equal to zero.

In an expression, logical operations are performed after
arithmetic and relational operations.

Table 4. Logical Operators.

Value

A

Value

B

Result

A AND B

Result

A OR B

T

T

T

T

T

F

F

T

F

T

F

T

F

F

F

F

Using Variables and Constants

Constants

Constants are static values used by the floating point math
function blocks during execution of your program. All
constants are numeric.

Numeric constants can be either positive or negative.
Numeric constants must not contain commas. For example, if
the number 20,000 is needed as a constant, it should be typed
in the floating point math statement as 20000.

There are two types of numeric constants: integer and floating
point.

Advertising