Skip to main content

An unofficial Python package 🐍📦 to interface with CAEN high voltage power supplies

Project description

HVPS

PyPI version npm version

PyPI downloads Python Version

Build and Test Upload Python Package to PyPI and nodejs bindings to npm

🤔 What is this?

This is a Python package for controlling high voltage power supplies (HVPS) over serial port. The aim is to provide a unified pythonic interface for different HVPS models.

Along with the Python package, a minimal set of bindings for Node.js is also provided. A nodered node is also available. They both rely on the Python package to be installed in order to work.

Currently only CAEN and iseg brands are supported.

⚙️ Installation

Installation via pip is supported. To install the latest published version, run:

pip install hvps

To install the package from source, including development dependencies, clone the repository and run:

pip install .[dev]

👨‍💻 Usage

There is a hierarchy of objects that represent the HVPS and its components:

  • HVPS: represents the HVPS itself and handles the connection to the serial port
  • Module: represents a module of the HVPS. Some HVPS support multiple modules over the same connection
  • Channel: represents a channel of the HVPS

Connection

from hvps import Caen, Iseg
import logging

# connection interface is common to all HVPS
# if no serial port is specified, the first available port will be used
# if no baudrate is specified, the default baudrate will be used
# if connect=False, the connection will not be established (useful for testing)
# if logging_level is specified, the logger will be configured accordingly
hvps = Caen(port="/dev/ttyUSB0", baudrate=115200, connect=True, logging_level=logging.DEBUG)

# connection settings can be accessed
print(f"port: {hvps.port}")
print(f"baudrate: {hvps.baudrate}")

Module

from hvps import Caen

# default connection settings
caen = Caen()

module = caen.module()  # get the first module (module 0)
# if multiple modules are present, they can be accessed by index e.g. caen.module(1)

# get the module's name
print(f"module name: {module.name}")

Channel

from hvps import Caen

caen = Caen()
module = caen.module(0)

print(f"number of channels: {module.number_of_channels}")

channel = module.channel(2)  # get channel number 2

# get monitoring parameters
print(f"vmon: {channel.vmon}")
print(f"vset: {channel.vset}")

# set values (remote mode must be enabled)
# turn on channel
channel.turn_on()

channel.vset = 300.0  # 300 V

⚠️ Disclaimer

The development of this package is mostly based on documentation with access to only a few models of HVPS.

If you use this package, it is very possible you find a bug or some oversight. You are encouraged to make a pull request or to create an issue to report a bug, to request additional features or to suggest improvements.

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

hvps-0.0.32.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

hvps-0.0.32-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file hvps-0.0.32.tar.gz.

File metadata

  • Download URL: hvps-0.0.32.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for hvps-0.0.32.tar.gz
Algorithm Hash digest
SHA256 d025d8a2f04260707bb75bfadff474abdb30439b00e4ccad6abca23ab69ed7e2
MD5 3c5c0d047f81b012adac176f99cc6199
BLAKE2b-256 4b35380b31a9be6b7c28076f41a4df5731415ebb32ca1685ceaf7a01dd123f8d

See more details on using hashes here.

File details

Details for the file hvps-0.0.32-py3-none-any.whl.

File metadata

  • Download URL: hvps-0.0.32-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for hvps-0.0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 60a7aa7e5075b7e0e640bd2af4a5d8ff740d8e4a6c08a8e02fa3e0f73a2d5b3e
MD5 0b75d7eef4b638cca0d7b0109f652cf5
BLAKE2b-256 ac7d2f95a8530e40125ab3d8b671839dc6ca3c5dfc60365e04bde79b3cf107d1

See more details on using hashes here.

Supported by

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