Although Modbus tag addresses are specified in the device's manual as 0xxxx, 1xxxx, 3xxxx, or 4xxxx, they will be padded with an extra zero when applied to the Address field. For example, "40001" will become "400001". There is no difference between the two addresses, however. In a Modbus device, the same item can be represented by the following addresses:
Note: In Modbus addressing, the address's first digit specifies the primary table. The remaining digits represent the device's data item. The maximum number of data items is a two byte unsigned integer (65,535). Thus, six digits are required to represent the entire address table and item.
Primary Table | Description |
---|
0 | Output Coils |
1 | Input Coils |
3 | Internal Registers |
4 | Holding Registers |
The difference between the number of digits in the device documentation is due to the evolution of Modbus devices. Early devices generally only supported a maximum of 9999 data items for each address type, whereas newer devices can support a maximum of 65535 data items. For example, "400001" to "465535". Kepware's Modbus drivers support the data items' full range, and will pad any address to six digits in the KEPServerEX User Interface. This will not affect the actual address that is transmitted to the device.