/// <summary> /// Method for checking if port number of new meter is uniq /// </summary> /// <param name="portNumber">portNumber to check</param> /// <param name="portNumber">unitId to check</param> /// <returns>is portNumber uniq</returns> public Boolean CheckNewPortNumberAndUnitId(int portNumber, byte unitId) { if (portNumber <= 0 || unitId <= 0) { return(false); } //There should be no device with the same combination - unitId/portNumber return(ModbusFactory.GetDevice(portNumber, unitId) == null); }