wip
This commit is contained in:
parent
ec978ec9d5
commit
39b073ac40
@ -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
|
||||
|
||||
|
||||
@ -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"],
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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"],
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user