Skip to content

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

Open
Rubusch wants to merge 2 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 2 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.

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.

3 participants