tecna registers fixes
This commit is contained in:
parent
d88adc4588
commit
bf36a6bd90
|
|
@ -0,0 +1,2 @@
|
|||
[tecna_t3]
|
||||
port: /dev/ttyUSB0
|
||||
|
|
@ -22,7 +22,7 @@ python -B -u "./src/main.py" \
|
|||
--sim-camera \
|
||||
--sim-modbus \
|
||||
--sim-os-label-printer \
|
||||
--sim-serial-neo-pixels \
|
||||
--sim-serial \
|
||||
--style windows \
|
||||
$* 2> >(sed $'s/.*/\e[31m&\e[m/' >&2) # &
|
||||
# --about \
|
||||
|
|
@ -34,7 +34,6 @@ $* 2> >(sed $'s/.*/\e[31m&\e[m/' >&2) # &
|
|||
# --no-gui \
|
||||
# --no-tflite \
|
||||
# --sim-archiver \
|
||||
# --sim-serial-label-printer \
|
||||
# --users-management \
|
||||
# sudo renice -n -10 $!
|
||||
# fg
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from .neo_pixels import NeoPixels
|
|||
from .os_label_printer import Os_Label_Printer
|
||||
from .remote_api import RemoteAPI
|
||||
from .serial_label_printer import Serial_Label_Printer
|
||||
from .tecna_marposs_provaset_t3 import TecnaMarpossProvasetT3
|
||||
from .tecna_marposs_provaset_t3p import TecnaMarpossProvasetT3P
|
||||
from .test_component import TestComponent
|
||||
from .vision import Vision
|
||||
from .vision_saver import VisionSaver
|
||||
|
|
|
|||
|
|
@ -1,17 +1,21 @@
|
|||
import sys
|
||||
import traceback
|
||||
|
||||
import serial
|
||||
if "--sim-serial" in sys.argv:
|
||||
from components.dummies.serial import serial
|
||||
else:
|
||||
import serial
|
||||
|
||||
from pymodbus.constants import Endian
|
||||
# from pymodbus.exceptions import ModbusIOException
|
||||
from pymodbus.payload import BinaryPayloadBuilder, BinaryPayloadDecoder
|
||||
from PyQt5.QtCore import QMutex
|
||||
|
||||
if "--sim-modbus" not in sys.argv:
|
||||
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
|
||||
else:
|
||||
from components.dummies.pymodbus import ModbusClient
|
||||
|
||||
from PyQt5.QtCore import QMutex
|
||||
|
||||
from .component import Component
|
||||
|
||||
|
||||
|
|
@ -22,6 +26,7 @@ class ModbusComponent(Component):
|
|||
self.lock = QMutex()
|
||||
|
||||
def config_changed(self):
|
||||
self.method = self.config[self.name].get("method", "rtu").lower()
|
||||
self.port = self.config[self.name]["port"]
|
||||
self.baudrate = int(self.config[self.name]["baudrate"])
|
||||
self.stopbits = getattr(serial, self.config[self.name].get("stopbits", "stopbits_one").upper())
|
||||
|
|
@ -32,14 +37,14 @@ class ModbusComponent(Component):
|
|||
self.timeout = int(self.config[self.name].get("timeout", 1))
|
||||
self.lock.lock()
|
||||
self.client = ModbusClient(
|
||||
method="rtu",
|
||||
method=self.method,
|
||||
port=self.port,
|
||||
stopbits=self.stopbits,
|
||||
bytesize=self.bytesize,
|
||||
parity=self.parity,
|
||||
baudrate=self.baudrate,
|
||||
timeout=self.timeout,
|
||||
strict=False
|
||||
strict=False,
|
||||
)
|
||||
if not self.client.connect():
|
||||
raise ConnectionError("device not reachable (could not connect): {} ({})".format(self.name, self.port))
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import sys
|
||||
import traceback
|
||||
|
||||
if "--sim-serial-neo-pixels" in sys.argv:
|
||||
if "--sim-serial" in sys.argv:
|
||||
from components.dummies.serial import serial
|
||||
else:
|
||||
import serial
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import sys
|
||||
|
||||
if "--sim-serial-label-printer" in sys.argv:
|
||||
if "--sim-serial" in sys.argv:
|
||||
from components.dummies.serial import serial
|
||||
else:
|
||||
import serial
|
||||
|
|
|
|||
|
|
@ -1,223 +0,0 @@
|
|||
registers = {
|
||||
"Instrument type": [1, {"dt": "16bit_uint", }],
|
||||
"Test counter: FAILED": [2, {"dt": "32bit_uint", }],
|
||||
"Test counter: TOTAL TESTS": [4, {"dt": "32bit_uint", }],
|
||||
"Life counter: FAILED": [6, {"dt": "32bit_uint", }],
|
||||
"Life counter: TOTAL TESTS": [8, {"dt": "32bit_uint", }],
|
||||
"Test circuit pressure, in real time": [11, {"dt": "32bit_int", "f": 21, }],
|
||||
"Measured leak, in real time": [13, {"dt": "32bit_int", "f": 22, }],
|
||||
"Regulated pressure, in real time": [15, {"dt": "16bit_int", "f": 23, }],
|
||||
"Active alarm flags": [16, {"dt": "16bit_uint", }],
|
||||
"Relative pressure variable format - high resolution": [21, {"dt": "16bit_uint", }],
|
||||
"Format of the variables related to the measurement of the differential leak pressure": [22, {"dt": "16bit_uint", }],
|
||||
"Relative pressure variable format - low resolution": [23, {"dt": "16bit_uint", }],
|
||||
"Format of the variables related to the calculated leak flow": [24, {"dt": "16bit_uint", }],
|
||||
"Format of volume variables": [25, {"dt": "16bit_uint", }],
|
||||
"Format of time variables": [26, {"dt": "16bit_uint", }],
|
||||
"Format of variables related to flow measurements": [27, {"dt": "16bit_uint", }],
|
||||
"Instrument status: table of parameters in use": [31, {"dt": "16bit_uint", }],
|
||||
"Instrument status: active phase": [32, {"dt": "16bit_uint", "decoding": {
|
||||
0: "NO TEST EXECUTED: WAITING START NEW TEST",
|
||||
10: "TEST IN PROGRESS: CHECK BARCODE CODE (if enabled)",
|
||||
20: "TEST IN PROGRESS: WAITING READING BARCODE CODE (if enabled)",
|
||||
30: "TEST IN PROGRESS: TEST INITIALIZATION",
|
||||
40: "TEST IN PROGRESS: AUTOMATIC CLOSING 1 (CAGE)",
|
||||
50: "TEST IN PROGRESS: AUTOMATIC CLOSING 2 (PLUG)",
|
||||
60: "TEST IN PROGRESS: ACTIVE TEST PROGRAM INITIALIZATION",
|
||||
70: "TEST IN PROGRESS: WAITING ACKNOWLEDGE WITH BI-START COMMAND (if used)",
|
||||
80: "TEST IN PROGRESS: WAITING DELAY (PSDEL parameter)",
|
||||
90: "TEST IN PROGRESS: WAITING CONSENT SIGNAL (PSIN parameter)",
|
||||
100: "TEST IN PROGRESS: PHASE T0 - PRE-FILLING",
|
||||
110: "TEST IN PROGRESS: PHASE T1 - FILLING",
|
||||
120: "TEST IN PROGRESS: PHASE T2 - ASSESTMENT",
|
||||
130: "TEST IN PROGRESS: PHASE T3- SIZE",
|
||||
140: "TEST IN PROGRESS: WAITING CONFIRMATION EXAMINED BY OPERATOR (if used)",
|
||||
150: "TEST IN PROGRESS: TEST RESULT PRESENT",
|
||||
160: "TEST IN PROGRESS: MARKING (only if last table of a sequence or not in sequence mode)",
|
||||
170: "TEST IN PROGRESS: PRESSURE DISCHARGE",
|
||||
180: "TEST IN PROGRESS: END OF TESTING TABLE - IF IN SEQUENCE MODE THE CYCLE STARTS FROM",
|
||||
# PHASE 60 WITH THE NEXT TABLE OF THE SEQUENCE
|
||||
190: "TEST IN PROGRESS: AUTOMATIC OPENING 2 (BUFFER)",
|
||||
200: "TEST IN PROGRESS: AUTOMATIC OPENING 1 (CAGE)",
|
||||
210: "TEST TERMINATED: WAITING THE START OF A NEW TEST",
|
||||
}, }],
|
||||
"Running test: active phase backwards time": [33, {"dt": "16bit_uint", "f": 26, }],
|
||||
"Running test: T1 phase end pressure": [34, {"dt": "32bit_int", "f": 21, }],
|
||||
"Running test: T2 phase end pressure": [36, {"dt": "32bit_int", "f": 21, }],
|
||||
"Running test: burst pressure": [38, {"dt": "32bit_int", "f": 21, }],
|
||||
"Running test: measured leak": [40, {"dt": "32bit_int", "f": 22, }],
|
||||
"Running test: calculated leak flow rate": [42, {"dt": "32bit_int", "f": 24, }],
|
||||
"Running test: calculate RVP%": [44, {"dt": "32bit_int", }],
|
||||
"Running test: result": [46, {"dt": "16bit_uint", "decoding": {
|
||||
0: None,
|
||||
1: "LEAK TEST PASSED",
|
||||
2: "BURST TEST PASSED WITH BURST",
|
||||
3: "BURST TEST PASSED WITHOUT BURST",
|
||||
4: "not used",
|
||||
5: "BLOCKAGE TEST PASSED",
|
||||
100: "LEAK TEST FAILED - UPPER LIMIT",
|
||||
101: "LEAK TEST - FAILED ANOMALY",
|
||||
102: "LEAK TEST - MAXIMUM LEAK FAILED",
|
||||
103: "BURST - BREAKAGE PRESSURE DEFLECTION",
|
||||
104: "VOLUMETRIC CONTROL - RVP% FAILED",
|
||||
105: "not used",
|
||||
106: "not used",
|
||||
107: "BLOCKAGE - MAX PRESSURE FAILED",
|
||||
108: "BLOCKAGE - MIN PRESSURE FAILED",
|
||||
109: "BURST - MINIMUM PRESSURE FAILED",
|
||||
200: "LEAK TEST FAILED - PR% PRESSURE MINUM",
|
||||
201: "LEAK TEST FAILED - PR% PRESSURE MAX",
|
||||
202: "LEAK TEST FAILED - P0% PRESSURE MINUM",
|
||||
203: "LEAK TEST FAILED - P0% PRESSURE MAX",
|
||||
204: "ERROR - INTERNAL ALARMS",
|
||||
205: "ERROR - RELATIVE PRESSURE OUT OF RANGE",
|
||||
206: "ERROR - DIFFERENTIAL PRESSURE OUT OF RANGE",
|
||||
207: "ERROR - PRE-FILLING VALVE NOT OPENED",
|
||||
250: "TEST ABORTED",
|
||||
}, }],
|
||||
"Running test: type of test": [47, {"dt": "16bit_uint", "decoding": {
|
||||
0: None,
|
||||
1: "LEAK TEST",
|
||||
2: "BLOCKAGE TEST",
|
||||
3: "LEAK TEST WITH VOLUME CHECK",
|
||||
4: "BURST TEST",
|
||||
}, }],
|
||||
"Testing in progress: progressive sequence index": [48, {"dt": "16bit_uint", }],
|
||||
"Testing in progress: graphical sampling rate": [49, {"dt": "16bit_uint", }],
|
||||
"Testing in progress: number of samples of the graph": [50, {"dt": "16bit_uint", }],
|
||||
# ------------------------- COMMANDS -------------------------
|
||||
"Start testing": [101, {"dt": "16bit_uint", }],
|
||||
# Write a value of 0 to use the selected test table.
|
||||
# Write a value from 1 to 100 to start testing with the desired table.
|
||||
"Stop the test in progress": [102, {"dt": "16bit_uint", }],
|
||||
"Activate digital output": [103, {"dt": "16bit_uint", }],
|
||||
# Write a number from 1 to 16 to activate the corresponding digital output (the output must be set as "Free")
|
||||
"Reset specific digital output": [104, {"dt": "16bit_uint", }],
|
||||
# Write a number from 1 to 16 to disable the relative digital output (the output must be set as "Free")
|
||||
"Activate digital output (mask)": [105, {"dt": "16bit_uint", }],
|
||||
# Write 1 in the bit corresponding to the output to be activated
|
||||
"Reset digital output (mask)": [106, {"dt": "16bit_uint", }],
|
||||
# Write 1 in the bit corresponding to the output to be deactivated
|
||||
"Reset test counter": [107, {"dt": "16bit_uint", }],
|
||||
# ------------------------------------------------------------
|
||||
"DISLPAY and SOUND: Language": [601, {"dt": "16bit_uint", }],
|
||||
# 0=ITALIANO
|
||||
# 1=ENGLISH
|
||||
"INSTRUMENT SETTING: Test table from": [602, {"dt": "16bit_uint", "encoding": {
|
||||
"PARAMETER": 0,
|
||||
"PLC BASE 1": 1,
|
||||
"PLC BASE 2": 2,
|
||||
}, "decoding": {
|
||||
0: "PARAMETER",
|
||||
1: "PLC BASE 1",
|
||||
2: "PLC BASE 2",
|
||||
}, }],
|
||||
"INSTRUMENT SETTING: Selected table": [603, {"dt": "16bit_uint", }],
|
||||
"INSTRUMENT SETTING: Various flags": [605, {"dt": "16bit_uint", }],
|
||||
# | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
||||
# | | | | | | | | | | | | F5 | F4 | | F2 | F1 |
|
||||
# F1: 1=START front button enabled
|
||||
# F2: 1=DEMO mode
|
||||
# F4: 1=Request RESET if it is passed
|
||||
# F5: 1=Request RESET if failed result
|
||||
"MEASURE UNITS: pressure measure units": [606, {"dt": "16bit_uint", }],
|
||||
# 0=mH2O 1=mbar 2=kPa 3=mmHg 4=inH2O 5=psi 6=mmH2O (se fondoscala <=6 bar)
|
||||
"MEASURE UNITS: Leak measure units": [607, {"dt": "16bit_uint", }],
|
||||
# 0=mmH2O 1=mbar 2=Pa 3=mmHg 4=inH2O 5=psi
|
||||
"MEASURE UNITS: leak flow rate measure units": [608, {"dt": "16bit_uint", }],
|
||||
# 0=cm3/min 1=cm3/h
|
||||
"MEASURE UNITS: Volume": [609, {"dt": "16bit_uint", }],
|
||||
# 0=litri 1=cm3
|
||||
"MEASURE UNITS: Flow rate measure units": [617, {"dt": "16bit_uint", }],
|
||||
# 0=liters/min 1=liters/h 2=m3/h
|
||||
"AUTOMATION: Cage - closing time": [618, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"AUTOMATION: Cage - opening time": [619, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"INSTRUMENT SETTINGS: MAX pressure": [620, {"dt": "16bit_uint", }],
|
||||
"AUTOMATION: Buffer - closing time": [621, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"AUTOMATION: Buffer - opening time": [622, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"AUTOMATION: Marking - result": [623, {"dt": "16bit_uint", }],
|
||||
# 0= Only passed
|
||||
# 1= Only failed
|
||||
# 2=All
|
||||
"AUTOMATION: Marking - driving time": [624, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"PASSWORD: Administrator": [631, {"dt": "32bit_uint"}],
|
||||
"PASSWORD: Modify program": [633, {"dt": "32bit_uint"}],
|
||||
"PASSWORD: Select program": [635, {"dt": "32bit_uint"}],
|
||||
"Selection number of test table on which you intend to work": [700, {"dt": "16bit_uint", }],
|
||||
"Type of test": [701, {"dt": "16bit_uint", "encoding": {
|
||||
"LEAK TEST": 1,
|
||||
"BLOCKAGE TEST": 2,
|
||||
"LEAK TEST WITH VOLUME": 3,
|
||||
"BURST TEST": 4,
|
||||
}, "decoding": {
|
||||
1: "LEAK TEST",
|
||||
2: "BLOCKAGE TEST",
|
||||
3: "LEAK TEST WITH VOLUME",
|
||||
4: "BURST TEST",
|
||||
}, }],
|
||||
"Test flags": [702, {"dt": "16bit_uint", }],
|
||||
# | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 6 5 4 | 3 | 2 | 1 | 0 |
|
||||
# | CH | HR | AT | Q- | Q+ | | Pr- | P0- | PID MODE | T3/Q | | T1/Pr | T0/Pr |
|
||||
# CH: Selected test channel (2-channel T3P2C model only)
|
||||
# HR: 0=Resolution on loss 1 Pa 1=Resolution on loss 0.1 Pa (models with full scale <= 2 bar)
|
||||
# AT: 0=Tare pressure disabled 1=Tare pressure enabled
|
||||
# Q-: 0=Q-positive parameter 1=Q-negative parameter
|
||||
# Q+: 0=Q + positive parameter 1=parameter Q + negative
|
||||
#
|
||||
# Pr-: 0=Positive pressure Pr 1=Pr negative pressure (if enabled V or N option for vacuum tests)
|
||||
# P0-: 0=Positive P0 pressure 1=P0 negative pressure (if enabled V or N option for vacuum tests)
|
||||
# TYPE PID: 0=FAST 1=MEDIUM 2=SLOW 4 = FIXED 5 = AUTOMATIC 6= PULSES (if enabled SWLP option)
|
||||
# T3/Q: Phase mode T3 0= TIME 1=TERMINATE IMMEDIATELY IF FAILED
|
||||
#
|
||||
# T1/Pr: Phase filling mode T1 0= TIME 1=PRESSURE
|
||||
# T0/Pr: Phase filling mode T0 0= TIME 1= PRESSURE
|
||||
"T0 - Pre-filling time": [704, {"dt": "16bit_uint", "f": 26, }],
|
||||
"P0 - Pre-filling pressure": [705, {"dt": "16bit_uint", "f": 23, }],
|
||||
# In order to use a negative (vacuum) value, this parameter must however be written positively, but the P0- bit must
|
||||
# also be selected in register 702
|
||||
"T1 - Filling time": [706, {"dt": "16bit_uint", "f": 26, }],
|
||||
"T2 - Settling time": [707, {"dt": "16bit_uint", "f": 26, }],
|
||||
"T3 - Measure time": [708, {"dt": "16bit_uint", "f": 26, }],
|
||||
"PREL - Nominal test pressure": [709, {"dt": "16bit_uint", "f": 23, }],
|
||||
# To set a negative pressure (vacuum) this parameters must be written in absolute value and then set
|
||||
# bit Pr- in register 702
|
||||
"PR%- Lower tolerance on pressure / P- Minimum pressure": [710, {"dt": "16bit_uint", }],
|
||||
# PR%- Lower tolerance on pressure: LEAK: Format: x.x %
|
||||
# P- Minimum pressure: BLOCKAGE: Format as indicated in register 23
|
||||
# PR- Minimum pressure%: BURST: Format x.x%
|
||||
"Q+ Upper limit": [711, {"dt": "16bit_uint", "f": 22, }],
|
||||
# Format as indicated in the register 22
|
||||
"Q- Leak limit": [712, {"dt": "16bit_uint", "f": 22, }],
|
||||
# Format as indicated in the register 22
|
||||
"FST - discharge time": [713, {"dt": "16bit_uint", "f": 26, }],
|
||||
# Format as indicated in the register 26
|
||||
"VP - Equivalent volume": [714, {"dt": "16bit_uint", "f": 25, }],
|
||||
# Format as indicated in the register 25
|
||||
"P% Pressure tolerance": [717, {"dt": "16bit_uint", }],
|
||||
# BLOCKAGE: Format x.x %
|
||||
"PB - Minimum burst pressure": [743, {"dt": "16bit_uint", "f": 23, }],
|
||||
# BURST: Format as indicated in the register 23
|
||||
"BD - Delta burst": [744, {"dt": "16bit_uint", "f": 23, }],
|
||||
# BURST: Format as indicated in the register 23
|
||||
"FSL - discharge limit": [745, {"dt": "16bit_uint", "f": 23, }],
|
||||
# Format as indicated in the register 23
|
||||
"PR%+ Superior tolerance on pressure / P+ Pressure max": [747, {"dt": "16bit_uint", }],
|
||||
# PR% + Superior tolerance on pressure: LEAK: Format: x.x %
|
||||
# P + Pressure max: BURST: Format as indicated in the register 23
|
||||
"RVP%: volumetric ratio": [750, {"dt": "16bit_uint", }],
|
||||
# VOLUME+LEAK: Format x.xx (from 0.00 to 649.99)
|
||||
"RVP%: max tolerance": [751, {"dt": "16bit_uint", }],
|
||||
# VOLUME+LEAK: Format: x.xx
|
||||
# 1001-1060 Table of the last test performed X The order of the parameters is always the same, as indicated for register from 701 to 759.
|
||||
# 10001-10060 Direct access to test program table number 1 X X The order of the parameters is always the same, as indicated for register from 701 to 759.
|
||||
# 10101-10160 Direct access to test program table number 2 X X The order of the parameters is always the same, as indicated for register from 701 to 759.
|
||||
# 10201-19960 Direct access to test program table number 2 thru 100 X X The order of the parameters is always the same, as indicated for register from 701 to 759.
|
||||
# 501-510 U16 Model name X 20 ASCII characters divided into 10 registers
|
||||
# 511-520 U16 Serial number X 10 ASCII characters divided into 5 registers
|
||||
# 2001-8000 S32 Pressure values with sign X Register 49 indicates the sampling rate in tenths of a second Register 50 indicates the number of valid values In the leak tests, the values referred to the phases T0, T1 and T2 are under absolute pressure, while the values referred to phase T3 represent the detected loss.
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
from .modbus_component import ModbusComponent
|
||||
from .tecna_marposs_provaset_t3_registers import registers
|
||||
from .tecna_marposs_provaset_t3p_registers import registers
|
||||
|
||||
# from pymodbus.client.sync import ModbusSerialClient as ModbusClient
|
||||
# import serial
|
||||
|
|
@ -8,35 +8,35 @@ from .tecna_marposs_provaset_t3_registers import registers
|
|||
# client.read_holding_registers(1, count=1)
|
||||
|
||||
|
||||
class TecnaMarpossProvasetT3(ModbusComponent):
|
||||
class TecnaMarpossProvasetT3P(ModbusComponent):
|
||||
def __init__(self, config=None, name=None, period=1, lazy=True, paused=False, threaded=True):
|
||||
super().__init__(config=config, name=name, period=period, lazy=lazy, paused=paused, threaded=threaded, registers=registers)
|
||||
|
||||
pin_registers = {
|
||||
"admin_pin": "PASSWORD: Administrator", # was 1909
|
||||
"modify_pin": "PASSWORD: Modify program", # was 0
|
||||
"select_pin": "PASSWORD: Select program", # was 0
|
||||
}
|
||||
# pin_registers = {
|
||||
# "admin_pin": "PASSWORD: Administration", # was 1909
|
||||
# "modify_pin": "PASSWORD: Modify program", # was 0
|
||||
# "select_pin": "PASSWORD: Select program", # was 0
|
||||
# }
|
||||
|
||||
def config_changed(self):
|
||||
super().config_changed()
|
||||
self.pins = {
|
||||
"admin_pin": self.config.get("admin_pin", None),
|
||||
"modify_pin": self.config.get("modify_pin", None),
|
||||
"select_pin": self.config.get("select_pin", None),
|
||||
}
|
||||
self.unlock_tecna()
|
||||
# self.pins = {
|
||||
# "admin_pin": self.config.get("admin_pin", None),
|
||||
# "modify_pin": self.config.get("modify_pin", None),
|
||||
# "select_pin": self.config.get("select_pin", None),
|
||||
# }
|
||||
# self.unlock_tecna()
|
||||
self.set_measure_units()
|
||||
self.units = self.get_measure_units()
|
||||
self.log.info(f"units: {self.units}")
|
||||
|
||||
def unlock_tecna(self, **kwargs):
|
||||
pins = self.pins.copy()
|
||||
pins.update(kwargs)
|
||||
for pin_name, register in self.pin_registers.items():
|
||||
pin = pins[pin_name]
|
||||
if pin is not None:
|
||||
self.write(register, pin)
|
||||
# def unlock_tecna(self, **kwargs):
|
||||
# pins = self.pins.copy()
|
||||
# pins.update(kwargs)
|
||||
# for pin_name, register in self.pin_registers.items():
|
||||
# pin = pins[pin_name]
|
||||
# if pin is not None:
|
||||
# self.write(register, pin)
|
||||
|
||||
_pressure_units = {"mH2O": 0, "mbar": 1, "kPa": 2, "mmHg": 3, "inH2O": 4, "psi": 5, "mmH2O": 6, } # (se fondoscala <=6 bar)
|
||||
_leak_units = {"mmH2O": 0, "mbar": 1, "Pa": 2, "mmHg": 3, "inH2O": 4, "psi": 5, }
|
||||
|
|
@ -53,24 +53,24 @@ class TecnaMarpossProvasetT3(ModbusComponent):
|
|||
|
||||
def set_measure_units(self):
|
||||
for register, [unit, decimals] in {
|
||||
"MEASURE UNITS: pressure measure units": [self._pressure_units["mbar"], 0], # red, ?purple?
|
||||
"MEASURE UNITS: Leak measure units": [self._leak_units["mbar"], 0], # yellow
|
||||
"MEASURE UNITS: leak flow rate measure units": [self._leak_flow_units["cm3/min"], 0], # blue
|
||||
"MEASURE UNITS: Relative pressure": [self._pressure_units["mbar"], 0], # red, purple
|
||||
"MEASURE UNITS: Differential (leak) pressure": [self._leak_units["mbar"], 0], # yellow
|
||||
"MEASURE UNITS: Calculated leak flow rate": [self._leak_flow_units["cm3/min"], 0], # blue
|
||||
"MEASURE UNITS: Volume": [self._volume_units["litri"], 0], # green
|
||||
"MEASURE UNITS: Flow rate measure units": [self._flow_units["liters/min"], 0], # orange
|
||||
"MEASURE UNITS: Flow rate": [self._flow_units["liters/min"], 0], # orange
|
||||
}.items():
|
||||
self.write(register, (decimals << 8) + unit)
|
||||
|
||||
def get_measure_units(self):
|
||||
units = {}
|
||||
for [register, unit_map, unit_names] in [
|
||||
["Relative pressure variable format - high resolution", self._pressure_units_map, ["pressure_hr", "red", "r", 21, ]], # also by documentation color and register number
|
||||
["Relative pressure variable format - low resolution", self._pressure_units_map, ["pressure_lr", "purple", "p", 22, ]], # also by documentation color and register number
|
||||
["Format of the variables related to the measurement of the differential leak pressure", self._leak_units_map, ["leak", "yellow", "y", 23, ]], # also by documentation color and register number
|
||||
["Format of the variables related to the calculated leak flow", self._leak_flow_units_map, ["leak_flow", "blue", "b", 24, ]], # also by documentation color and register number
|
||||
["Format of volume variables", self._volume_units_map, ["volume", "green", "g", 25, ]], # also by documentation color and register number
|
||||
["Format of time variables", self._time_units_map, ["time", "tangerine", "t", 26, ]], # also by documentation color and register number
|
||||
["Format of variables related to flow measurements", self._flow_units_map, ["flow", "orange", "o", 27, ]], # also by documentation color and register number
|
||||
["Running test: relative pressure format", self._pressure_units_map, ["relative_pressure", "red", "r", 21, ]], # also by documentation color and register number
|
||||
["Running test: differential pressure format", self._pressure_units_map, ["differential_pressure", "purple", "p", 22, ]], # also by documentation color and register number
|
||||
["Running test: relative pressure format (low resolution)", self._leak_units_map, ["relative_pressure_lr", "yellow", "y", 23, ]], # also by documentation color and register number
|
||||
["Running test: calculated leak flow rate format", self._leak_flow_units_map, ["leak_flow", "blue", "b", 24, ]], # also by documentation color and register number
|
||||
["Running test: volume format", self._volume_units_map, ["volume", "green", "g", 25, ]], # also by documentation color and register number
|
||||
["Running test: time format", self._time_units_map, ["time", "orange", "t", 26, ]], # also by documentation color and register number
|
||||
["Running test: flow rate format", self._flow_units_map, ["flow", "white", "o", 27, ]], # also by documentation color and register number
|
||||
]:
|
||||
v = self.read(register)
|
||||
unit_spec = [10**(-((v >> 8) & 0xff)), unit_map[v & 0xff]]
|
||||
|
|
@ -116,33 +116,39 @@ class TecnaMarpossProvasetT3(ModbusComponent):
|
|||
# print("TECNA", str(int(QThread.currentThreadId())), flush=True)
|
||||
# READ INFO
|
||||
info = {r: self.read(r) for r in [
|
||||
"Instrument status: table of parameters in use",
|
||||
"Instrument status: active phase",
|
||||
"Test circuit pressure, in real time",
|
||||
"Measured leak, in real time",
|
||||
"Regulated pressure, in real time",
|
||||
"Real time test pressure output",
|
||||
"Real time differential pressure output",
|
||||
"Real time pressure line regulator",
|
||||
"Active alarm flags",
|
||||
"Running test: type of test",
|
||||
"Testing in progress: progressive sequence index",
|
||||
"Active test program number",
|
||||
"Running test: active phase",
|
||||
"Running test: test type",
|
||||
"Running test: sequence index",
|
||||
]}
|
||||
if info["Running test: type of test"] is None:
|
||||
if info["Running test: active phase"] == "RESULT PRESENT":
|
||||
info.update(self.get_test_results())
|
||||
elif info["Running test: active phase"] == "WAITING START":
|
||||
pass
|
||||
self.log.debug(str(info))
|
||||
super()._get([info])
|
||||
|
||||
def start_test(self, table=100):
|
||||
self.log.info(f"starting test table {table!r}")
|
||||
self.write("INSTRUMENT SETTING: Test table from", "PARAMETER")
|
||||
self.write("INSTRUMENT SETTING: Selected table", table)
|
||||
self.write("Start testing", table)
|
||||
self.write("Source of test program number selection", "FROM PARAMETER (SET BY LCD OR SERIAL LINE)")
|
||||
self.write("Selected program", table)
|
||||
self.write("Start test", table)
|
||||
|
||||
def stop_test(self):
|
||||
self.log.warning("stopping test")
|
||||
self.write("Stop the test in progress", 0)
|
||||
self.write("Reset running test", 0)
|
||||
|
||||
def get_test_results(self):
|
||||
self.log.info("getting test results")
|
||||
return {r: self.read(r) for r in [
|
||||
"Running test: phase backwards time",
|
||||
"Running test: filling pressure",
|
||||
"Running test: pressure at the end of settling",
|
||||
"Running test: burst pressure",
|
||||
"Running test: measured leak",
|
||||
"Running test: calculated leak flow rate",
|
||||
"Running test: calculate RVP%",
|
||||
|
|
@ -155,23 +161,23 @@ class TecnaMarpossProvasetT3(ModbusComponent):
|
|||
recipe_name = recipe.spec["part_number"][:16].encode("ascii")
|
||||
recipe_name += b"\x00" * (16 - len(recipe_name))
|
||||
recipe = {
|
||||
"INSTRUMENT SETTING: Various flags": 0b0000000000000000,
|
||||
"Selection number of test table on which you intend to work": table,
|
||||
**{719 + i: (recipe_name[i * 2 + 1] << 8) + recipe_name[i * 2] for i in range(8)},
|
||||
"Type of test": "LEAK TEST",
|
||||
"Test flags": 0b0000000001010000,
|
||||
"Flag: Instrument settings": 0b0000000000000000,
|
||||
"Test program for read/write operation": table,
|
||||
**{719 - 1 + i: (recipe_name[i * 2 + 1] << 8) + recipe_name[i * 2] for i in range(8)},
|
||||
"Test type": "Leak Test",
|
||||
"Test flags": 0b0110000001011000,
|
||||
"T0 - Pre-filling time": recipe.spec["pre_filling_time"],
|
||||
"P0 - Pre-filling pressure": recipe.spec["pre_filling_pressure"],
|
||||
"T1 - Filling time": recipe.spec["filling_time"],
|
||||
"T2 - Settling time": recipe.spec["settling_time"],
|
||||
"PR%- Lower tolerance on pressure / P- Minimum pressure": recipe.spec["settling_pressure_min_percent"],
|
||||
"PR%+ Superior tolerance on pressure / P+ Pressure max": recipe.spec["settling_pressure_max_percent"],
|
||||
"PR- - Min pressure tolerance %": recipe.spec["settling_pressure_min_percent"],
|
||||
"PR+ - Max pressure tolerance % (P+)": recipe.spec["settling_pressure_max_percent"],
|
||||
"T3 - Measure time": recipe.spec["test_time"],
|
||||
"Q- Leak limit": recipe.spec["test_pressure_min_delta"],
|
||||
"Q- Lower test leak limit": recipe.spec["test_pressure_min_delta"],
|
||||
"PREL - Nominal test pressure": recipe.spec["test_pressure"],
|
||||
"Q+ Upper limit": recipe.spec["test_pressure_max_delta"],
|
||||
"FST - discharge time": recipe.spec["flush_time"],
|
||||
"FSL - discharge limit": recipe.spec["flush_pressure"],
|
||||
"Q+ Upper test leak limit": recipe.spec["test_pressure_max_delta"],
|
||||
"FST - Discharge time": recipe.spec["flush_time"],
|
||||
"FSL - Discharge limit": recipe.spec["flush_pressure"],
|
||||
}
|
||||
self.log.debug(str(recipe))
|
||||
for register, value in recipe.items():
|
||||
294
src/components/tecna_marposs_provaset_t3p_registers.py
Normal file
294
src/components/tecna_marposs_provaset_t3p_registers.py
Normal file
|
|
@ -0,0 +1,294 @@
|
|||
# WARNING: ALL REGISTER IN THE DOCUMENTATION ARE SHIFTED BY ONE (NUMERATION STARTS BY ONE)
|
||||
registers = {
|
||||
"Instrument type": [1 - 1, {"dt": "16bit_uint", }],
|
||||
"Test counter: FAILED": [2 - 1, {"dt": "32bit_uint", }],
|
||||
"Test counter: TOTAL TESTS": [4 - 1, {"dt": "32bit_uint", }],
|
||||
"Life counter: FAILED": [6 - 1, {"dt": "32bit_uint", }],
|
||||
"Life counter: TOTAL TESTS": [8 - 1, {"dt": "32bit_uint", }],
|
||||
"Real time test pressure output": [11 - 1, {"dt": "32bit_int", "f": 21, }],
|
||||
"Real time differential pressure output": [13 - 1, {"dt": "32bit_int", "f": 22, }],
|
||||
"Real time pressure line regulator": [15 - 1, {"dt": "16bit_int", "f": 23, }],
|
||||
"Active alarm flags": [16 - 1, {"dt": "16bit_uint", }],
|
||||
# | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
||||
# | | | | A5 | A4 | A3 | A2 | A1 | | | | | | E3 | E2 | E1 |
|
||||
# E1: Test program error
|
||||
# E2: Setting parameters memory error
|
||||
# E3: Sensor calibration memory error
|
||||
# A1: Discharge alarm
|
||||
# A2: Cage closing automation alarm
|
||||
# A3: Cage opening automation alarm
|
||||
# A4: Plug closing automation alarm
|
||||
# A5: Plug opening automation alarm
|
||||
"Running test: relative pressure format": [21 - 1, {"dt": "16bit_uint", }], # red
|
||||
"Running test: differential pressure format": [22 - 1, {"dt": "16bit_uint", }], # purple
|
||||
"Running test: relative pressure format (low resolution)": [23 - 1, {"dt": "16bit_uint", }], # yellow
|
||||
"Running test: calculated leak flow rate format": [24 - 1, {"dt": "16bit_uint", }], # blue
|
||||
"Running test: volume format": [25 - 1, {"dt": "16bit_uint", }], # green
|
||||
"Running test: time format": [26 - 1, {"dt": "16bit_uint", }], # orange
|
||||
"Running test: flow rate format": [27 - 1, {"dt": "16bit_uint", }], # white
|
||||
"Active test program number": [31 - 1, {"dt": "16bit_uint", }],
|
||||
"Running test: active phase": [32 - 1, {"dt": "16bit_uint", "decoding": {
|
||||
0: "WAITING START",
|
||||
10: "CHECK BARCODE",
|
||||
20: "WAITING BARCODE",
|
||||
30: "START TEST",
|
||||
40: "START CAGE",
|
||||
50: "START PLUG",
|
||||
60: "START SEQUENCE PROGRAM",
|
||||
70: "WAIT DELAY ACKNOWLEDGE COMMAND",
|
||||
80: "WAIT DELAY",
|
||||
90: "WAIT ACKNOWLEDGE",
|
||||
100: "T0 PRE-FILL",
|
||||
110: "T1 FILLING",
|
||||
120: "T2 SETTLING",
|
||||
130: "T3 MEASURE",
|
||||
140: "WAITING OPERATOR RESULT ACKNOWLEDGE",
|
||||
150: "RESULT PRESENT",
|
||||
160: "MARKING",
|
||||
170: "DISCHARGE",
|
||||
180: "END SEQUENCE PROGRAM",
|
||||
190: "END PLUG",
|
||||
200: "END CAGE",
|
||||
210: "END TEST, WAITING THE START OF A NEW TEST",
|
||||
}, }],
|
||||
"Running test: phase backwards time": [33 - 1, {"dt": "16bit_uint", "f": 26, }],
|
||||
"Running test: filling pressure": [34 - 1, {"dt": "32bit_int", "f": 21, }],
|
||||
"Running test: pressure at the end of settling": [36 - 1, {"dt": "32bit_int", "f": 21, }],
|
||||
"Running test: burst pressure": [38 - 1, {"dt": "32bit_int", "f": 21, }],
|
||||
"Running test: measured leak": [40 - 1, {"dt": "32bit_int", "f": 22, }],
|
||||
"Running test: calculated leak flow rate": [42 - 1, {"dt": "32bit_int", "f": 24, }],
|
||||
"Running test: calculate RVP%": [44 - 1, {"dt": "32bit_int", }],
|
||||
"Running test: result": [46 - 1, {"dt": "16bit_uint", "decoding": {
|
||||
1: "LEAK TEST PASSED (also used in Volume+Leak tests)",
|
||||
2: "BURST TEST PASSED WITH BURST",
|
||||
3: "BURST TEST PASSED WITHOUT BURST",
|
||||
4: "APERTURE TEST PASSED",
|
||||
5: "BLOCKAGE TEST PASSED",
|
||||
6: "FLOW TEST PASSED",
|
||||
7: "LEAK with FLOW TEST PASSED",
|
||||
# 100: "LEAK TEST FAILED (T3D: Maximum leak in test port, T3P: Upper limit error with negative Q+ parameter)",
|
||||
100: "LEAK TEST FAILED (Upper limit error with negative Q+ parameter)",
|
||||
# 101: "LEAK TEST FAILED (only in T3P: Upper limit with positive Q+ parameter)",
|
||||
101: "LEAK TEST FAILED (Upper limit with positive Q+ parameter)",
|
||||
# 102: "LEAK TEST FAILED (T3D: Maximum leak in reference port, T3P: Maximum leak)",
|
||||
102: "LEAK TEST FAILED (Maximum leak)",
|
||||
103: "BURST TEST FAILED (Burst pressure under the minimum)",
|
||||
104: "VOLUME TEST FAILED (Maximum RVP tolerance)",
|
||||
105: "APERTURE TEST FAILED - MINIMUM (not used)",
|
||||
106: "APERTURE TEST FAILED - MAXIMUM (not used)",
|
||||
107: "BLOCKAGE TEST FAILED (Maximum pressure)",
|
||||
108: "BLOCKAGE TEST FAILED (Minimum pressure)",
|
||||
109: "BURST TEST FAILED (Minimum test pressure not reach)",
|
||||
110: "FLOW TEST - PRESSURE FAIL - (Pressure out of programmed tolerance)",
|
||||
111: "FLOW TEST - FLOW FAIL - (Flow out of programmed tolerance)",
|
||||
112: "FAILED - SEVERE FAIL",
|
||||
113: "FAILED",
|
||||
114: "FAILED",
|
||||
115: "FAILED",
|
||||
116: "FAILED",
|
||||
117: "FAILED",
|
||||
118: "FAILED",
|
||||
119: "FAILED",
|
||||
120: "FAILED",
|
||||
121: "FAILED",
|
||||
122: "FAILED",
|
||||
123: "FAILED",
|
||||
200: "FAIL T1/T2 PRESSURE UNDER TOLERANCE",
|
||||
201: "FAIL T1/T2 PRESSURE OVER TOLERANCE",
|
||||
202: "FAIL BLOCKAGE START PRESSURE UNDER TOLERANCE",
|
||||
203: "FAIL BLOCKAGE START PRESSURE OVER TOLERANCE",
|
||||
204: "FAIL WITH ALARM",
|
||||
205: "FAIL RELATIVE PRESSURE OVER SCALE",
|
||||
206: "FAIL DIFFERENTIAL PRESSURE OVER SCALE",
|
||||
207: "FAIL PRE-FILL VALVE NOT OPENED",
|
||||
208: "FAIL INVALID PROGRAM PARAMETERS",
|
||||
209: "FAIL CONFIGURATION PARAMETERS",
|
||||
210: "FAIL ALL CALIBRATION",
|
||||
211: "FAIL I2C COMMUNICATION",
|
||||
212: "FAIL EMERGENCY",
|
||||
213: "FAIL BYPASS VALVE NOT OPEN",
|
||||
214: "FAIL FLOW OUT OF RANGE",
|
||||
215: "FAIL SEVERE FAIL",
|
||||
250: "TEST ABORTED",
|
||||
}, }],
|
||||
"Running test: test type": [47 - 1, {"dt": "16bit_uint", "decoding": {
|
||||
1: "LEAK",
|
||||
2: "BLOCKAGE",
|
||||
3: "LEAK + VOLUME CHECK",
|
||||
4: "BURST",
|
||||
}, }],
|
||||
"Running test: sequence index": [48 - 1, {"dt": "16bit_uint", }],
|
||||
"PRESSURE PLOT: Sampling frequency in 1/10 s": [49 - 1, {"dt": "16bit_uint", }],
|
||||
"PRESSURE PLOT: Number of available sampling": [50 - 1, {"dt": "16bit_uint", }],
|
||||
# 51-92 last test values ----- add if needed
|
||||
# ------------------------- COMMANDS -------------------------
|
||||
"Start test": [101 - 1, {"dt": "16bit_uint", }],
|
||||
# Write 0 to start the selected program
|
||||
# Write a different number from 1 to n max programs to start a specific program.
|
||||
"Reset running test": [102 - 1, {"dt": "16bit_uint", }],
|
||||
"Activate specific digital output": [103 - 1, {"dt": "16bit_uint", }],
|
||||
# Write the number from 1 to 8 of the digital output to activate (must be set as Free in Settings)
|
||||
"Reset specific digital output": [104 - 1, {"dt": "16bit_uint", }],
|
||||
# Write the number from 1 to 8 of the digital output to reset (must be set as Free in Settings)
|
||||
"Activate digital output (bit mask)": [105 - 1, {"dt": "16bit_uint", }],
|
||||
# Write 1 in the bit corresponding to the output to be activated
|
||||
"Reset digital output (bit mask)": [106 - 1, {"dt": "16bit_uint", }],
|
||||
# Write 1 in the bit corresponding to the output to be deactivated
|
||||
"Reset test counter": [107 - 1, {"dt": "16bit_uint", }],
|
||||
# ------------------------------------------------------------
|
||||
"Language": [601 - 1, {"dt": "16bit_uint", "encoding": {
|
||||
"ITALIAN": 0,
|
||||
"ENGLISH": 1,
|
||||
}, "decoding": {
|
||||
0: "ITALIAN",
|
||||
1: "ENGLISH",
|
||||
}, }],
|
||||
"Source of test program number selection": [602 - 1, {"dt": "16bit_uint", "encoding": {
|
||||
"FROM PARAMETER (SET BY LCD OR SERIAL LINE)": 0,
|
||||
"BCD BASE 1, FROM DIGITAL INPUTS (PLC INTERFACE)": 1,
|
||||
"BCD BASE 0, FROM DIGITAL INPUTS (PLC INTERFACE)": 2,
|
||||
}, "decoding": {
|
||||
0: "FROM PARAMETER (SET BY LCD OR SERIAL LINE)",
|
||||
1: "BCD BASE 1, FROM DIGITAL INPUTS (PLC INTERFACE)",
|
||||
2: "BCD BASE 0, FROM DIGITAL INPUTS (PLC INTERFACE)",
|
||||
}, }],
|
||||
"Selected program": [603 - 1, {"dt": "16bit_uint", }],
|
||||
# 1- n max programs
|
||||
"Flag: Instrument settings": [605 - 1, {"dt": "16bit_uint", }],
|
||||
# | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|
||||
# | | | | | | | | | | PID NR | QE | RF | RP | UP | DM | SB |
|
||||
# Bit 0: 1= Start button
|
||||
# Bit 1: 1= Demo mode
|
||||
# Bit 2: 1= Use product
|
||||
# Bit 3: 1= Reset if test passed
|
||||
# Bit 4: 1= Reset if test failed
|
||||
# Bit 5: 1= QLP Extradigit
|
||||
# Bit 6: 1= PID no regulation
|
||||
"MEASURE UNITS: Relative pressure": [606 - 1, {"dt": "16bit_uint", }],
|
||||
# 0=mH2O 1=mbar 2=kPa 3=mmHg 4=inH2O 5=psi 6=mmH2O
|
||||
"MEASURE UNITS: Differential (leak) pressure": [607 - 1, {"dt": "16bit_uint", }],
|
||||
# 0=mmH2O 1=mbar 2=Pa 3=mmHg 4=inH2O 5=psi
|
||||
"MEASURE UNITS: Calculated leak flow rate": [608 - 1, {"dt": "16bit_uint", }],
|
||||
# 0=cm3/min 1=cm3/h
|
||||
"MEASURE UNITS: Volume": [609 - 1, {"dt": "16bit_uint", }],
|
||||
# 0=litre 1=cm3
|
||||
"MEASURE UNITS: Flow rate": [617 - 1, {"dt": "16bit_uint", }],
|
||||
# 0=liters/min 1=liters/h 2=m3/h
|
||||
"Cage automation: closing time": [618 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"Cage automation: opening time": [619 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"Maximum pressure limit": [620 - 1, {"dt": "16bit_uint", }],
|
||||
"Plug automation: closing time": [621 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"Plug automation: opening time": [622 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"Marker: result based driving": [623 - 1, {"dt": "16bit_uint", }],
|
||||
# 0=Only passed
|
||||
# 1=Only failed
|
||||
# 2=All
|
||||
"Marker: driving time": [624 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"PASSWORD: Administration": [631 - 1, {"dt": "32bit_uint"}],
|
||||
"PASSWORD: Modify program": [633 - 1, {"dt": "32bit_uint"}],
|
||||
"PASSWORD: Select program": [635 - 1, {"dt": "32bit_uint"}],
|
||||
"Test program for read/write operation": [700 - 1, {"dt": "16bit_uint", }],
|
||||
# 1- n max programs
|
||||
"Test type": [701 - 1, {"dt": "16bit_uint", "encoding": {
|
||||
"Leak Test": 1,
|
||||
"Blockage": 2,
|
||||
"Volume+Leak": 3,
|
||||
"Burst": 4,
|
||||
"Aperture": 5,
|
||||
# "Flow (T3PF)": 6,
|
||||
"Flow": 6,
|
||||
# "Leak with Flow (T3PF)": 7,
|
||||
"Leak with Flow": 7,
|
||||
}, "decoding": {
|
||||
1: "Leak Test",
|
||||
2: "Blockage",
|
||||
3: "Volume+Leak",
|
||||
4: "Burst",
|
||||
5: "Aperture",
|
||||
# 6: "Flow (T3PF)",
|
||||
6: "Flow",
|
||||
# 7: "Leak with Flow (T3PF)",
|
||||
7: "Leak with Flow",
|
||||
}, }],
|
||||
"Test flags": [702 - 1, {"dt": "16bit_uint", }],
|
||||
# | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 6 5 4 | 3 | 2 | 1 | 0 |
|
||||
# | CH | HR | AT | Q- | Q+ | | Pr- | P0- | PID MODE | T3/Q | FSM | T1/Pr | |
|
||||
# CH: Select used channel (in two channels models as T3P2C)
|
||||
# HR: Enable pressure high resolution (depends on the model)
|
||||
# AT: Pressure auto tare
|
||||
# Q-: Negative Q- parameter(used in blockage test)
|
||||
# Q+: Negative Q+ parameter (used in blockage test)
|
||||
# -----
|
||||
# Pr-: 0=Pr filling pressure is positive 1=Pr filling pressure is negative (vacuum)
|
||||
# P0-: 0=P0 pre-filling pressure is positive 1=P0 pre-filling pressure is negative (vacuum)
|
||||
# PID MODE: 0=FAST 1=MEDIUM 2=SLOW 4 = FIXED 5 = AUTOMATIC 6 = FLOW 7 = LEAK WITH FLOW
|
||||
# T3/Q: Fail mode 0=TIME 1=PRESSURE
|
||||
# FSM: Discharge mode 0=TIME 1=PRESSURE
|
||||
# T1/Pr: Filling mode 0=TIME 1=PRESSURE
|
||||
# -----
|
||||
# the 0 bit is missing in the latest documentation but from older documentations it might be
|
||||
# T0/Pr: Phase filling mode T0 0=TIME 1=PRESSURE
|
||||
"T0 - Pre-filling time": [704 - 1, {"dt": "16bit_uint", "f": 26, }],
|
||||
"P0 - Pre-filling pressure": [705 - 1, {"dt": "16bit_uint", "f": 23, }],
|
||||
# To set a negative pressure (vacuum) this parameters must be written in absolute value and then set bit P0- in register 702
|
||||
"T1 - Filling time": [706 - 1, {"dt": "16bit_uint", "f": 26, }],
|
||||
"T2 - Settling time": [707 - 1, {"dt": "16bit_uint", "f": 26, }],
|
||||
"T3 - Measure time": [708 - 1, {"dt": "16bit_uint", "f": 26, }],
|
||||
"PREL - Nominal test pressure": [709 - 1, {"dt": "16bit_uint", "f": 23, }],
|
||||
# To set a negative pressure (vacuum) this parameters must be written in absolute value and then set bit Pr- in register 702
|
||||
"PR- - Min pressure tolerance %": [710 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.x %
|
||||
# NOTE: In blockage test minimum final pressure (format as indicated in register 23)
|
||||
"Q+ Upper test leak limit": [711 - 1, {"dt": "16bit_uint", "f": 22, }],
|
||||
"Q- Lower test leak limit": [712 - 1, {"dt": "16bit_uint", "f": 22, }],
|
||||
"FST - Discharge time": [713 - 1, {"dt": "16bit_uint", "f": 26, }],
|
||||
"VP - Test volume": [714 - 1, {"dt": "16bit_uint", "f": 25, }],
|
||||
"PSDEL: Start delay": [716 - 1, {"dt": "16bit_uint", "f": 25, }],
|
||||
# Format: x.x in 1/10 seconds
|
||||
"P% Pressure tol. (blockage test)": [717 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.x %
|
||||
"AW: Aperture weight time (AT)": [740 - 1, {"dt": "16bit_uint", }],
|
||||
"AN: Aperture number": [741 - 1, {"dt": "16bit_uint", }],
|
||||
# Format x
|
||||
"PV%": [742 - 1, {"dt": "16bit_uint", }],
|
||||
# Set of electronic regulator in blockage test (Format x.x %)
|
||||
"PB - Minimum burst pressure": [743 - 1, {"dt": "16bit_uint", "f": 23, }],
|
||||
"BD - Burst gap / PD Delta Aperture": [744 - 1, {"dt": "16bit_uint", "f": 23, }],
|
||||
"FSL - Discharge limit": [745 - 1, {"dt": "16bit_uint", "f": 23, }],
|
||||
"RP% - Pressure ratio": [746 - 1, {"dt": "16bit_uint", }],
|
||||
# Format; x.xx %
|
||||
"PR+ - Max pressure tolerance % (P+)": [747 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.x %
|
||||
# NOTE: In blockage test maximum final pressure (format as indicated in register 23)
|
||||
"AV1: Advanced valve time": [748 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"AV2: Advanced valve time": [749 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.x seconds
|
||||
"RVP%: volumetric ratio": [750 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.xx (Range from 100.00 to 649.99)
|
||||
"RVP%: max tolerance": [751 - 1, {"dt": "16bit_uint", }],
|
||||
# Format: x.xx (Range from 0.10 to 50.00)
|
||||
"RAMPS: T0 configuration": [752 - 1, {"dt": "16bit_uint", }],
|
||||
# | 15 14 13 12 11 10 9 8 | 7 6 5 4 3 2 1 0 |
|
||||
# | RAMP PERCENTAGE | NUMBER OF RAMPS |
|
||||
"RAMPS: T1 configuration": [753 - 1, {"dt": "16bit_uint", }],
|
||||
# | 15 14 13 12 11 10 9 8 | 7 6 5 4 3 2 1 0 |
|
||||
# | RAMP PERCENTAGE | NUMBER OF RAMPS |
|
||||
"PSQ - Next sequence program PSOUT mode": [754 - 1, {"dt": "16bit_uint", }],
|
||||
# | 15 14 13 12 11 10 9 8 | 7 6 5 4 | 3 2 1 0 |
|
||||
# | PSQ | | PSOUT |
|
||||
# PSOUT MODE: 0 = While test run 1 = After start delay 2 = Always 3 = Only during start delay
|
||||
|
||||
# 1001-1060 Table of the last test performed X The order of the parameters is always the same, as indicated for register from 701 to 759.
|
||||
# 10001-10060 Direct access to test program table number 1 X X The order of the parameters is always the same, as indicated for register from 701 to 759.
|
||||
# 10101-10160 Direct access to test program table number 2 X X The order of the parameters is always the same, as indicated for register from 701 to 759.
|
||||
# 10201-19960 Direct access to test program table number 2 thru 100 X X The order of the parameters is always the same, as indicated for register from 701 to 759.
|
||||
# 501-510 U16 Model name X 20 ASCII characters divided into 10 registers
|
||||
# 511-520 U16 Serial number X 10 ASCII characters divided into 5 registers
|
||||
# 2001-8000 S32 Pressure values with sign X Register 49 indicates the sampling rate in tenths of a second Register 50 indicates the number of valid values In the leak tests, the values referred to the phases T0, T1 and T2 are under absolute pressure, while the values referred to phase T3 represent the detected loss.
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ try:
|
|||
# IMPORT PROJECT ONLY AFTER SETTING UP SIGNAL, FAULTHANDLER AND LOGGHING
|
||||
from components import (ArchiveSynchronizer, GalaxyCamera, NeoPixels,
|
||||
Os_Label_Printer, RemoteAPI,
|
||||
TecnaMarpossProvasetT3, TestComponent, Vision,
|
||||
TecnaMarpossProvasetT3P, TestComponent, Vision,
|
||||
VisionSaver)
|
||||
from lib.db import Users
|
||||
from lib.helpers import ConfigReader
|
||||
|
|
@ -84,7 +84,7 @@ try:
|
|||
"label_printer": {"c": Os_Label_Printer, "t": False},
|
||||
"neo_pixels": {"c": NeoPixels, "t": False},
|
||||
"remote_api": {"c": RemoteAPI, "k": {"main": self}},
|
||||
"tecna_t3": {"c": TecnaMarpossProvasetT3, "k": {"paused": True}},
|
||||
"tecna_t3": {"c": TecnaMarpossProvasetT3P, "k": {"paused": True}},
|
||||
"vision_saver": {"c": VisionSaver, "t": False},
|
||||
"vision": {"c": Vision, "k": {"paused": True}},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,11 +32,17 @@ class Test_Leak(Test_Test):
|
|||
super().get(None, override=override)
|
||||
return
|
||||
data = data[-1]
|
||||
if "Running test: result" in data["tecna_t3"]:
|
||||
result = data["tecna_t3"]["Running test: result"]
|
||||
ok = type(result) is str and "passed" in result.lower()
|
||||
else:
|
||||
result = None
|
||||
ok = False
|
||||
super().get([{
|
||||
"time": data.get("time", None),
|
||||
"results": {
|
||||
"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"],
|
||||
"ok": ok,
|
||||
"result": result,
|
||||
"data": data["tecna_t3"],
|
||||
},
|
||||
}], override=override)
|
||||
|
|
@ -46,13 +52,13 @@ class Test_Leak(Test_Test):
|
|||
data = {}
|
||||
d = data.get("results", {}).get("data", {})
|
||||
for register, label in {
|
||||
"Instrument status: active phase": self.test_phase_l,
|
||||
"Test circuit pressure, in real time": self.circuit_pressure_l,
|
||||
"Measured leak, in real time": self.leak_l,
|
||||
"Regulated pressure, in real time": self.regulated_pressure_l,
|
||||
"Running test: active phase": self.test_phase_l,
|
||||
"Real time test pressure output": self.circuit_pressure_l,
|
||||
"Real time differential pressure output": self.leak_l,
|
||||
"Real time pressure line regulator": self.regulated_pressure_l,
|
||||
# "Active alarm flags": self._l,
|
||||
"Running test: type of test": self.test_type_l,
|
||||
"Testing in progress: progressive sequence index": self.sequence_index_l,
|
||||
"Running test: test type": self.test_type_l,
|
||||
"Running test: sequence index": self.sequence_index_l,
|
||||
}.items():
|
||||
label.setText(str(d.get(register, "-")))
|
||||
super().visualize(data)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user