Metadata-Version: 2.2
Name: agilent_vacuum
Version: 0.1.2
Summary: A package for commuincation with various Agilent Vacuum pump controllers and sensors.
Author-email: Ulrik Södergreb <ulrik.sodergren@luxbright.com>
License: MIT License
        
        Copyright (c) 2022 Ulrik Södergren
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/luxbright-com/agilent_vacuum
Project-URL: Bug Tracker, https://github.com/luxbright-com/agilent_vacuum/issues
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 4 - Beta
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiofiles>=24.1
Requires-Dist: aioserial>=1.3
Requires-Dist: pyserial>=3.5
Requires-Dist: tenacity>=8.0
Provides-Extra: test
Requires-Dist: pytest>8.3; extra == "test"
Requires-Dist: pytest-asyncio>0.24; extra == "test"
Requires-Dist: pytest-timeout>2.3; extra == "test"
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: twine; extra == "dev"

# Agilent-Vacuum
A collection of classes for communication with various Agilent Vacuum pump controllers.

This package supports:
* Agilent TwissTorr 74FS Rack Turbo Pump controller [PDF user guide](https://www.agilent.com/cs/library/usermanuals/public/TwisTorr%2074%20FS%20AG%20Rack%20Controller.pdf)
* Agilent IPCMini Ion Pump Controller [PDF user guide](https://www.agilent.com/cs/library/usermanuals/public/IPCMini.pdf)

This is was developed for internal use at Luxbright.
It has been used 24/7 in production lines and R&D labs since year 2023.
But we only use a subset of all implemented commands and not all commands are tested by the pytest suite.

I hope that it can be useful as it is, or as source of inspiration for somebudy else.
This is not an official library from Agilent and we are not associated with the, 
we are only a user of their products.

This library is implemented using asyncio.

## Turbo pump driver usage

    from agilent_vacuum.twis_torr_74 import TwisTorr74Driver
    from agilent_vacuum.communication import PressureUnit, SerialClient
    from agilent_vacuum.exceptions import ComError, WinDisabled
 

Create a serial client, this exaple connects to a USB to RS232 adapter on a Raspberry Pi.
Initiate a driver and try to connect to controller.

    client = SerialClient("/dev/ttyS0")
    turbo = TwisTorr74Driver(client)
    try:
        await turbo.connect()
    except ComError as e:
        logger.warning(f"Turbo pump connect failed. {e}")
    except EOFError as e:
        logger.warning(f"Turbo pump connect failed. {e}")

Start turbo pump and read status and speed.

    await turbo.start()
    status = await turbo.get_status()
    speed = await turbo.read_turbo_speed
    logger.info(f"Turbo status {status.name} and speed {speed} rpm.")

Read vacuum gauge (requires optional gauge connected to controller)

    unit = await turbo.get_pressure_unit()
    value = await turbo.read_presure()
    logger.info(f"{pressure} {unit.name}")

Stop turbo pump.

    await turbo.stop()


## Ion pump driver usage

    from agilent_vacuum.ipc_mini import IpcMiniDriver, PumpStatus
    from agilent_vacuum.communication import PressureUnit, SerialClient
    from agilent_vacuum.exceptions import ComError, WinDisabled

Create a serial client, this exaple connects to the UART on a Raspberry Pi via an RS323 circuit.
Initiate a driver and try to connect to controller.

    client = SerialClient("/dev/ttyS0")
    ion_pump = IpcMiniDriver(client)
    try:
        await ion_pump.connect()
    except ComError as e:
        logger.warning(f"Turbo pump connect failed. {e}")
    except EOFError as e:
        logger.warning(f"Turbo pump connect failed. {e}")

Start the Ion Pump and read status

    await ion_pump.start()
    status = await ion_pump.get_status()
    logger.info(f"Ion pump status {status.name}")

Read vacuum level

    unit = await ion_pump.get_pressure_unit()
    value = await ion_pump.read_presure()
    logger.info(f"{pressure} {unit.name}")

Stop Ion Pump

    await ion_pump.stop()

