migrate siglent power backend vxi11 -> pyvisa, add power show/config options#1926
migrate siglent power backend vxi11 -> pyvisa, add power show/config options#1926Rubusch wants to merge 2 commits into
Conversation
The siglent power backend uses the vxi11 module. It hasn't seen any activity in the last 7 years. It still uses the deprecated xdrlib module from the Python standard library. xdrlib will be removed in Python 3.13 Replace the vxi11 usage by pyvisa. Pyvisa already seems to be used in the labgrid project. Thus this reduces a further external dependency. Fixes: labgrid-project#1507 Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com> Assisted-by: Gemini-2.5-Flash <ai-assistance@google.com>
Generally add setting and checking basic power settings such as voltage
and current. This comes as an option, i.e. it can be implemented for more
elaborate power supplies. This is verified with some Siglent devices.
Usage example:
$ labgrid-client power config --voltage 5.0 --amps 1.5
Selected role main from configuration file
set voltage to 5.0V
set amps to 1.5A
$ labgrid-client power show
Selected role main from configuration file
Voltage: 0.0V [5.0V], Current: 0.0A [1.5A]
$ labgrid-client power on
Selected role main from configuration file
$ labgrid-client power show
Selected role main from configuration file
Voltage: 5.001V [5.0V], Current: 0.209A [1.5A]
Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Assisted-by: Gemini-2.5-Flash <ai-assistance@google.com>
| raise NotImplementedError | ||
|
|
||
| @abc.abstractmethod | ||
| def amps(self, index, amps): |
There was a problem hiding this comment.
Is 'current' not more suiteable i.s.o. amps?
| def show(self): | ||
| return self.backend.power_show(self._host, self._port, self.port.index) | ||
|
|
||
| @Driver.check_active |
There was a problem hiding this comment.
Could power (W) also be added? Some PowerSupplies (also Siglent) do allow this.
Reading Voltage and Current and multiply it in software will introduce and error because the time difference between the two reads.
There was a problem hiding this comment.
@vermaete : I'll try to have a look into it this weekend and push something, after that I'm travelling for around four weeks. So, in general "amps" -> "current" and "power" in [W]. Let me know if something else is missing. I have to have a look into our siglent material here, let's see. ty
@Bastian-Krause : There seems to be some interest in this. Pls, what should I additionally need to provide as test and documentation here? Can you point me to something similar/driver you'd like to see? If not, I might figure out and come up with anything.
There was a problem hiding this comment.
@Rubusch Thomas-Vreys did some work on your fork and has created a PR with some of the remarks solved.
Thomas will be available at Wednesday to continue with it, if needed.
We do have some power-supplies to test this.
Thanks for the useful Labgrid feature.
Hi!
First this will migrate the driver/power/siglent.py from vxi11 to pyvisa. We use different Siglents in our lab, and could verify it locally. Second is a proposal, add basic configuration options to the power command as an optional add-on for power supplies which offer that. The idea is, at least to set and verify remotely voltage and current.
Usage example:
$ labgrid-client power config --voltage 5.0 --amps 1.5
Selected role main from configuration file
set voltage to 5.0V
set amps to 1.5A
$ labgrid-client power show
Selected role main from configuration file
Voltage: 0.0V [5.0V], Current: 0.0A [1.5A]
$ labgrid-client power on
Selected role main from configuration file
$ labgrid-client power show
Selected role main from configuration file
Voltage: 5.001V [5.0V], Current: 0.209A [1.5A]
Note, I did neither add any testes, nor documentation. Just let me know if you're interested to elaborate this further, or in case split the commits, or whatever to do with it.
Checklist