Modbus Addressing Documentation - 6 digits

Hello.
I think the Ignition documentation regarding Modbus Addressing should be updated.
I explain:
On these pages it is implied that memory addresses have 5 digits: 0000X, 1000X, 3000X or 4000X:

https://docs.inductiveautomation.com/display/DOC81/Modbus+Addressing

https://docs.inductiveautomation.com/display/DOC81/Modbus+Address+Mapping

But this is very confusing. For example, a holding register with address 30150 would be expressed with 6 digits: 430150. In Ignition: HR30150.
In fact, all new implementations are recommended to use 6-digit addressing with leading zeros.

Best Regards.

There's some history here.

In traditional modbus addressing, the format is five digits, where the first digit is a prefix for the memory area: '0' for writable coils, '1' for readonly discrete inputs, '3' for readonly input registers, and '4' for writable holding registers. { There's also '6' for extended file registers, but that is not supported by most devices and drivers. }

The key point is that the leading '0', '1', '3', and '4' are prefixes, not otherwise treated as numbers.

So the patterns were 0xxxx, 1xxxx, 3xxxx, and 4xxxx. The "x" is a decimal integer, originally constrained to 1-9999 (four "x"s). The underlying wire protocol uses a 16-bit binary number to carry "x", and it starts with zero instead of one.

The discrepancy between displayed "x" and "x" on the wire, with adoption by multiple brands before the protocol was really standardized, created some varying implementations.

First, some implementations wanted a nice even ten thousand registers, but still in five total digits, so they made their stuff start with "x" = 0, both on the wire and as displayed.

Then, other implementations wanted to use the full 16-bit range (including Modicon themselves), so they made it six total digits, with "x" from 1 to 65,536.

Then, some more implementations adopted the six digit format, but from 0-65,535, identical to the number on the wire.

Ignition replaces the confusing numeric prefixes with alphabetic prefixes, and therefore allows you to omit the no-longer-needed leading zeros in "x". Ignition still defaults to "x" starting with one, but there's a driver setting to use "x" starting from zero.

Ignition also allows variations on the alphabetic prefixes to manipulate the values on your behalf, including interpreting multiple registers together.

2 Likes

Although ignition's manual is already very detailed, there is still room for improvement. I mean, it should be stated here that sometimes five digits are used for modbus addresses and sometimes six. In fact, the manuals of different modbus devices have different usages. The addressing instructions here really confused me because the ignition manual and the modbus device manual used different keywords. The modbus protocol is not a strictly standard protocol, or too many devices do not comply with the original standard. Therefore, Ignition can't do too many things, and more situations still need to be figured out by users themselves.

If you don't like Ignition's Modbus driver, you can use mine instead:

I wanted some features IA didn't implement, and it ballooned from there....

{/shameless plug}

Recommendations for updating my module's manual are welcome, too.

Thanks for the detailed answer.