Skip to content

driver: power: siglent: make the measured power reading optional#2

Open
Thomas-Vreys wants to merge 1 commit into
Rubusch:lothar/siglentfrom
Thomas-Vreys:siglent-extension
Open

driver: power: siglent: make the measured power reading optional#2
Thomas-Vreys wants to merge 1 commit into
Rubusch:lothar/siglentfrom
Thomas-Vreys:siglent-extension

Conversation

@Thomas-Vreys

Copy link
Copy Markdown

As a reply on your previous message:

Watts: verified on my SPD1305X, MEAS:POWE? CH1 is answered normally.
For the unsupported case I have no model that lacks it, so I forced the
same path with queries the firmware does not implement (MEAS:NOPE?, and
MEAS:POWE? CH9 on a non-existent channel): the PSU queues
-113,Undefined header and never answers, so pyvisa raises VisaIOError
on timeout. On your PSU, MEAS:POWE? CH1 should hit exactly that — a
direct check on hardware that really lacks the command.

Power protocol: no change needed. ProgrammablePowerProtocol already
declares show/voltage/amps from your commit, and watts is just an
extra key in the dict show() returns.

Tests: "Voltage and Current but no Power" was indeed not covered —
test_siglent_show mocks MEAS:POWE?, so that path never ran. Added a
test for it, parametrized over both failure modes (unanswered query,
non-numeric reply), asserting watts is None and the other readings
survive.

There is another thing that needs to be done:
siglent is the only power backend implementing
power_show/power_voltage/power_amps, yet NetworkPowerDriver.show()
calls self.backend.power_show() unconditionally, so power show against
e.g. gude raises a raw AttributeError (same for power config). This is the method you added.

@Thomas-Vreys Thomas-Vreys mentioned this pull request Jul 22, 2026
7 tasks
Not every SPD model implements MEAS:POWE?. Such a model leaves the query unanswered, so the read times out and pyvisa raises VisaIOError.

Tested on Siglent SPD1305X model by querying watts from non-existend channel "MEAS:POWE? CH9"

Add tests in labgrid for both failure modes: an unanswered query and a non-numeric
reply.

This work was sponsored by OIP Sensor Systems.

Signed-off-by: Thomas Vreys <thomas.vreys999@gmail.com>
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.

1 participant