43
ICC
Similarly, data is retrieved from the database starting at the low address. The
endianness decides whether the first byte is interpreted as the least-significant
byte or the most-significant byte of the multi-byte number.
Here are some examples that demonstrate this. Figure 12 shows how the hex
value 0x12345678 is retrieved from the database using a big endian byte order.
Since the hex value 12 is at address “a”, the lowest address, it is the most
significant byte.
Figure 12: Big Endian Retrieval
Figure 13 demonstrates how the hex value 0x12345678 is retrieved from the
database using a little endian byte order. Since the hex value 78 is at the lowest
address, it is the least significant byte.
Figure 13: Little Endian Retrieval
The above examples illustrate the data movement to and from the gateway’s
internal database. This idea helps explain the data movement, as a whole, from
one port to the other on the gateway between two different networks. Because
networks vary in the manner that they exchange data, endianness selection must
be part of the gateway’s configuration in order to ensure coherent multi-byte data
exchange. There are two data exchange methods used by the supported
networks of the gateway.
The first method is used in those networks that define a byte order for how to
interpret multi-byte data within an array of bytes. PROFIBUS, for example,
defines a big-endian order for multi-byte data, while DeviceNet defines a little-
endian order for multi-byte data. These networks exchange I/O data by means of
a “bag of bytes” approach, whereas the gateway need not concern itself with
where individual values are delimited within the array of bytes itself (as this is
determined by the sending or receiving nodes on the networks). The bytes are