add comments to the field package
This commit is contained in:
@@ -28,17 +28,23 @@ public class FloatRegister extends ModbusRegister{
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* function to read a float datapoint from the modbus register
|
||||
*/
|
||||
public void read() {
|
||||
if(fdp.isOutput()){
|
||||
return; //if it is an output datapoint, it is not read
|
||||
}
|
||||
Float value = ModbusAccessor.getMySelf().readFloat(this.getAddress()); //read the value
|
||||
value = value * range;
|
||||
value = value + offset;
|
||||
value = value * range; //calculate value
|
||||
value = value + offset; //calculate value
|
||||
fdp.setValue(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* function to write a boolean datapoint on the modbus register
|
||||
*/
|
||||
public void write(DataPoint dp) {
|
||||
fdp = (FloatDataPoint) dp; //make the empty datapoint to the desired datapoint, which is to be written on the address
|
||||
value = fdp.getValue(); //store the value of the datapoint
|
||||
|
||||
Reference in New Issue
Block a user