beautypg.com

Rockwell Automation 1775-S4B,D17756.5.3 User Manual SCANNER/MSG HND User Manual

Page 140

background image

Using a Peripheral Communication Module

Appendix A

AĆ6

Bit shift right shifts a 0 into the left most bit.

Thus, the sign on the value could change due to a shift operation. An
example is given below:

The following command lines show a bit shift execution that changes the
sign on a value:

A = -1
B = (A>>1)
P A
P B

The peripheral communication module prints out the value -1 for user
symbol A and 2147483647 for user symbol B which is a bit shift operation
on user symbol A.

The bit patterns for the two values are given below:

User Symbol

Value Stored

Bit Pattern (32Ćbits)

A
B

Ć1
2147483647

11... 11111111
01... 11111111