Register value out of range : 65280
Hello I have problem with last version jlibmodbus 1.2.9.7 when I use function x05 WriteSingleRegister in public void setValue(int value) throws ModbusNumberException { if (!Modbus.checkRegisterValue(value)) { throw new ModbusNumberException("Register value out of range", value); } this.value = ((short) value) & 0xffff; } I take error Register value out of range : 65280 in method static public boolean checkRegisterValue(int value) { return checkRange((short)value, 0, Modbus.MAX_REGISTER_VALUE); }
And I fix the checkRange(value, 0, Modbus.MAX_REGISTER_VALUE) after that it worked for me Did this right or not help me?
I just had to do the same thing, remove the 'short' cast. and so far it's working fine for me.
Having the same issue, using writeMultipleCoils as a workaround...
Yes. It is a bug. Please make a pull request.