def __init__(self,ServerIp,ServerPort,usePlcTimeout=True,plcTimeout = 5): client.__init__(self,ServerIp,ServerPort) self.serverIp = ServerIp self.serverPort = ServerPort self.plcTimeout = plcTimeout self.usePlcTimeout = usePlcTimeout self.__timingFlag = False self.__timeoutFlag = False self.regCodes = {"processedTrays":4014, "classifiedSeedlings":4015, "currentASeedlings":4016, "currentBSeedlings":4017, "currentCSeedlings":4018, "totalATrays":4019, "totalBTrays":4020, "totalCTrays":4021, "currentXPos":4022, "currentYPos":4024, "currentZ1Pos":4026, "currentZ2Pos":4028, "currentZ3Pos":4030, "currentFeederTrayPos":4032, "currentATrayPos":4034, "currentBTrayPos":4036, "currentCTrayPos":4038, "currentNeedlesX":4040, "currentNeedlesY":4042, "gripperStatus":4044, "alarms":4045, "plcInstruction":4046, "detectedSeedlings": 4047, "cvStatus":4101, "seedling1Quality":4102, "seedling2Quality":4103, "seedling3Quality":4104}
def __init__(self, priv_key=PRIV_KEY, **kwargs): ModbusTcpClient.__init__(self, **kwargs) self._fifo = bytes() self._priv_key = priv_key self._key = None self._orig_recv = self._recv self._orig_send = self._send self._key_date = date.today()
def __init__(self, host, port, slave_address): self.host = host self.port = port self.slave_address = slave_address ModbusTcpClient.__init__(self, host=host, port=port) if not self.connect(): raise ConnectionError('Cannot connect to {0}:{1}'.format( host, port))
def __init__(self, host, port, mode, verbose=0): if mode == 'tcp': framer = ModbusSocketFramer elif mode == 'rtu-over-tcp': framer = ModbusRtuFramer else: raise ValueError(f"'{mode}' is not supported.") _ModbusClient.__init__(self, host=host, port=port, framer=framer)
def __init__(self, *args, **kwargs): ''' Constructor default modbus port is 502''' #ip address self.addr = args[0] ModbusTcpClient.__init__(self, self.addr) self.connect()
def __init__(self, host, port=PORT): ModbusTcpClient.__init__(self, host=host, port=port) SyncResource.__init__(self, name=host)
def __init__(self, address, port = MODBUS_PORT): ModbusTcpClient.__init__(self, address, port)
def __init__(self, host, port, verbose=0): _ModbusClient.__init__(self, host=host, por=port)
def __init__(self, **kwargs): ModbusTcpClient.__init__(self, **kwargs) self._fifo = bytes() self._key = None