pylablib.devices.Pfeiffer package¶
Submodules¶
pylablib.devices.Pfeiffer.base module¶
-
exception
pylablib.devices.Pfeiffer.base.
PfeifferError
[source]¶ Bases:
pylablib.core.devio.base.DeviceError
Generic Pfeiffer device error
-
args
¶
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
exception
pylablib.devices.Pfeiffer.base.
PfeifferBackendError
(exc)[source]¶ Bases:
pylablib.devices.Pfeiffer.base.PfeifferError
,pylablib.core.devio.comm_backend.DeviceBackendError
Generic Pfeiffer backend communication error
-
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
¶
-
count
()¶ Return number of occurrences of value.
-
high_thresh
¶
-
index
()¶ Return first index of value.
Raises ValueError if the value is not present.
-
low_thresh
¶
-
-
class
pylablib.devices.Pfeiffer.base.
TTPG260GaugeControlSettings
(activation_control, deactivation_control, on_thresh, off_thresh)¶ Bases:
tuple
-
activation_control
¶
-
count
()¶ Return number of occurrences of value.
-
deactivation_control
¶
-
index
()¶ Return first index of value.
Raises ValueError if the value is not present.
-
off_thresh
¶
-
on_thresh
¶
-
-
class
pylablib.devices.Pfeiffer.base.
TPG260
(conn)[source]¶ Bases:
pylablib.core.devio.comm_backend.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
-
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.
-
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
.
-
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 usingget_units()
. Ifstatus_error==True
and the channel status is not"ok"
, raise and error; otherwise, returnNone
.
-
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_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_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"]
.
-
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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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:
pylablib.core.devio.comm_backend.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
-
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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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)
-