def __init__(self, id, params): modbus_addr = 1 modbus_func = 3 # some more Eaton specific information self.reg_addr = 999 self.sensors = [ ("Voltage[AN]", "V"), ("Voltage[BN]", "V"), ("Voltage[CN]", "V"), ("Voltage[AB]", "V"), ("Voltage[BC]", "V"), ("Voltage[CA]", "V"), ("Current[A]", "A"), ("Current[B]", "A"), ("Current[C]", "A"), ("RealPower[Total]", "W"), ("ReactivePower[Total]", "VA"), ("ApparentPower[Total]"), ("PowerFactor[Total]", "%"), ("Frequency", "Hz"), ("Current[Neutral]", "A"), ("RealPower[A]", "W"), ("RealPower[B]", "W"), ("RealPower[C]","W"), ("ReactivePower[A]", "VA"), ("ReactivePower[B]", "VA"), ("ReactivePower[C]", "VA"), ("ApparentPower[A]", "VA"), ("ApparentPower[B]", "VA"), ("ApparentPower[C]", "VA"), ("PowerFactor[A]", '%'), ("PowerFactor[B]", "%"), ("PowerFactor[C]", "%") ] super(EatonIQ260,self).__init__("EatonIQ260", id, modbus_addr, modbus_func, params) self.i = 0 if not hasattr(self,'port'): self.port=4660 if not hasattr(self,'host'): logging.error("no host name or IP address specified for device %s:%s"%(self.type,self.id)) exit(1) if not hasattr(self, 'timeout'): self.timeout = 2 self.circuit_names_map = self.params.get('circuit_names_map',{}) for (i,s) in enumerate(self.sensors): self.sensors[i] = (self.circuit_names_map.get(s[0],s[0]),s[1]) debug_mesg("Created EatonIQ260 Device with id: "+id)
def __init__(self, type, id, mbaddr, mbfunc, params): super(TCPModbusDevice,self).__init__(type, id, params) self.modbus_addr = mbaddr self.modbus_func = mbfunc if not hasattr(self,'port'): self.port=4660 if not hasattr(self,'host'): logging.error("no host name or IP address specified for device %s:%s"%(self.type,self.id)) exit(1) if not hasattr(self, 'timeout'): self.timeout = 2 self.is_connect = False #maintain status of socket connection debug_mesg("Created ModbusDevice with id: "+id)
def __init__(self, type, id, mbaddr, mbfunc, params): super(TCPModbusDevice, self).__init__(type, id, params) self.modbus_addr = mbaddr self.modbus_func = mbfunc if not hasattr(self, 'port'): self.port = 4660 if not hasattr(self, 'host'): logging.error( "no host name or IP address specified for device %s:%s" % (self.type, self.id)) exit(1) if not hasattr(self, 'timeout'): self.timeout = 2 self.is_connect = False #maintain status of socket connection debug_mesg("Created ModbusDevice with id: " + id)
def __init__(self, id, params): modbus_addr = 1 modbus_func = 3 # some more Eaton specific information self.reg_addr = 999 self.sensors = [("Voltage[AN]", "V"), ("Voltage[BN]", "V"), ("Voltage[CN]", "V"), ("Voltage[AB]", "V"), ("Voltage[BC]", "V"), ("Voltage[CA]", "V"), ("Current[A]", "A"), ("Current[B]", "A"), ("Current[C]", "A"), ("RealPower[Total]", "W"), ("ReactivePower[Total]", "VA"), ("ApparentPower[Total]"), ("PowerFactor[Total]", "%"), ("Frequency", "Hz"), ("Current[Neutral]", "A"), ("RealPower[A]", "W"), ("RealPower[B]", "W"), ("RealPower[C]", "W"), ("ReactivePower[A]", "VA"), ("ReactivePower[B]", "VA"), ("ReactivePower[C]", "VA"), ("ApparentPower[A]", "VA"), ("ApparentPower[B]", "VA"), ("ApparentPower[C]", "VA"), ("PowerFactor[A]", '%'), ("PowerFactor[B]", "%"), ("PowerFactor[C]", "%")] super(EatonIQ260, self).__init__("EatonIQ260", id, modbus_addr, modbus_func, params) self.i = 0 if not hasattr(self, 'port'): self.port = 4660 if not hasattr(self, 'host'): logging.error( "no host name or IP address specified for device %s:%s" % (self.type, self.id)) exit(1) if not hasattr(self, 'timeout'): self.timeout = 2 self.circuit_names_map = self.params.get('circuit_names_map', {}) for (i, s) in enumerate(self.sensors): self.sensors[i] = (self.circuit_names_map.get(s[0], s[0]), s[1]) debug_mesg("Created EatonIQ260 Device with id: " + id)
def __init__(self, id, params): modbus_addr = 1 modbus_func = 3 # some more Veris specific information self.max_meter_count = 42 # specifications of meters # (base_register, count, name, unit) self.meter_types = [(2083, "RealPower", "kW"), (2167, "PowerFactor", "%"), (2251, "Current", "A")] super(VerisE30A042, self).__init__("VerisE30A042", id, modbus_addr, modbus_func, params) self.i = 0 if not hasattr(self, 'port'): self.port = 4660 if not hasattr(self, 'host'): logging.error( "no host name or IP address specified for device %s:%s" % (self.type, self.id)) exit(1) if not hasattr(self, 'timeout'): self.timeout = 2 self.circuit_names_map = self.params.get('circuit_names_map', {}) self.sensors = self.params.get( 'sensors', [str(i + 1) for i in range(self.max_meter_count)]) for (i, s) in enumerate(self.sensors): if s == False: self.sensors[i] = None if len(self.sensors) > self.max_meter_count: # truncate list of sensors self.sensors = self.sensors[0:self.max_meter_count] elif len(self.sensors) < self.max_meter_count: # no need to read all the meters self.max_meter_count = len(self.sensors) debug_mesg("Created VerisE30A042 Device with id: " + id)