Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/hvpsPublic

A Python package for controlling high voltage power supplies (HVPS) over serial port. Supports CAEN and iseg power supplies.

License

NotificationsYou must be signed in to change notification settings

lobis/hvps

Repository files navigation

All Contributors

PyPI versionnode.js bindingsnode-red node

PyPI downloadsPython Version

Build and TestUpload 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 onlyCAEN andiseg brands are supported.

Installation ⚙️

Installation viapip is supported.To install the latestpublished 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. The classesCaen andIseg areavailable for the respective brands.
  • Module: represents a module of the HVPS. Some HVPS support multiple modules over the same connection
  • Channel: represents a channel of the HVPS

Connection

fromhvpsimportCaen,Isegimportlogging# 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 logging_level is specified, the logger will be configured accordinglywithCaen(port="/dev/ttyUSB0",baudrate=115200,logging_level=logging.DEBUG)ashvps:# using context manager (with) is recommended, but not required.# If not used, the connection must be opened and closed manually (hvps.open() and hvps.close())# connection settings can be accessedprint(f"port:{hvps.port}")print(f"baudrate:{hvps.baudrate}")

Module

fromhvpsimportCaen# default connection settingswithCaen()ascaen: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 nameprint(f"module name:{module.name}")

Channel

fromhvpsimportCaenwithCaen()ascaen:module=caen.module(0)print(f"number of channels:{module.number_of_channels}")channel=module.channel(2)# get channel number 2# get monitoring parametersprint(f"vmon:{channel.vmon}")print(f"vset:{channel.vset}")# set values (remote mode must be enabled)# turn on channelchannel.turn_on()channel.vset=300.0# 300 V

CLI 🖥️

A CLI is provided to interact with the HVPS from the command line.

TODO @AlonsoDRDLV

Show available serial ports

python -m hvps --ports

Output:command output

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 apull request or to createanissue to report a bug, to request additional features or to suggestimprovements.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Luis Antonio Obis Aparicio
Luis Antonio Obis Aparicio

💻
AlonsoDRDLV
AlonsoDRDLV

💻
jherkenhoff
jherkenhoff

💻

This project follows theall-contributors specification.Contributions of any kind welcome!

About

A Python package for controlling high voltage power supplies (HVPS) over serial port. Supports CAEN and iseg power supplies.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp