hvl_ccb.dev.lauda.lauda

Inheritance diagram of hvl_ccb.dev.lauda.lauda

Device class for controlling a Lauda PRO RP245E, circulation chiller over TCP.

class LaudaProRp245e(com, dev_config=None)[source]

Bases: SingleCommDevice

Lauda RP245E circulation chiller class.

static config_cls() type[LaudaProRp245eConfig][source]

Return the default configdataclass class.

Returns:

a reference to the default configdataclass class

continue_ramp() str[source]

Continue current ramp program.

Returns:

reply of the device to the last call of “query”

static default_com_cls() type[LaudaProRp245eTcpCommunication][source]

Get the class for the default communication protocol used with this device.

Returns:

the type of the standard communication protocol for this device

get_bath_temp() float[source]

:return : float value of measured lauda bath temp in °C

get_device_type() str[source]

:return : Connected Lauda device type (for connection/com test)

pause() str[source]

Stop temperature control and pump.

Returns:

reply of the device to the last call of “query”

pause_ramp() str[source]

Pause current ramp program.

Returns:

reply of the device to the last call of “query”

reset_ramp() str[source]

Delete all segments from current ramp program.

Returns:

reply of the device to the last call of “query”

run() str[source]

Start temperature control & pump.

Returns:

reply of the device to the last call of “query”

set_control_mode(mod: int | ExtControlModeEnum = ExtControlModeEnum.INTERNAL) str[source]

Define control mode. 0 = INTERNAL (control bath temp), 1 = EXPT100 (pt100 attached to chiller), 2 = ANALOG, 3 = SERIAL, 4 = USB, 5 = ETH (to be used when passing the ext. temp. via ethernet) (temperature then needs to be passed every second, when not using options 3, 4, or 5)

Parameters:

mod – temp control mode (control internal temp or external temp).

Returns:

reply of the device to the last call of “query” (“OK”, if command was recognized”)

set_external_temp(external_temp: float = 20.0) str[source]

Pass value of external controlled temperature. Should be done every second, when control of external temperature is active. Has to be done right before control of external temperature is activated.

Parameters:

external_temp – current value of external temperature to be controlled.

Returns:

reply of the device to the last call of “query”

set_pump_level(pump_level: int = 6) str[source]

Set pump level Raises ValueError, if pump level is invalid.

Parameters:

pump_level – pump level.

Returns:

reply of the device to the last call of “query”

set_ramp_iterations(num: int = 1) str[source]

Define number of ramp program cycles.

Parameters:

num – number of program cycles to be performed.

Returns:

reply of the device to the last call of “query”

set_ramp_program(program: int = 1) str[source]

Define ramp program for following ramp commands. Raises ValueError if maximum number of ramp programs (5) is exceeded.

Parameters:

program – Number of ramp program to be activated for following commands.

Returns:

reply of the device to the last call of “query”

set_ramp_segment(temp: float = 20.0, dur: int = 0, tol: float = 0.0, pump: int = 6) str[source]

Define segment of current ramp program - will be attached to current program. Raises ValueError, if pump level is invalid.

Parameters:
  • temp – target temperature of current ramp segment

  • dur – duration in minutes, in which target temperature should be reached

  • tol – tolerance at which target temperature should be reached (for 0.00, next segment is started after dur has passed).

  • pump – pump level to be used for this program segment.

Returns:

reply of the device to the last call of “query”

set_temp_set_point(temp_set_point: float = 20.0) str[source]

Define temperature set point

Parameters:

temp_set_point – temperature set point.

Returns:

reply of the device to the last call of “query”

start() None[source]

Start this device.

start_ramp() str[source]

Start current ramp program.

Returns:

reply of the device to the last call of “query”

stop() None[source]

Stop this device. Disables access and closes the communication protocol.

stop_ramp() str[source]

Stop current ramp program.

Returns:

reply of the device to the last call of “query”

validate_pump_level(level: int)[source]

Validates pump level. Raises ValueError, if pump level is incorrect. :param level: pump level, integer

class LaudaProRp245eCommand(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: ValueEnum

Commands for Lauda PRO RP245E Chiller Command strings most often need to be complimented with a parameter (attached as a string) before being sent to the device. Commands implemented as defined in “Lauda Betriebsanleitung fuer PRO Badthermostate und Umwaelzthermostate” pages 42 - 49

BATH_TEMP = 'IN_PV_00'

Request internal bath temperature

COM_TIME_OUT = 'OUT_SP_08_'

Define communication time out

CONT_MODE = 'OUT_MODE_01_'

Set control mode 1=internal, 2=ext. analog, 3=ext. serial, 4=USB, 5=ethernet

DEVICE_TYPE = 'TYPE'

Request device type

EXTERNAL_TEMP = 'OUT_PV_05_'

Pass on external controlled temperature

LOWER_TEMP = 'OUT_SP_05_'

Define lower temp limit

OPERATION_MODE = 'OUT_SP_02_'

Define operation mode

PUMP_LEVEL = 'OUT_SP_01_'

Define pump level 1-8

RAMP_CONTINUE = 'RMP_CONT'

Continue a paused ramp program

RAMP_DELETE = 'RMP_RESET'

Reset a selected ramp program

RAMP_ITERATIONS = 'RMP_OUT_02_'

Define how often a ramp program should be iterated

RAMP_PAUSE = 'RMP_PAUSE'

Pause a selected ramp program

RAMP_SELECT = 'RMP_SELECT_'

Select a ramp program (target for all further ramp commands)

RAMP_SET = 'RMP_OUT_00_'

Define parameters of a selected ramp program

RAMP_START = 'RMP_START'

Start a selected ramp program

RAMP_STOP = 'RMP_STOP'

Stop a running ramp program

START = 'START'

Start temp control (pump and heating/cooling)

STOP = 'STOP'

Stop temp control (pump and heating/cooling)

TEMP_SET_POINT = 'OUT_SP_00_'

Define temperature set point

UPPER_TEMP = 'OUT_SP_04_'

Define upper temp limit

build_str(param: str = '', terminator: str = '\r\n')[source]

Build a command string for sending to the device

Parameters:
  • param – Command’s parameter given as string

  • terminator – Command’s terminator

Returns:

Command’s string with a parameter and terminator

exception LaudaProRp245eCommandError[source]

Bases: DeviceError

Error raised when an error is returned upon a command.

class LaudaProRp245eConfig(temp_set_point_init: int | float = 20.0, pump_init: int = 6, upper_temp: int | float = 80.0, lower_temp: int | float = -55.0, com_time_out: int | float = 0, max_pump_level: int = 8, max_pr_number: int = 5, operation_mode: int | OperationModeEnum = OperationModeEnum.AUTO, control_mode: int | ExtControlModeEnum = ExtControlModeEnum.INTERNAL)[source]

Bases: object

Configuration for the Lauda RP245E circulation chiller.

class ExtControlModeEnum(value)[source]

Bases: IntEnum

Source for definition of external, controlled temperature (option 2, 3 and 4 are not available with current configuration of the Lauda RP245E, add-on hardware would required)

ANALOG = 2
ETH = 5
EXPT100 = 1
INTERNAL = 0
SERIAL = 3
USB = 4
class OperationModeEnum(value)[source]

Bases: IntEnum

Operation Mode (Cooling OFF/Cooling On/AUTO - set to AUTO)

AUTO = 2

Automatically select heating/cooling

COOLOFF = 0
COOLON = 1
clean_values() None[source]
com_time_out: int | float = 0

Communication time out (0 = OFF)

control_mode: int | ExtControlModeEnum = 0
force_value(fieldname, value)

Forces a value to a dataclass field despite the class being frozen.

NOTE: you can define post_force_value method with same signature as this method to do extra processing after value has been forced on fieldname.

Parameters:
  • fieldname – name of the field

  • value – value to assign

is_configdataclass = True
classmethod keys() Sequence[str]

Returns a list of all configdataclass fields key-names.

Returns:

a list of strings containing all keys.

lower_temp: int | float = -55.0

Lower temperature limit (safe for Galden HT135 cooling liquid)

max_pr_number: int = 5

Maximum number of ramp programs that can be stored in the memory of the chiller

max_pump_level: int = 8

Highest pump level of the chiller

operation_mode: int | OperationModeEnum = 2
classmethod optional_defaults() dict[str, object]

Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.

Returns:

a list of strings containing all optional keys.

pump_init: int = 6

Default pump Level

classmethod required_keys() Sequence[str]

Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.

Returns:

a list of strings containing all required keys.

temp_set_point_init: int | float = 20.0

Default temperature set point

upper_temp: int | float = 80.0

Upper temperature limit (safe for Galden HT135 cooling liquid)

class LaudaProRp245eTcpCommunication(configuration)[source]

Bases: Tcp

Implements the Communication Protocol for Lauda PRO RP245E TCP connection.

close() None[source]

Close the Lauda PRO RP245E TCP connection.

static config_cls() type[LaudaProRp245eTcpCommunicationConfig][source]

Return the default configdataclass class.

Returns:

a reference to the default configdataclass class

open() None[source]

Open the Lauda PRO RP245E TCP connection.

Raises:

LaudaProRp245eCommandError – if the connection fails.

query_command(command: LaudaProRp245eCommand, param: str = '') str[source]

Send and receive function. E.g. to be used when setting/changing device setting. :param command: first part of command string, defined in LaudaProRp245eCommand :param param: second part of command string, parameter (by default ‘’) :return: None

read() str[source]

Receive value function. :return: reply from device as a string, the terminator, as well as the ‘OK’ stripped from the reply to make it directly useful as a value (e.g. in case the internal bath temperature is requested)

write_command(command: LaudaProRp245eCommand, param: str = '') None[source]

Send command function. :param command: first part of command string, defined in LaudaProRp245eCommand :param param: second part of command string, parameter (by default ‘’) :return: None

class LaudaProRp245eTcpCommunicationConfig(host: str | IPv4Address | IPv6Address, port: int = 54321, bufsize: int = 1024, wait_sec_pre_read_or_write: int | float = 0.005, terminator: str = '\r\n')[source]

Bases: TcpCommunicationConfig

Configuration dataclass for LaudaProRp245eTcpCommunication.

clean_values() None[source]
force_value(fieldname, value)

Forces a value to a dataclass field despite the class being frozen.

NOTE: you can define post_force_value method with same signature as this method to do extra processing after value has been forced on fieldname.

Parameters:
  • fieldname – name of the field

  • value – value to assign

classmethod keys() Sequence[str]

Returns a list of all configdataclass fields key-names.

Returns:

a list of strings containing all keys.

classmethod optional_defaults() dict[str, object]

Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.

Returns:

a list of strings containing all optional keys.

classmethod required_keys() Sequence[str]

Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.

Returns:

a list of strings containing all required keys.

terminator: str = '\r\n'

The terminator character

wait_sec_pre_read_or_write: int | float = 0.005

Delay time between commands in seconds