Skip to content

Siglent extension#1

Merged
Rubusch merged 2 commits into
Rubusch:lothar/siglentfrom
Thomas-Vreys:siglent-extension
Jul 19, 2026
Merged

Siglent extension#1
Rubusch merged 2 commits into
Rubusch:lothar/siglentfrom
Thomas-Vreys:siglent-extension

Conversation

@Thomas-Vreys

Copy link
Copy Markdown

Description

This builds on top of your lothar/siglent branch (upstream PR labgrid-project#1926) and is intended to be picked up there, so the upstream PR can be completed with the open checklist items.

It adds reading the measured power from the device, as suggested by @vermaete in the upstream review:

  • siglent backend: query MEAS:POWE? CH<n> in power_show() (new watts key) and add a dedicated power_watts() function. The power is read directly from the instrument.
  • labgrid-client power show now prints the power, e.g.:
    Voltage: 5.001V [5.0V], Current: 0.209A [1.5A], Power: 1.045W
    
  • Two small fixes in remote/client.py: show no longer queries the PSU twice (the drv.show() result was fetched and then fetched again), and the unused ProgrammablePowerProtocol import is removed.

It also completes the checklist items from the upstream PR:

  • Tests for the siglent backend in tests/test_powerdriver.py.
  • Documentation: doc/configuration.rst, doc/usage.rst, doc/development.rst.
  • Man page man/labgrid-client.1.

How it was verified

  • Test suite: tests/test_powerdriver.py.
  • On real hardware: verified against a Siglent SPD1305X over TCP with a manual try-out script driving the same backend functions the NetworkPowerDriver.

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

Outlook: USB support

I would also like to support USB-connected PSU's. That doesn't fit the current design: the backend is built on NetworkPowerDriver/NetworkPowerPort, which assumes a network transport (host + TCP socket), and the backend hardcodes the TCPIP0::<host>::5025::SOCKET resource string. Since PyVISA can already talk to the same devices via USB0::... resource strings, the cleaner long-term structure is a dedicated SiglentSPDDriver bound to a PyVISA resource, where the transport (TCPIP or USB) comes from the YAML configuration instead of being baked into the driver. I have a first draft of that locally and would propose it as a separate follow-up PR, happy to discuss the direction here.

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>

@Rubusch Rubusch left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM. Note, I cannot verify reading out Watts, my available Hardware does not offer reading out power directly, so I guess you probably verified it.

  • I just noted, you are modifying client and siglent driver, so, there was no need to adjust also the power protocol? AFAIR I needed to add still something to make this work for U and I. Perhaps just double-check this.
  • About the tests, also here I'm unsure if this is needed, but reading out Current, Voltage and Power is highly optional. Shouldn't there be a test that, not having these settings around, or just having Voltage and Current around, but not power (...), does not break? Perhaps this is already covered by other tests.

BTW. I highly appreciate your effort, thank you so much! This to me answered now many questions on how to document and how integrate the test setup. I'm sorry that you needed to fixed actually the not-so-fun parts (documentation and tests) for me.

@Rubusch
Rubusch merged commit 36ab887 into Rubusch:lothar/siglent Jul 19, 2026
@Thomas-Vreys

Copy link
Copy Markdown
Author

I did make another PR: #2 where I answered your comment.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants