Order of transmission – Rockwell Automation 1770, D17706.5.16 Ref Mnl DF1 Protocol Command User Manual

Page 202

Advertising
background image

11–6

Data Encoding

Publication 1770Ć6.5.16 - October 1996

PLC processors store data in 16-bit (2-byte) words. The bits in these
words are numbered (addressed) 0 through 17 octal, going from right
to left within a word, as follows:

17 16

07 06

11

15 14 13 12

10

05 04

03

02

00

01

Bits:

PLC Word

When a module transmits data over its asynchronous link,
it transmits one byte at a time. The module always transmits the low
byte (bits 00 through 07) of a word before the high byte (bits 10
through 17) of the same word. Also, the Universal Asynchronous
Receiver/Transmitter
(UART) transmits the low bit first within a
byte.

00 01

06

02 03 04 05

07

First Byte

Bits:

10 11

16

12 13 14 15

17

Second Byte

This does not present a problem at PLC nodes on the link because
PLC processors store and retrieve their data in this same order of low
byte first. Depending on the type of computer, however, you may
have to do some extra computer application programming to
maintain the proper byte and word order in PLC data stored in the
computer. Three factors that can influence the ability of your
computer to handle PLC 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

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,
design your application programs to make the proper conversions
from PLC word addresses to computer word addresses.
When stored in a computer, each PLC word should start on an even
byte boundary. The following figures show 16-bit words in PLC and
computer memory. (In all cases, the address of a word is the address
of the even byte—assuming that each word is properly aligned on an
even boundary.)

Order of Transmission

Advertising