Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/randomggames/cpx400dp
A python class for working with the TTi CPX400DP power supply over USB
https://github.com/randomggames/cpx400dp
Last synced: 24 days ago
JSON representation
A python class for working with the TTi CPX400DP power supply over USB
- Host: GitHub
- URL: https://github.com/randomggames/cpx400dp
- Owner: RandomGgames
- Created: 2023-12-05T20:27:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-07T16:54:23.000Z (11 months ago)
- Last Synced: 2024-10-14T06:35:56.521Z (2 months ago)
- Language: Python
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ATTI-CPX400DP Python Module
## Overview
The AimTTI CPX400DP Python module provides a class for interfacing with CPX400DP power supplies through serial communication via a USB cable. It allows control through a UI when run as \_\_main\_\_ or can be imported into code and can be scripted. Included are features for connecting to a power supply, setting voltage and current values, enabling/disabling channels, retrieving status information, and more.
## Installation
CPX400DP.py must be downloaded into the project folder. It is not available yet through PIP as of yet (I might do this one day)
## Usage
Eample script:
```py
from CPX400DP import CPX400DP# Instantiate the CPX400DP class
power_supply = CPX400DP()com_port = 'COM3'
if com_port is None:
# Alternately, if only 1 power supply is connected, attempt to autoconnect
power_supply.autoConnect()
else:
# Connect to the power supply
power_supply.connect(com_port)# Set voltage to 5V and current to 0.5A for the left channel
power_supply.setVoltage(5, channel=1)
power_supply.setCurrent(0.5, channel=1)# Enable the output
power_supply.enableOutput(channel=1)# Disable the output
power_supply.disableOutput(channel=1)# Disconnect from the power supply
power_supply.disconnect() # Note: This does not disable the outputs!!
```