This commit is contained in:
mino 2022-07-12 14:22:37 +02:00
parent ec978ec9d5
commit 39b073ac40
4 changed files with 5 additions and 4 deletions

View File

@ -52,7 +52,7 @@ class ModbusComponent(Component):
read = self.client.read_holding_registers(register, count=count)
self.lock.unlock()
if read.isError():
self.log.exception(traceback.format_exception(read))
self.log.exception(traceback.format_exception(type(read), read, read.__traceback__))
return None
return read
@ -61,7 +61,7 @@ class ModbusComponent(Component):
wrote = self.client.write_registers(register, value, skip_encode=True)
self.lock.unlock()
if wrote.isError():
self.log.exception(traceback.format_exception(wrote))
self.log.exception(traceback.format_exception(type(wrote), wrote, wrote.__traceback__))
return False
return True

View File

@ -129,6 +129,7 @@ class TecnaMarpossProvasetT3(ModbusComponent):
# "pressure_ramp": self.pressure_ramp_sb,
# "stabilization_cycles": self.stabilization_cycles_sb,
recipe = {
"Selection number of test table on which you intend to work": table,
"Type of test": "LEAK TEST",
# "Test flags": recipe.spec[""],
"T0 - Pre-filling time": recipe.spec["pre_filling_time"],

View File

@ -2,7 +2,7 @@ import pymodbus.exceptions
import serial
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
client = ModbusClient(method="rtu", port="COM3", stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, baudrate=115200, timeout=1, strict=False)
client = ModbusClient(method="rtu", port="/dev/ttyUSB0", stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, baudrate=115200, timeout=1, strict=False)
status = client.connect()
read_data = client.read_holding_registers(1, count=1)
if type(read_data) is not pymodbus.exceptions.ModbusIOException:

View File

@ -28,7 +28,7 @@ class Test_Leak(Test_Test):
super().get([{
"time": data.get("time", None),
"results": {
"ok": type(data["tecna_t3"]["Running test: result"]) is str and "passed" in data["tecna_t3"]["Running test: result"].lower(),
"ok": False and type(data["tecna_t3"]["Running test: result"]) is str and "passed" in data["tecna_t3"]["Running test: result"].lower(),
"result": data["tecna_t3"]["Running test: result"],
"data": data["tecna_t3"],
},