Simple library to control older ISEG HV supplies over CAN interface.
Project description
IsegCAN
Description
Simple library for controlling ISEG HV modules in a single crate over CAN bus.
The library is just a wrapper around the Iseg DHCP command set. Most single channel and Module commands in the Iseg CAN control protocol have been implemented (see definitions.py). Some often used operations have been exposed as methods, but the raw CAN commands can be accessed
Installation
IsegCAN uses python-can, and specifically the SocketCAN interface. Documentation can be found from https://python-can.readthedocs.io/en/stable/interfaces/socketcan.html
For a quick start, the next few lines should work for PEAK usb adapter:
# Create a can network interface with a specific name
sudo ip link set can0 up type can bitrate 125000
Note that the bitrate depends on the setup of your Iseg modules. All connections fail and interface is brought down if the bitrate is wrong.
Usage
The library has only one class, the resource. The resource object is used to control a single module.
Most EDCP commands are automatically generated from a dictionary in _edcp_definitions.py, but only small subset of them have been tested. They can be run using the automatically generated set_command and query_command methods, which have the same signature (value, channel). Type of value depends on the command. It is only used for set commands. Address is unsigned one-byte integer for the channel number in the module or for an offset for some module commands.
The query commands return a value and update the state of the resource directly in the resource object once they are read from the buffer. This is done automatically but is not synchronized, so there is a possibility of retrieving stale data.
For ease of use, some methods have been defined for the most common uses. These are:
| command | r/w | type | description |
|---|---|---|---|
| module_status_query(_value, channel) | r | uint16 | Returns the 16-bit module status |
| channel_status_query(_value, channel) | r | uint16 | Returns the 16-bit channel status |
| state(value, channel) | w | bool | Set channel on or off |
| state_query(_value, channel) | r | bool | Read channel state |
| voltage_out_query(_value, channel) | r | float | Measurement of the voltage |
| voltage_set(value, channel) | w | float | Set voltage |
| voltage_set_query(_value, channel) | r | float | Read set voltage value |
| current_out_query(_value, channel) | r | float | Measurement of the current. |
| current_set(value, channel) | w | float | Set current limit |
| current_set_query(_value, channel) | r | float | Read current limit |
| ramp_speed(value, _channel) | w | float | Set ramp speed (in V/s. Max 20% of max voltage) |
| ramp_speed_query(_value, _channel) | r | float | Read ramp speed |
| reset_trip(_value, _channel) | w | uint16 | Reset all trips, return 16 bit event status |
The rw commands either read the value (value = None) or write (value = new value) and then read the value . All commands return the current value.
Support
Hmmm?
Roadmap
The objective is to be functional with Dirigent via ICICLE. Other features may be decided in the future
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file isegcan-0.7.0.tar.gz.
File metadata
- Download URL: isegcan-0.7.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3321523508cf6b6e0200bb323e3241cd781afa3672a6914b846ba5d9563798a
|
|
| MD5 |
fd9ab7b3ddce3c0ad3971505eb9b2901
|
|
| BLAKE2b-256 |
cf749b64559bbe2e2947c9b3b18511cf6ab38f4442cd82173cd9c803691378b7
|
File details
Details for the file isegcan-0.7.0-py3-none-any.whl.
File metadata
- Download URL: isegcan-0.7.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a7a5f2dc0afc339e8997bf5d6ebf25d9260a5ff212ab3ac841547e83c245344
|
|
| MD5 |
d50b8613f654b1a0ed717fc125e50324
|
|
| BLAKE2b-256 |
51ca45293ebc872844981de5e10747e7259bfbdd6bfcfda1cb02e250476f9796
|