Rockwell Automation 1770, D17706.5.16 Ref Mnl DF1 Protocol Command User Manual

Page 203

Advertising
background image

11–7

Data Encoding

Publication 1770Ć6.5.16 - October 1996

A 16-Bit Word in PLC Memory

1

0

1

0

0

1

0

1

1

1

0

1

1

0

0

1

17

16

15 14 13 12

11 10

7

6

5

4

3

2

1

0

Bit

(Octal)

Odd, high byte

Even, low byte

Value - A576 hex

A 16-Bit Computer Word with Left-to-Right Byte and Bit Order

1

0

1

0

0

1

1

0

1

1

0

1

0

1

15 14 13 12

11

10

9

8

7

6

5

4

3

2

Bit

(Decimal)

Odd, high byte

Even, low byte

1

0

1

0

Value - A576 hex

This figure shows a 16Ćbit computer word with rightĆtoĆleft byte and bit order (as in DEC PDPĆ11/34 or

VAX 11/780). It also represents a 16Ćbit word in an 8Ćbit processor (such as Zilog ZĆ80 or Intel 8088

microprocessor). If your computer has this type of word order, the conversion is straightforward.

A 16-Bit Computer Word with Right-to-Left Byte and Bit Order

0

1

1

1

0

1

1

0

0

1

0

1

0

0

1

0

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Bit

(Octal)

Odd, high byte

Even, low byte

Value - A576 hex

(after byte swapping)

This figure shows a 16Ćbit computer word with leftĆtoĆright byte and bit order (as in IBM Series 1).

If your computer has this type of word order, the conversion is more complex. You will have to

swap bytes into and out of buffers.

A 16-Bit Computer Word with Left-to-Right Byte Order and
Right-to-Left Bit Order

0

1

1

1

0

1

0

1

1

0

0

1

1

0

15 14 13 12

11 10

9

8

7

6

5

4

3

2

Bit

(Decimal)

Odd, high byte

Even, low byte

1

0

0

0

Value - A576 hex

(after byte swapping)

This figure shows a 16Ćbit computer word with leftĆtoĆright byte order and rightĆtoĆleft bit order

(as in Zilog Z 8000 or Motorola 68000 microprocessors). If your computer has this type of word

order, your communication driver must handle the task of byte swapping as it loads data into a

buffer. Successive bytes received from the PLC must be stored in the following order:
1,0,3,2,5,4,7,6,9,8. . .

Advertising