do stuff only for DataPoints who have a register
This commit is contained in:
		| @@ -95,6 +95,8 @@ public class FieldConnector implements DataPointListener { | |||||||
|     @Override |     @Override | ||||||
|     public void onNewValue(DataPoint dp) { |     public void onNewValue(DataPoint dp) { | ||||||
|         ModbusRegister mR = ModbusRegister.getRegisterFromDatapoint(dp);    //search the corresponding register to the datapoint |         ModbusRegister mR = ModbusRegister.getRegisterFromDatapoint(dp);    //search the corresponding register to the datapoint | ||||||
|  |         if(mR == null) return; //if the register is not found, return | ||||||
|  |  | ||||||
|         if(dp.isOutput()){  //write only on the datapoints, which are outputs |         if(dp.isOutput()){  //write only on the datapoints, which are outputs | ||||||
|             if(dp.getLabel().equals("REMOTE_SOLAR_SW")      //write only boolean outputs |             if(dp.getLabel().equals("REMOTE_SOLAR_SW")      //write only boolean outputs | ||||||
|                 ||dp.getLabel().equals("REMOTE_WIND_SW") |                 ||dp.getLabel().equals("REMOTE_WIND_SW") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user