diff --git a/socs/agents/hi6200/agent.py b/socs/agents/hi6200/agent.py index ed3cca6c6..81ffa1ab8 100644 --- a/socs/agents/hi6200/agent.py +++ b/socs/agents/hi6200/agent.py @@ -40,8 +40,17 @@ def init(self, session, params=None): if not acquired: return False, "Could not acquire lock" +<<<<<<< HEAD self.scale = Hi6200Interface(self.ip_address, self.tcp_port) +======= + try: + self.scale = Hi6200Interface(self.ip_address, self.tcp_port) + + except BaseException: + self.log.error(f"Some unknown error occurred initializing TCP Server") + return False, "TCP Failure" +>>>>>>> refs/remotes/origin/add_Hi6200_Agent self.log.info("Connected to scale.") return True, 'Initialized Scale.' @@ -70,6 +79,10 @@ def monitor_weight(self, session, params=None): } try: +<<<<<<< HEAD +======= + +>>>>>>> refs/remotes/origin/add_Hi6200_Agent data['data']["Gross"] = self.scale.read_scale_gross_weight() data['data']["Net"] = self.scale.read_scale_net_weight() @@ -79,6 +92,10 @@ def monitor_weight(self, session, params=None): session.data = data except ValueError as e: +<<<<<<< HEAD +======= + +>>>>>>> refs/remotes/origin/add_Hi6200_Agent self.log.error(f"Scale responded with an anomolous number, ignorning: {e}") except AttributeError as e: diff --git a/socs/agents/hi6200/drivers.py b/socs/agents/hi6200/drivers.py index 922e28402..4d9b6117b 100644 --- a/socs/agents/hi6200/drivers.py +++ b/socs/agents/hi6200/drivers.py @@ -1,11 +1,19 @@ -from pyModbusTCP.client import ModbusClient import struct +<<<<<<< HEAD +======= +from pyModbusTCP.client import ModbusClient + +>>>>>>> refs/remotes/origin/add_Hi6200_Agent class Hi6200Interface(): """ The Hi6200 Weight Processor uses a Modbus TCP Interface to communicate. +<<<<<<< HEAD +======= + +>>>>>>> refs/remotes/origin/add_Hi6200_Agent The Gross and Net weight sensors are always available to read on the 8,9 and 6,7 registers respectively. """ @@ -13,6 +21,10 @@ def __init__(self, ip_address, tcp_port, verbose=False, **kwargs): """ Connects to the Hi6200 weight sensor using a TCP Modbus Client with pyModbusTCP. This works ~similarly to a socket connection using a IP and port. +<<<<<<< HEAD +======= + +>>>>>>> refs/remotes/origin/add_Hi6200_Agent ModbusClient will not throw errors upon incorrect ip_address! ModbusClient will also allow multiple recconects unlike a socket. """