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:
hvl_ccb.dev.base.SingleCommDevice
Pfeiffer TPG control unit device class
- class PressureUnits(value=<no_arg>, names=None, module=None, type=None, start=1, boundary=None)[source]¶
Bases:
hvl_ccb.utils.enum.NameEnum
Enum of available pressure units for the digital display. “0” corresponds either to bar or to mbar depending on the TPG model. In case of doubt, the unit is visible on the digital display.
- Micron = 3¶
- Pascal = 2¶
- Torr = 1¶
- Volt = 5¶
- bar = 0¶
- hPascal = 4¶
- mbar = 0¶
- class SensorStatus(value)[source]¶
Bases:
enum.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.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
SerialCommunicationIOError – when communication port is not opened
PfeifferTPGError – if command fails
- 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
SerialCommunicationIOError – when communication port is not opened
PfeifferTPGError – if command fails
- identify_sensors() None [source]¶
Send identification request TID to sensors on all channels.
- Raises
SerialCommunicationIOError – when communication port is not opened
PfeifferTPGError – if command fails
- 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
SerialCommunicationIOError – when communication port is not opened
PfeifferTPGError – if command fails
- 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
SerialCommunicationIOError – when communication port is not opened
PfeifferTPGError – if command fails
- property number_of_sensors¶
- set_display_unit(unit: Union[str, hvl_ccb.dev.pfeiffer_tpg.PfeifferTPG.PressureUnits]) None [source]¶
Set the unit in which the measurements are shown on the display.
- Raises
SerialCommunicationIOError – when communication port is not opened
PfeifferTPGError – if command fails
- 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
SerialCommunicationIOError – when communication port is not opened
PfeifferTPGError – if command fails
- 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
SerialCommunicationIOError – when communication port is not opened
PfeifferTPGError – if command fails
- start() None [source]¶
Start this device. Opens the communication protocol, and identify the sensors.
- Raises
SerialCommunicationIOError – when communication port cannot be opened
- property unit¶
The pressure unit of readings is always mbar, regardless of the display unit.
- class PfeifferTPGConfig(model: Union[str, hvl_ccb.dev.pfeiffer_tpg.PfeifferTPGConfig.Model] = Model.TPG25xA)[source]¶
Bases:
object
Device configuration dataclass for Pfeiffer TPG controllers.
- class Model(value=<no_arg>, names=None, module=None, type=None, start=1, boundary=None)[source]¶
Bases:
hvl_ccb.utils.enum.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}¶
- 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, hvl_ccb.dev.pfeiffer_tpg.PfeifferTPGConfig.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.
- class PfeifferTPGSerialCommunication(configuration)[source]¶
Bases:
hvl_ccb.comm.serial.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
SerialCommunicationIOError – when communication port is not opened
PfeifferTPGError – if the device does not acknowledge the command or if the answer from the device is empty
- 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
SerialCommunicationIOError – when communication port is not opened
PfeifferTPGError – if the answer from the device differs from the expected acknowledgement character ‘chr(6)’.
- 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:
hvl_ccb.comm.serial.SerialCommunicationConfig
- baudrate: int = 9600¶
Baudrate for Pfeiffer TPG controllers is 9600 baud
- bytesize: Union[int, hvl_ccb.comm.serial.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, hvl_ccb.comm.serial.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, hvl_ccb.comm.serial.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