Dual operand (dyadic) operators – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual
Page 80

Operating Functions
Chapter 5
5–43
The BASIC Module contains a complete set of arithmetic and logical
operators. We divide the operators into two groups, dual operand (dyadic)
operators and single operand (unary) operators.
The general form of all dual operand instructions is:
(expr) OP (expr), where OP is one of the following operators.
+ Addition Operator
Example: PRINT 3+2
5
/ Division Operator
Example: PRINT 100/5
20
** Exponentiation Operator
The Exponentiation Operator raises the first expression to the power of
the second expression. The maximum power to which you raise a
number is 255.
Example: PRINT 2**3
8
* Multiplication Operator
Example: PRINT 3*3
9
– Subtraction Operator
Example: PRINT 9–6
3
.AND. Logical AND Operator
Example: PRINT 3.AND.2
2
.OR. Logical OR Operator
Example: PRINT 1.OR.4
5.
.XOR. Logical EXCLUSIVE OR operator
Example: PRINT 7.XOR.6
1
5.5
Description of Arithmetic,
and Logical Operators and
Expressions
5.5.1
Dual Operand (dyadic)
Operators