pylablib.devices.KJL package

Submodules

pylablib.devices.KJL.base module

exception pylablib.devices.KJL.base.KJLError[source]

Bases: pylablib.core.devio.base.DeviceError

Generic KJL device error

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pylablib.devices.KJL.base.KJLBackendError(exc)[source]

Bases: pylablib.devices.KJL.base.KJLError, pylablib.core.devio.comm_backend.DeviceBackendError

Generic KJL backend communication error

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class pylablib.devices.KJL.base.TKJL300DeviceInfo(swver)

Bases: tuple

count()

Return number of occurrences of value.

index()

Return first index of value.

Raises ValueError if the value is not present.

swver
class pylablib.devices.KJL.base.KJL300(conn, addr=1)[source]

Bases: pylablib.core.devio.comm_backend.ICommBackendWrapper

KJL300 series pressure gauge.

Parameters:
  • conn – serial connection parameters (usually port or a tuple containing port and baudrate)
  • addr – RS485 address (required both for RS-485 and for RS-232 communication; factory default is 1)
Error

alias of KJLError

comm(msg)[source]

Send a command to the device

query(msg)[source]
get_device_info()[source]

Get device info (a tuple (swver))

reset(confirm_addr=False)[source]

Reset the controller.

If confirm_addr==True, set current RS485 address again (required for resetting after some commands).

get_pressure()[source]

Get current pressure in Pa

get_relay_setpoints(relay=1)[source]

Get relay setpoints (in Pa).

relay is the relay index (either 1 or 2). Return tuple (on, off) for on-below and off-above pressures (on is always smaller than off)

set_relay_setpoints(relay=1, on=None, off=None, reset=True)[source]

Set relay setpoints (in Pa).

relay is the relay index (either 1 or 2). on and off are on-below and off-above pressures (on is always smaller than off). If reset==True, reset the device after changing the setpoints (required to take effect). None values are left unchanged.

set_zero(pressure=0)[source]

Set vacuum calibration point (in Pa)

set_span(pressure=100000.0)[source]

Set atmosphere calibration point (in Pa)

class NoParameterCaller(device, kind)

Bases: object

Class to simplify calling functions without a parameter

apply_settings(settings)

Apply the settings.

settings is the dict {name: value} of the device available settings. Non-applicable settings are ignored.

close()

Close the backend

get_device_variable(key)

Get the value of a settings, status, or full info parameter

get_full_info(include=0)

Get dict {name: value} containing full device information (including status and settings).

include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or "all" (all available variables). Since the lowest priority is -10, setting include=-10 queries all available variables, which is equivalent to include="all".

get_full_status(include=0)

Get dict {name: value} containing the device status (including settings).

include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or "all" (all available variables). Since the lowest priority is -10, setting include=-10 queries all available variables, which is equivalent to include="all".

get_settings(include=0)

Get dict {name: value} containing all the device settings.

include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or "all" (all available variables). Since the lowest priority is -10, setting include=-10 queries all available variables, which is equivalent to include="all".

is_opened()

Check if the device is connected

lock(timeout=None)

Lock the access to the device from other threads/processes (isn’t necessarily implemented)

locking(timeout=None)

Context manager for lock & unlock

open()

Open the backend

set_device_variable(key, value)

Set the value of a settings parameter

unlock()

Unlock the access to the device from other threads/processes (isn’t necessarily implemented)

Module contents