Skip to content

migrate siglent power backend vxi11 -> pyvisa, add power show/config options#1926

Open
Rubusch wants to merge 6 commits into
labgrid-project:masterfrom
Rubusch:lothar/siglent
Open

migrate siglent power backend vxi11 -> pyvisa, add power show/config options#1926
Rubusch wants to merge 6 commits into
labgrid-project:masterfrom
Rubusch:lothar/siglent

Conversation

@Rubusch

@Rubusch Rubusch commented Jul 4, 2026

Copy link
Copy Markdown

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

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

Rubusch added 2 commits July 4, 2026 19:11
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>
@Bastian-Krause Bastian-Krause changed the title driver/siglent migrate siglent power backend vxi11 -> pyvisa, add power show/config options Jul 7, 2026
raise NotImplementedError

@abc.abstractmethod
def amps(self, index, amps):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vermaete I merged this. I had a look at my hardware, unfortunately I cannot verify power readings. So, I appreaciate the effort. Thanks.

I still agree in "current" being more suitable than "amps". Now, I did not like to change before merging and currently busy/travelling. Shall I still add a commit to rename it, or can we live with that as is? I think to user interface it exposes "current".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for merging. Naming as it is now is fine for me.

Read the device-measured power (watts) from the Sigilent backend via MEAS:POWE?, exposed both as new power_watts() helper and as an extra field of power_show().
The 'labgrid-client power show' output now also prints the power value.

This work was sponsored by OIP Sensor Systems

Signed-off-by: oip <thomas.vreys999@gmail.com>
Add tests for the Siglent power backend (on/off/get, show including the measured power, and voltage/current configuration) and document the power show/config actions in the configuration, usage and development guides. Regenerate the labgrid-client man page for the new power sub-actions and options.

This work was sponsored by OIP Sensor Systems

Signed-off-by: oip <thomas.vreys999@gmail.com>
@Thomas-Vreys Thomas-Vreys mentioned this pull request Jul 13, 2026
7 tasks
@Thomas-Vreys

Copy link
Copy Markdown

Came across #1835, they've built a generic pyvisa/SCPI layer with PSU backends for the DP832, RND 320-KD3305P and ITECH IT-M3632. Same underlying idea as what we're doing for the Siglent, just at a more general level. The transport is a config option so you could also connect over USB. But no Siglent backend there yet but maybe worth knowing whether programmable PSUs are meant to head that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants