Rockwell Automation 1770-KF2 Data Highway or Highway Plus Interface Module User Manual User Manual

Page 144

Advertising
background image

Data Encoding and Addressing

Chapter 6

6-7

This does not present a problem at PC stations on the link because PCs
store and retrieve their data in this same order of low byte first. It can,
however, require you to do some extra computer application programming
to maintain the proper byte and word order in PC data stored in the
computer.

Three factors that can influence the ability of your computer to handle PC
data are:

the size of words in your computer’s memory,
the left-to-right or right-to-left ordering of bits within a word in your

computer’s memory, or

whether the computer considers the low order byte of a word to have an

even or an odd address.

If your computer uses something other than 2-byte, 16-bit words, you
should design your application programs to make the proper conversions
from PC word addresses to computer word addresses. When stored in a
computer, each PC word should start on an even byte boundary.

Figure 6.6.A shows a 16-bit word in PC memory.

Figure 6.6.B 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 8086
microprocessor). If your computer has this type of word order, the
conversion is straightforward.

Figure 6.6.C 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.

Figure 6.6.D 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 PC must be stored
in the following order:

1,0,3,2,5,4,7,6,9,8...

Advertising