45
ICC
In contrast, Figure 15 shows the effects of configuring the database for little-
endian byte order. Holding registers 1 and 2 again have values of 0x1234 and
0x5678, respectively. However, when the PROFIBUS device receiving the input
data from the gateway interprets these values, the resulting pairs of 2-byte
values become 0x3412 and 0x7856, thus receiving incorrect values for holding
registers 1 and 2. Note that in both examples, the PROFIBUS network data is
always identical, byte-for-byte, to the gateway’s database. For this reason it is
important to configure gateways that use a bag-of-bytes style network, such as
the PBDP-1000, to use the same endianness as defined for that network.
Figure 15: Modbus - PROFIBUS Little Endian
12.2
Modbus - DeviceNet Example
This example shows the interaction between a network using an object value
method (Modbus) and one using a bag of bytes method (DeviceNet) to exchange
data. The gateway reads holding registers 1 and 2 from the Modbus network,
stores the data into the database, and then sends the 4 bytes of input data onto
the DeviceNet network. Figure 16 shows this data movement for the gateway’s
database configured as little endian. Because the DeviceNet specification
defines multi-byte values within the byte array to be interpreted as little endian, it
is recommended that the database be configured for little-endian byte order
when using DeviceNet. In the example, holding register 1 has a value of 0x1234
and holding register 2 has a value of 0x5678. When the DeviceNet device
receiving the input data from the gateway recombines the two pairs of 2-byte
values, the resulting data is 0x1234 and 0x5678, thus successfully receiving the
correct values for holding registers 1 and 2.