Skip to main content

No project description provided

Project description

pfeiffer-turbo

Python versions on PyPI pfeiffer-turbo version on PyPI
Python interface RS485 connections for Pfeiffer HiPace turbo drive units. Currently only the TM700 is implemented. Also supports connecting through a TCPIP socket, e.g. when using a serial to TCPIP converter for the turbo controller.

Development (uv)

uv sync --extra dev
uv run pytest

Example

RS485 connection example

from pfeiffer_turbo import TM700, SerialTransport

pump = TM700(address=1, transport=SerialTransport(port="COM9"))
# or: pump = TM700.from_serial("COM9", address=1)

# get the rotation speed in Hz
pump.actual_spd

# start the pump
pump.start()

# stop the pump
pump.stop()

TCPIP connection example

from pfeiffer_turbo import TM700, TcpTransport

pump = TM700(address=1, transport=TcpTransport(host="10.10.222.8", port=12345))
# or: pump = TM700.from_tcp("10.10.222.8", 12345, address=1)

# get the rotation speed in Hz
pump.actual_spd

# start the pump
pump.start()

# stop the pump
pump.stop()

Writable parameters and validation

Only parameters marked read-write by the parameter metadata can be assigned. When assigning values, the library validates:

  • type (bool/int/float/str as defined per parameter)
  • allowed options (options map when present)
  • value limits (min/max when present)

Example:

# writable
pump.set_rot_spd = 600

# raises ValueError (invalid option)
# pump.gas_mode = 999

Implementation

A baseclass DriveUnit:

class DriveUnit:
    def __init__(
        self,
        transport: BaseTransport,
        address: int,
        supported_parameters: Sequence[int],
    ):

takes in a set of integers that correspond to pfeiffer vacuum parameters supported by the particular drive unit. Implemented vacuum parameters are seen in parameters.py. The getters and setters are then dynamically generated based on the supported_parameters and info in parameters.py; the enum Parameters contains all implemented pfeiffer vacuum parameters, and the dictionary parameters contains key, value pairs of Parameters and ParameterInfo, where ParameterInfo is a dataclass containing the implemenation information for a particular parameter:

@dataclass
class Parameter:
    designation: str
    data_type: DataType
    access: StopIteration
    min: Optional[int] = None
    max: Optional[int] = None
    unit: Optional[str] = None
    default: Optional[Union[int, float, str]] = None
    options: Optional[dict[int, str]] = None

Implementing new drive units is be done by inheriting from DriveUnit and specifying which pfeiffer parameters are supported by the specific model. New parameters can be implemented by extending the Parameters enum and parameters dictionary. The class attributes are named similarly to the Pfeiffer vacuum parameters, with underscores inserted between uppercase - lowercase transitions and all lowercase letters. E.g. GasMode -> gas_mode.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pfeiffer_turbo-0.2.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pfeiffer_turbo-0.2.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file pfeiffer_turbo-0.2.0.tar.gz.

File metadata

  • Download URL: pfeiffer_turbo-0.2.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pfeiffer_turbo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f9c5f76161574aa963c90f4b2db826d01469cda9659a090ad8a7fb83b0b32c4c
MD5 08224550856a7b6bf14ce535dfc39f0c
BLAKE2b-256 80af9df9cfd9336b6f0978e514cb765ffee3915fc4a816be9a5e2981eaa85a70

See more details on using hashes here.

File details

Details for the file pfeiffer_turbo-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pfeiffer_turbo-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pfeiffer_turbo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4d56fbab65f379503a80c0e55a1da0b3a43df903ed79942e321938a620f29c1
MD5 c27255fc29b37bdb166799d3d6b8d2f9
BLAKE2b-256 61325244074b50247afc091dd41b81adeae82fd7e837c14dc10dbe08f6aeccb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page