| 1 |
# |
| 2 |
# This file is part of the PyMeasure package. |
| 3 |
# |
| 4 |
# Copyright (c) 2013-2024 PyMeasure Developers |
| 5 |
# |
| 6 |
# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 |
# of this software and associated documentation files (the "Software"), to deal |
| 8 |
# in the Software without restriction, including without limitation the rights |
| 9 |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 |
# copies of the Software, and to permit persons to whom the Software is |
| 11 |
# furnished to do so, subject to the following conditions: |
| 12 |
# |
| 13 |
# The above copyright notice and this permission notice shall be included in |
| 14 |
# all copies or substantial portions of the Software. |
| 15 |
# |
| 16 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 |
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 |
# THE SOFTWARE. |
| 23 |
# |
| 24 |
|
| 25 |
""" |
| 26 |
Implementation of an interface class for ThermoStream® Systems devices. |
| 27 |
Reference Document for implementation: |
| 28 |
ECO-560/660 ThermoStream® Systems |
| 29 |
Operators Manual |
| 30 |
Revision B |
| 31 |
September, 2018 |
| 32 |
""" |
| 33 |
|
| 34 |
from pymeasure.instruments.temptronic.temptronic_base import ATSBase |
| 35 |
from enum import IntFlag |
| 36 |
|
| 37 |
|
| 38 |
class ECO560ErrorCode(IntFlag): |
| 39 |
"""Error code enums based on ``IntFlag``. |
| 40 |
|
| 41 |
Used in conjunction with :attr:`~.error_code`. |
| 42 |
|
| 43 |
====== ====== |
| 44 |
Value Enum |
| 45 |
====== ====== |
| 46 |
16384 NO_DUT_SENSOR_SELECTED |
| 47 |
8192 IMPROPER_SOFTWARE_VERSION |
| 48 |
1024 PURGE_HEAT_FAILURE |
| 49 |
512 FLOW_SENSOR_HARDWARE_ERROR |
| 50 |
256 DUT_OPEN_LOOP |
| 51 |
128 INTERNAL_ERROR |
| 52 |
64 OPEN_PURGE_TEMPERATURE_SENSOR |
| 53 |
32 AIR_SENSOR_OPEN |
| 54 |
16 LOW_INPUT_AIR_PRESSURE |
| 55 |
8 LOW_FLOW |
| 56 |
4 SETPOINT_OUT_OF_RANGE |
| 57 |
2 AIR_OPEN_LOOP |
| 58 |
1 OVERHEAT |
| 59 |
0 OK |
| 60 |
====== ====== |
| 61 |
|
| 62 |
""" |
| 63 |
# bit 15 - reserved |
| 64 |
NO_DUT_SENSOR_SELECTED = 16384 # bit 14 – no DUT sensor selected |
| 65 |
IMPROPER_SOFTWARE_VERSION = 8192 # bit 13 – software revision error |
| 66 |
# bit 12 – reserved |
| 67 |
# bit 11 – reserved |
| 68 |
PURGE_HEAT_FAILURE = 1024 # bit 10 – purge heat failure |
| 69 |
FLOW_SENSOR_HARDWARE_ERROR = 512 # bit 9 – flow sensor hardware error |
| 70 |
DUT_OPEN_LOOP = 256 # bit 8 – dut open loop |
| 71 |
INTERNAL_ERROR = 128 # bit 7 – internal error |
| 72 |
OPEN_PURGE_TEMPERATURE_SENSOR = 64 # bit 6 – open purge temperature sensor |
| 73 |
NO_PURGE_FLOW = 32 # bit 5 – no purge flow |
| 74 |
LOW_INPUT_AIR_PRESSURE = 16 # bit 4 – low input air pressure |
| 75 |
LOW_FLOW = 8 # bit 3 – low flow |
| 76 |
SETPOINT_OUT_OF_RANGE = 4 # bit 2 – setpoint out of range |
| 77 |
AIR_OPEN_LOOP = 2 # bit 1 – air open loop |
| 78 |
OVERHEAT = 1 # bit 0 – overheat |
| 79 |
OK = 0 # ok state |
| 80 |
|
| 81 |
|
| 82 |
class ECO560(ATSBase): |
| 83 |
"""Represent the TemptronicECO560 instruments. |
| 84 |
""" |
| 85 |
|
| 86 |
temperature_limit_air_low_values = [-150, 25] |
| 87 |
|
| 88 |
error_code_get_process = lambda v: ECO560ErrorCode(int(v)) # noqa: E731 |
| 89 |
|
| 90 |
copy_active_setup_file = None |
| 91 |
# Not Implemented in ECO-560 |
| 92 |
|
| 93 |
def __init__(self, adapter, name="Temptronic ECO-560 Thermostream", **kwargs): |
| 94 |
kwargs.setdefault('timeout', 3000) |
| 95 |
super().__init__( |
| 96 |
adapter, |
| 97 |
name, |
| 98 |
tcpip={'write_termination': '\n', |
| 99 |
'read_termination': '\n'}, |
| 100 |
**kwargs |
| 101 |
) |