pylablib.devices.Pfeiffer package

Submodules

pylablib.devices.Pfeiffer.base module

exception pylablib.devices.Pfeiffer.base.PfeifferError[source]

Bases: DeviceError

Generic Pfeiffer device error

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

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

exception pylablib.devices.Pfeiffer.base.PfeifferBackendError(exc)[source]

Bases: PfeifferError, DeviceBackendError

Generic Pfeiffer backend communication error

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

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

class pylablib.devices.Pfeiffer.base.TTPG260SwitchSettings(channel, low_thresh, high_thresh)

Bases: tuple

channel
high_thresh
low_thresh
class pylablib.devices.Pfeiffer.base.TTPG260GaugeControlSettings(activation_control, deactivation_control, on_thresh, off_thresh)

Bases: tuple

activation_control
deactivation_control
off_thresh
on_thresh
class pylablib.devices.Pfeiffer.base.TPG260(conn)[source]

Bases: ICommBackendWrapper

TPG260 series (TPG261/262) pressure gauge.

Parameters:

conn – serial connection parameters (usually port or a tuple containing port and baudrate)

Error

alias of PfeifferError

comm(msg)[source]

Send a command to the device

query(msg, data_type='str')[source]

Send a query to the device and return the reply

get_units()[source]

Get device units for indication/reading ("mbar", "torr", or "pa")

set_units(units)[source]

Set device units for indication/reading ("mbar", "torr", or "pa")

to_Pa(value, units=None)[source]

Convert value in the given units to Pa.

If units is None, use the current display units.

from_Pa(value, units=None)[source]

Convert value in the given units from Pa.

If units is None, use the current display units.

get_display_channel()[source]

Get controller display channel

set_display_channel(channel=1)[source]

Set controller display channel

get_display_resolution()[source]

Get controller display resolution (number of digits)

set_display_resolution(resolution=2)[source]

Set controller display resolution (number of digits)

is_enabled(channel=1)[source]

Check if the gauge at the given channel is enabled.

If the gauge cannot be turned on/off (e.g., not connected), return None.

enable(enable=True, channel=1)[source]

Enable or disable the gauge at the given channel

get_channel_status(channel=1)[source]

Get channel status.

Can be "ok", "under" (underrange), "over" (overrange), "sensor_error", "sensor_off", "no_sensor", or "id_error".

get_pressure(channel=1, display_units=False, status_error=True)[source]

Get pressure at a given channel.

If display_units==False, return result in Pa; otherwise, use display units obtained using get_units(). If status_error==True and the channel status is not "ok", raise and error; otherwise, return None.

get_gauge_kind(channel=1)[source]
get_measurement_filter(channel=1)[source]

Get gauge measurement filter ("fast", "medium", or "slow")

set_measurement_filter(meas_filter, channel=1)[source]

Set gauge measurement filter ("fast", "medium", or "slow")

get_calibration_factor(channel=1)[source]

Get gauge calibration factor

set_calibration_factor(coefficient, channel=1)[source]

Set gauge calibration factor

get_switch_settings(switch_function)[source]

Get settings for the given switch function (between 1 and 4).

Return tuple (channel, low_thresh, high_thresh). The thresholds are given in Pa.

setup_switch(switch_function, channel, low_thresh, high_thresh)[source]

Get settings for the given switch function (between 1 and 4).

Return tuple (channel, low_thresh, high_thresh). The thresholds are given in Pa.

get_switch_status()[source]

Return status of the 4 switch functions

get_gauge_control_settings(channel)[source]

Get settings for the gauge control on the given channel.

Return tuple (activation_control, deactivation_control, on_thresh, off_thresh). The thresholds are given in Pa.

setup_gauge_control(channel, activation_control, deactivation_control, on_thresh, off_thresh)[source]

Setup gauge control on the given channel.

Return tuple (activation_control, deactivation_control, on_thresh, off_thresh). The thresholds are given in Pa.

get_current_errors()[source]

Get a list of all present error messages.

If there are no errors, return a single-element list ["no_error"].

reset_error()[source]

Cancel currently active errors and return to measurement mode.

Return the list of currently present errors. If there are no errors, return a single-element list ["no_error"].

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)

class pylablib.devices.Pfeiffer.base.DPG202(conn)[source]

Bases: ICommBackendWrapper

DPG202/TPG202 control unit.

Parameters:

conn – serial connection parameters (usually port or a tuple containing port and baudrate)

Error

alias of PfeifferError

query(parameter, value='=?', action=0, address=1, send_type=None, recv_type=None)[source]

Send a query to the device and parse the reply.

Parameters:
  • parameter – parameter number

  • value – value to send ("=?" for a value request)

  • action – request action (0 for value request, 1 for a command)

  • address – unit address

  • send_type – data type for the sent value (ignored for value requests)

  • recv_type – data type for the received value (None means returning a raw string value)

get_value(parameter, data_type, address=1)[source]

Send a data request to the device.

Parameters:
  • parameter – parameter number

  • data_type – data type for the received value

  • address – unit address

comm(parameter, value, data_type, address=1)[source]

Send a control command to the device.

Parameters:
  • parameter – parameter number

  • value – associated command value

  • data_type – data type for the sent value

  • address – unit address

get_pressure(address=1)[source]

Get pressure at a given unit address

get_error_code(address=1)[source]

Get the current error code at a given unit address

get_software_version(address=1)[source]

Get the software version at a given unit address

get_device_name(address=1)[source]

Get the name of the gauge at a given unit address

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