Modbus 6 digit addressing
-
Matthew,
Do you know how big a deal it would be for Modbus4J to support both 5 digit and 6 digit addressing?
Regards,
Fred
-
I don't believe the protocol supports it.
-
I'll defer to your expertise in this area as I am absolutely not an authority on Modbus.
I had asked because I had seen numerous references to products accessing holding registers in the 400000-499999 range. I assumed this was due to an evolution in the protocol.
I did find this doc on the web that shed some additional light:
Thanks.
-
Ah, right. Now i recall. I was always a bit put off by that spec inconsistency. In any case it looks like Modbus4J should allow "6 digit" addressing, but in an indirect way.
When you create do a read from a ModbusMaster or create a locator with RangeAndOffset object, you're subject to a 0-9999 constraint. The constructor has this comment:
This constructor provides a best guess at the function and offset the user wants, with the assumption that the offset will never go over 9999.
But, you can also specify the range and offset separately, in which case the offset is subject to a 0-65535 range. There shouldn't be any reason why this won't work.
-
Ok, I was looking for support pretty much from the slave side only. I assume that would just be to relax the offset validation in the ProcessImage class. I'll try that and see what happens.
Thanks.