114
11. Appendix E: Modbus Commands
Chapter 6.11 Adding and Setting Up a Modbus Command, page 62, also shows a few examples of
correspondences between the elements displayed in AbcConf and the corresponding Modbus frame fields.
See also: Chapter 6.11.2 With a Generic Modbus Slave, page 63, and chapter 6.11.3 Adding a Special Modbus
Command, page 73, if the implementation of one of these commands would be incompatible with its
implementation in the gateway, for example. You then have to create a special Modbus command to
compensate for this incompatibility.
N.B. here, the notions of “input” and “output” (and assimilated) are irrelevant, as all Modbus commands have
access to all of a Modbus slave’s memory. However, these names are retained in order to comply with the terms
used in the standard Modbus documentation.
11.1. “Read Holding Registers” Command (16#03)
Frame Field Value or properties
Query Starting Address (MSB)
Starting Address (LSB) - Address of the 1st output / internal register
Number of points (MSB)
Number of points (LSB) - Number of output / internal registers
Response Byte count - Number of data bytes = number of output / internal registers × 2
Data (first register / MSB)
Data (first register / LSB)
………
Data (last register / MSB)
Data (last register / LSB)
- Byte swap = “Swap 2 bytes” (or “No swapping”)
- Data length = Value of the “Byte count” field
- Data location = Address in the gateway’s input memory
11.2. “Preset Single Register” command (16#06)
Frame Field Value or properties
Query Register (MSB)
Register (LSB) - Address of the output / internal register
Preset data (MSB)
Preset data (LSB)
- Byte swap = “Swap 2 bytes” (or “No swapping”)
- Data length = 16#0002
- Data location = Address in the gateway’s output memory
Response Register (MSB)
Register (LSB)
Preset data (MSB)
Preset data (LSB)
- Byte swap = “Swap 2 bytes” (or “No swapping”)
- Data length = 16#0002
- Data location = Address in the gateway’s input memory
N.B. This data is an echo to the query. So in most cases there is no need
to feed them back to the DeviceNet master.
Instead of creating a link between the echo of the response to the “Preset Single Register”
command (16#06) and the memory area dedicated to the DeviceNet inputs (16#0002-
16#01FF), you’d better link it with the address 16#0400.