Try these steps:
- Create Modbus Serial data source
- Create numeric point as Holding Register and 2 byte signed integer
- Make this point writable
4. Set multiplier to 0.1 for this point
Isuue:
Try to write 12.7 to this point. Actually written value is 126 (instead of 127).
I think problem is in method setPointValue() of class ModbusDataSource.
...
if (dataPoint.getDataTypeId() == DataTypes.NUMERIC) {
double convertedValue = valueTime.getDoubleValue();
convertedValue -= pl.getVO().getAdditive();
convertedValue /= pl.getVO().getMultiplier();
modbusMaster.setValue(ml, convertedValue);
}
...
convertedValue gets 126.99999999999999. Fractional part of this value gets lost in method modbusMaster.setValue().