Rockwell Automation 1775-KA PLC-3 Communication Adapter Module User Manual User Manual

Page 73

Advertising
background image

Addressing Rules and Examples

Chapter 4

4Ć17

The bitwise 32–bit EXCLUSIVE OR (.BXOR.) forms a bit–by–bit logical
EXCLUSIVE OR of two 32–bit operands. There is not carry from one bit
position to the next within the operand.

The bitwise 32–bit OR (.BOR.) forms the bit–by–bit logical OR of two
32–bit operands. There is not carry from one bit position to the next
within the operand.

Arithmetic Operators

The arithmetic operations are addition, subtracting, multiplication, and
division. These are binary (not BCD) operations that produce 32–bit
signed integer results.

A result from these arithmetic operations should normally be assigned to a
32– bit destination. The result can be assigned to a 16–bit destination only
if the result is small enough in absolute value (less than 65,535) to fit into
16 bits. If the result is assigned to a 16–bit destination but is too large to
fit into 16 bits, then an error code of 215 results.

There is no indication of overflow or underflow conditions with
arithmetic operations.

Shift Operators

When a left arithmetic shift (<<) is executed, zeros are shifted into the
rightmost bits of the expression. The leftmost bit are shifted out of the
expression and are lost.

When a right arithmetic shift (>>) is executed, the leftmost bit of the
expression does not change. If the leftmost bits is a 1, then 1’s are shifted
in from the left. If the leftmost bit is a 0 (zero), then 0’s are shifted in
from the left. Since the leftmost bit of an expression is the sign bit, this
means that the right arithmetic shift does not change the sign of a numeric
value. The rightmost bits are shifted out of the expression and are lost.

Comparison Operators

Comparison operators result in a value of 1 if the comparison is true and 0
(zero) if the comparison is false. For example, consider the command

$I12:23 = ($CACC:1.GE.$CACC:2)

Advertising