13. Appendix F: Modbus Commands
Only the Modbus commands shown in the
Function code | Broadcast (1) | Modbus command | |
|
|
|
|
3 | 16#03 | — | Read Holding Registers |
|
|
|
|
6 | 16#06 | Yes | Preset Single Register |
|
|
|
|
16 | 16#10 | Yes | Preset Multiple Registers |
|
|
|
|
(1)The content of this column shows whether the command can be added (“Yes”) or not
In the following chapters, each byte of the query and response frames of a Modbus command are described, one after another, with the exception of the fields shown opposite. These are always present in the queries and responses of all Modbus commands.
The “Slave Address” and “Function” fields are the first two bytes of these frames. The two bytes of the “Checksum” are their last two bytes.
Slave Address | - Value cannot be changed (Modbus | |
address: 1 to 247. Addresses 125, | ||
| 126, and 127 prohibited) | |
Function | - Value cannot be changed (code of | |
the Modbus command) | ||
| ||
… Other | … Specific features of | |
fields … | Modbus commands … | |
Checksum (Lo) | - Type of error check | |
Checksum (Hi) | - Number of the 1st byte checked |
The descriptions of the Modbus frames which appear in the following chapters are mainly intended to help you to configure the gateway’s Modbus exchanges using AbcConf. Please see the documentation of each Modbus slave to check for any restriction regarding these frames (number of registers which can be read or written in a single Modbus command, for example).
It is a better idea to get hold of a standard Modbus document, such as the guide entitled Modicon Modbus Protocol Reference Guide (ref.:
| Elements under AbcConf |
Modbus | Slave Address |
query | Function |
| Starting Address (Hi, Lo) |
| Number of points (Hi, Lo) |
| Checksum |
Modbus |
|
Slave Address | |
response | Function |
| Byte count |
| Data |
|
|
| Checksum |
Modbus frame fields
Slave no.
Function no.
No. of the 1st word (MSB / LSB)
Number of words (MSB / LSB)
CRC16 (LSB / MSB)
Slave no.
Function no.
Number of bytes read
Value of 1st word (MSB / LSB)
…………………………………
Value of last word (MSB / LSB)
CRC16 (LSB / MSB)
Size
1byte
1byte
2 bytes
2 bytes
2 bytes
1byte
1byte
1byte
2 bytes
…………
2bytes
2bytes
109