Skip to main content

Python package for controlling a Hamamatsu c11204-01/02 power supply.

Project description

c11204ps

PyPI - Version PyPI - Python Version

Python package for controlling a Hamamatsu c11204-01/02 power supply. This is essentially a re-write of pyCLAWSps. While the pyCLAWSps was fine for basic control of a c11204 power supply, this package aims to provide a more general, streamlined python interface.

For the reason of this being based on pyCLAWSps, the version count for this package starts at 0.2.0.

Installation

This package should be in the package index and installable with pip.

pip install c11204ps

Alternatively build with hatch and install from .whl. Run from the root of this repository

hatch build
pip install ./dist/c11204ps-0.2.0-py3-none-any.whl

Adjust filename for current verison if neccessary.

Compatibility

The code was developed for a power supply board for the CLAWS scintillation detectors and was only ever tested in this context. However, technically pretty much all functionality should be general, making this package usable as long as the c11204-01/02 serial UART interface can be accessed.

Using the package

Simply instantiate a C11204PS object and call any of the implemented functions. The functions themselves should be documented with docstrings in the code. An example to set and check the voltage is the following:

from c11204ps import C11204PS
# Call with no arguments initializes with first serial port with name
# containing 'CP210' or 'Q_MPPC_CTL'.
ps = C11204PS()  
ps.hv_disable()  # Disable voltage supply
print(ps.get_voltage())  # Should read close to zero

ps.set_voltage(56.7)  # Set the voltage (choose appropriate value)

ps.hv_enable()
print(ps.get_voltage())  # Should read close to set voltage

print(ps.get_status())  # Print dict of status flags for the power supply

License

c11204ps is distributed under the terms of the GPL-3.0-only license.

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

c11204ps-0.2.1.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

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

c11204ps-0.2.1-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file c11204ps-0.2.1.tar.gz.

File metadata

  • Download URL: c11204ps-0.2.1.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for c11204ps-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3b3c6bfbaab44601598f16b5ed505ba9d4ad4ff594c121b0915db1383677cba0
MD5 4af05373d2d596972513560bcb91f23b
BLAKE2b-256 0ba2ad9637b6ecfb16476abc0590970615e0486044629ca0abd1512fbb28cd09

See more details on using hashes here.

File details

Details for the file c11204ps-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: c11204ps-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for c11204ps-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 228e5221da12d4a936429d001ad7acdf81ecca80995ffd328c51a941b86f25da
MD5 b8453b1fe7da745f09b7ce9aef929a89
BLAKE2b-256 68e0160f16759cd3db88b873584eba243260f71a5ee9803ccc59c7dfe18c4e1d

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