Word-swapped 32-bit integer format – Rockwell Automation GMLC Reference Manual User Manual
Page 769

Publication GMLC-5.2 - November 1999
732
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) as 16-bit integers. The most
significant word of the returned value is stored in the lower numbered
word of the data file, and the least significant word of the returned value
is stored 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.
Use a File Copy instruction in the PLC program after the BTR to transfer
the values from the integer BTR data file to a floating bit file for use by
the PLC. For example, the following rung copies words 0 and 1 (16 bits
each) of the integer file N7 (block transferred to the PLC as shown in
Getting Data from the Motion Controller in this chapter) to word 0 (32
bits) of floating bit file F16.
|
BTR
|
|
ENABLE
|
|
N10:5
+-COP-------------------+
|
+----] [--------------------------------+ COPY FILE
+------+
|
15
| Source
#N7:0 |
|
|
| Destination
#F16:0 |
|
|
| Length
1 |
|
|
+-----------------------+
|
|
|
With 32-bit floating-point numeric format, the largest value that can be
represented is ±1 x 10
38
and the smallest is ±1 x 10
-38
.
Word-Swapped 32-bit Integer Format
When the most significant digit of word 2 in the BTW data file is 4,
values are transferred as 32-bit 2s complement integers. In the PLC data
file, each 32-bit value is stored as two contiguous 16-bit integers. This
format is identical to the 32-bit integer format described earlier except the
order of the words in the data files. See 32-bit Integer Format in this
chapter for information on the range, precision, and conversion of values.
2
nn
End-of-Block Delimiter (000D Hex)
RIO Adapter Block Transfer Read
32-bit Floating-Point Returned Values Data File Format
Word
Description