While unit testing a Modbus driver I'm writing I experienced the following:
illegal data address
error code.I would have expected devices supporting Modbus to behave in one of the following two ways:
Do any of you more experienced people know:
illegal data address
?Both assumptions are false. It's completely up to the device to decide which registers to support. Some devices are nice and support a wide range of registers, even if they're unused. Most that I've used don't, though. They'll use groups of registers, like your device.
Also, not all Modbus devices support all the Modbus function codes. Just because it's defined by the Modbus protocol standard doesn't necessarily mean the device will support it.
The key thing is to stick to the addresses defined in the device's manual. The manual is usually required reading, otherwise you'll just be guessing at the ranges, units, and scaling.