beautypg.com

8ć16, 7 bit operation – Rockwell Automation 1775-S4B,D17756.5.3 User Manual SCANNER/MSG HND User Manual

Page 84

background image

Using Symbols and Expressions

in Report Generation

Chapter 8

8Ć16

The bit patterns for the two values are given below:

User Symbol

Value Stored

Bit Pattern (32Ćbits)

A
B

5
10

00...00000101
00...00001010

The following command lines show a bit shift execution on a negative
value:

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

The 1775-S4B scanner prints out the value -1 for user symbol A and -1 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
Ć1

11...11111111
11...11111111

Report generation supports the slash (/) for a bit test:

If the bit is:

Then the 1775ĆS4B scanner returns:

On
Off

1
0

For example:

If you enter:

P ($I:12/010)

The 1775-S4B scanner returns the value 0 or 1:

If Input word 12, bit 10 is:

Then the 1775ĆS4B scanner returns:

On
Off

1
0

8.5.7
Bit Operation