hvl_ccb.dev.pfeiffer_tpg

Inheritance diagram of hvl_ccb.dev.pfeiffer_tpg

Device class for Pfeiffer TPG controllers.

The Pfeiffer TPG control units are used to control Pfeiffer Compact Gauges. Models: TPG 251 A, TPG 252 A, TPG 256A, TPG 261, TPG 262, TPG 361, TPG 362 and TPG 366.

Manufacturer homepage: https://www.pfeiffer-vacuum.com/en/products/measurement-analysis/ measurement/activeline/controllers/

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

Bases: SingleCommDevice

Pfeiffer TPG control unit device class

class SensorStatus(value)[source]

Bases: IntEnum

An enumeration.

Identification_error = 6
No_sensor = 5
Ok = 0
Overrange = 2
Sensor_error = 3
Sensor_off = 4
Underrange = 1
class SensorTypes(value)

Bases: Enum

An enumeration.

CMR = 4
IKR = 2
IKR11 = 2
IKR9 = 2
IMR = 5
None = 7
PBR = 6
PKR = 3
TPR = 1
noSENSOR = 7
noSen = 7
static config_cls()[source]

Return the default configdataclass class.

Returns

a reference to the default configdataclass class

static default_com_cls()[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_full_scale_mbar() List[Union[int, float]][source]

Get the full scale range of the attached sensors

Returns

full scale range values in mbar, like [0.01, 1, 0.1, 1000, 50000, 10]

Raises
get_full_scale_unitless() List[int][source]

Get the full scale range of the attached sensors. See lookup table between command and corresponding pressure in the device user manual.

Returns

list of full scale range values, like [0, 1, 3, 3, 2, 0]

Raises
identify_sensors() None[source]

Send identification request TID to sensors on all channels.

Raises
measure(channel: int) Tuple[str, float][source]

Get the status and measurement of one sensor

Parameters

channel – int channel on which the sensor is connected, with 1 <= channel <= number_of_sensors

Returns

measured value as float if measurement successful, sensor status as string if not

Raises
measure_all() List[Tuple[str, float]][source]

Get the status and measurement of all sensors (this command is not available on all models)

Returns

list of measured values as float if measurements successful, and or sensor status as strings if not

Raises
property number_of_sensors
set_full_scale_mbar(fsr: List[Union[int, float]]) None[source]

Set the full scale range of the attached sensors (in unit mbar)

Parameters

fsr – full scale range values in mbar, for example [0.01, 1000]

Raises
set_full_scale_unitless(fsr: List[int]) None[source]

Set the full scale range of the attached sensors. See lookup table between command and corresponding pressure in the device user manual.

Parameters

fsr – list of full scale range values, like [0, 1, 3, 3, 2, 0]

Raises
start() None[source]

Start this device. Opens the communication protocol, and identify the sensors.

Raises

SerialCommunicationIOError – when communication port cannot be opened

stop() None[source]

Stop the device. Closes also the communication protocol.

property unit

The pressure unit of readings is always mbar, regardless of the display unit.

class PfeifferTPGConfig(model: Union[str, Model] = Model.TPG25xA)[source]

Bases: object

Device configuration dataclass for Pfeiffer TPG controllers.

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

Bases: NameEnum

An enumeration.

TPG25xA = {0.1: 8, 1: 0, 10: 1, 100: 2, 1000: 3, 2000: 4, 5000: 5, 10000: 6, 50000: 7}
TPGx6x = {0.01: 0, 0.1: 1, 1: 2, 10: 3, 100: 4, 1000: 5, 2000: 6, 5000: 7, 10000: 8, 50000: 9}
is_valid_scale_range_reversed_str(v: str) bool[source]

Check if given string represents a valid reversed scale range of a model.

Parameters

v – Reversed scale range string.

Returns

True if valid, False otherwise.

clean_values()[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

is_configdataclass = True
classmethod keys() Sequence[str]

Returns a list of all configdataclass fields key-names.

Returns

a list of strings containing all keys.

model: Union[str, Model] = {0.1: 8, 1: 0, 10: 1, 100: 2, 1000: 3, 2000: 4, 5000: 5, 10000: 6, 50000: 7}
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.

exception PfeifferTPGError[source]

Bases: DeviceError

Error with the Pfeiffer TPG Controller.

class PfeifferTPGSerialCommunication(configuration)[source]

Bases: SerialCommunication

Specific communication protocol implementation for Pfeiffer TPG controllers. Already predefines device-specific protocol parameters in config.

static config_cls()[source]

Return the default configdataclass class.

Returns

a reference to the default configdataclass class

query(cmd: str) str[source]

Send a query, then read and returns the first line from the com port.

Parameters

cmd – query message to send to the device

Returns

first line read on the com

Raises
send_command(cmd: str) None[source]

Send a command to the device and check for acknowledgement.

Parameters

cmd – command to send to the device

Raises
class PfeifferTPGSerialCommunicationConfig(terminator: bytes = b'\r\n', encoding: str = 'utf-8', encoding_error_handling: str = 'strict', wait_sec_read_text_nonempty: Union[int, float] = 0.5, default_n_attempts_read_text_nonempty: int = 10, port: Union[str, NoneType] = None, baudrate: int = 9600, parity: Union[str, hvl_ccb.comm.serial.SerialCommunicationParity] = <SerialCommunicationParity.NONE: 'N'>, stopbits: Union[int, hvl_ccb.comm.serial.SerialCommunicationStopbits] = <SerialCommunicationStopbits.ONE: 1>, bytesize: Union[int, hvl_ccb.comm.serial.SerialCommunicationBytesize] = <SerialCommunicationBytesize.EIGHTBITS: 8>, timeout: Union[int, float] = 3)[source]

Bases: SerialCommunicationConfig

baudrate: int = 9600

Baudrate for Pfeiffer TPG controllers is 9600 baud

bytesize: Union[int, SerialCommunicationBytesize] = 8

One byte is eight bits long

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.

parity: Union[str, SerialCommunicationParity] = 'N'

Pfeiffer TPG controllers do not use parity

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.

stopbits: Union[int, SerialCommunicationStopbits] = 1

Pfeiffer TPG controllers use one stop bit

terminator: bytes = b'\r\n'

The terminator is <CR><LF>

timeout: Union[int, float] = 3

use 3 seconds timeout as default