binder_climate_chamber
Binder class for climate chamber.
This climate chamber is not a SCPI or VISA instrument. Therefore we are using a custom library for control with it. This custom library is located at: utils.binderctl.
Classes
|
Binder
- class icicle.binder_climate_chamber.Binder(*args, **kwargs)
Bases:
Instrument
- __init__(resource='127.0.0.1', tolerance=2, sim=False)
Init function.
- Parameters:
resource – an ip adress at which the climate chamber is to be found
tolerance – A temperature tolerance to accept a temperature as reached, when the difference is lower than this.
- AUTO_COND_BIT = 64
- DRY_AIR_BIT = 4
- FAN_BIT = 8
- IDLE_MODE_BIT = 2
- MEASURE_COMMAND_MAP = {'HUMI': 'rHumidity', 'TEMP': 'rTemp'}
- MEASURE_TYPES = {'HUMI': 'Rel. Humidity (%)', 'TEMP': 'Temperature (°C)'}
Measurement types for this instrument.
- MONITOR_KEYS = ['rTemp', 'rHumidity', 'rSetpointTemp', 'rSetpointHumidity', 'rSwitches']
- class MeasureChannel(instrument, channel, measure_type, unit='')
Bases:
MeasureChannel
MeasureChannel implementation for the Binder Climate Chamber.
- property status
- Returns:
value of
rSwitches
.- Return type:
int
- property value
Performs measurement and returns value.
- Returns:
measured value.
- Return type:
float
- NO_SIMULATION = True
- PORT = 10001
- REGISTER = {'rHumidity': (4106, <class 'float'>), 'rProgram': (4423, <class 'float'>), 'rSetpointHumidity': (4276, <class 'float'>), 'rSetpointTemp': (4274, <class 'float'>), 'rStart': (4425, <class 'float'>), 'rStop': (4426, <class 'float'>), 'rSwitches': (4754, <class 'int'>), 'rTemp': (4100, <class 'float'>), 'wProgram': (4423, <class 'float'>), 'wSetpointHumidity': (4430, <class 'float'>), 'wSetpointTemp': (4428, <class 'float'>), 'wStart': (4425, <class 'float'>), 'wStop': (4426, <class 'float'>), 'wSwitches': (4440, <class 'int'>)}
- RETRIES = 3
- TIMEOUT = 2.5
- class TemperatureChannel(instrument, channel, measure_temperature, measure_speed)
Bases:
TemperatureChannel
TemperatureChannel implementation for Binder Climate Chamber.
- property speed
Not implemented/available for this device :returns: 0
- property state
- Returns:
whether this power channel is on or off (True/False).
- Return type:
bool
- property status
- Returns:
value of
rSwitches
, which should give a good status overview
- property temperature
- Returns:
currently set channel temperature.
- Return type:
float
- check_auto_cond(verbose=True, **kwargs)
Function to check the status of the condensation protection mode of the climate chamber.
Passes no_lock and attempts to read_value sub-call via kwargs.
- Parameters:
verbose – Setting for this specific function to print status.
- Returns:
True if CP is on, False if CP is off
- check_idle(**kwargs)
Checks, if idle mode is active or not.
- Returns:
True, if idle, False, if not idle
- getVals()
Helper function to read the values corresponding to the keys in MONITOR_KEYS.
- Returns:
dictionary of montior value names and values.
- get_temperature(**kwargs)
Simple getter method for the current temperature.
Passes no_lock and attempts to read_value sub-call via kwargs.
- measure(repetitions=1, verbose=False, **kwargs)
Measuring function, that uses getVals helper function to run.
- Parameters:
repetitions – not currently used here - to match common interface.
verbose – setting for this function specific, if measured values are to be printed.
- Returns:
values received from getVals.
- probe_temperature(target, interval=1, verbose=True)
Function to check, if a set temperature is reached. It will automatically activate/deactivate the humidity control at 20degC. Returns true, when temperature is reached.
- Parameters:
target – Temperature to reach (plus/minus tolerance)
interval – Interval / sleep in between measurements
verbose – If measurements are to be printed out
- publish(client, vals)
Function to upload measured values to an influxDB instance using mqtt.
- Parameters:
client – mqtt client to be used for upload
vals – values to be uploaded in the form of return from getVals. If None, new values are taken from getVals.
- read_value(key)
Wrapper for a read function with the binderctl.
- Parameters:
key – REGISTER to readout
- Returns:
value in this REGISTER
- set_humidity(val, **kwargs)
Setter function to easier set the temperature instead of using ‘set_value’ directly.
Passes no_lock and attempts to set_value sub-call via kwargs.
- Parameters:
val – temperature to go to
- set_temperature(val, **kwargs)
Setter function to easier set the temperature instead of using ‘set_value’ directly.
Passes no_lock and attempts to set_value sub-call via kwargs.
- Parameters:
val – temperature to go to
- set_value(key, val)
Wrapper for a write function with the binderctl Readback should automatically happen with the binderctl class, but just to be sure, this can be activated here too.
- Parameters:
key – REGISTER to write in
val – Which value to write in
- toggle_auto_cond(turn_on=True, verbose=True, **kwargs)
Auto condensation protection mode is a setting of the binder climate chamber. It helps to prevent condensation of the module inside the chamber.
To be turned off when temperature above 20degC.
Passes no_lock and attempts to read_value sub-call via kwargs.
This function changes the state of this mode.
- Parameters:
turn_on – If True, mode is activated, if False, it is deactivated
verbose – setting for this specific function, if changes are to be printed. Useful mostly in cases, where this function is executed conditionally by an automated program.
- Returns:
turn_on parameter value
- toggle_idle(enable, verbose=True)
Toggles idle switch on the device to put it to idle mode or not.
Passes no_lock and attempts to read_value sub-call via kwargs.
- Parameters:
enable – if True, device is set to idle, else, idle mode is unset.
- Returns:
status of all switches (not only idle mode switch)
- toggle_switch(bit, on)
Toggle specific switch of the machine. Can be a generic switch.
- Parameters:
bit – position of the bit corresponding to the switch in the register.
on – If True, bit to be set to 1, else bit to be set to 0.
- validate_channel(channel, raise_exception=True)
Check if an channel exists on this device. Only successful if channel == 1.
- Parameters:
channel – Channel number to validate as an input