beautypg.com

Word-swapped 32-bit signed bcd format – Rockwell Automation GMLC Reference Manual User Manual

Page 771

background image

Publication GMLC-5.2 - November 1999

734

Using the RIO Adapter Option

The returned values are stored in word pairs 0, 1 through 2nn – 2, 2nn – 1
(where nn is the number of items read) in 2s complement format. The
least significant word of the returned value is stored in the lower
numbered word of the file and the most significant word of the returned
value in the higher numbered word. Since each 32-bit value is stored as
two 16-bit words, 2nn + 1 words in the file are used.

Word-Swapped 32-bit Signed BCD Format

When the most significant digit of word 2 in the BTW data file is 6,
values are transferred as signed 32-bit (8-digit) BCD numbers. In the PLC
data file, each 32-bit value is stored as two contiguous 16-bit integers.
The sign bit is the most significant bit of the most significant word and is
0 if the value is positive and 1 if it is negative. This format is identical to
the 32-bit signed BCD format described earlier except for the order of the
words in the data files. See 32-bit Signed BCD Format in this chapter for
information on the range, precision, and conversion of values.

If the PLC is sending data to the motion controller, the remainder of the
BTW data file (words 3 through 2nn+2, where nn is the number of items
to be sent) contains the values of the specified items, and the last word
(word 2nn+3) is the end-of-block delimiter, as shown below.

2

nn-2

2

nn-1

Last Data Item Value Least Significant Word
Last Data Item Value Most Significant Word

2

nn

End-of-Block Delimiter (000D Hex)

RIO Adapter Block Transfer Read
Word-Swapped 32-bit Integer Returned Values Data File Format

Word

Description

RIO Adapter Block Transfer Write
Word-Swapped 32-bit Signed BCD Data File Format

Word

Description

0
1
2

Data Type
First Data Item
Number and Format of Items: 6

dnn