Fix CC/CR/CV set and query commands to use correct syntax

The manual's pipe symbol (|) means OR - e.g. CC|CURR:HIGH means use
either "CC" or "CURR:HIGH" as the command. The combined form "CC CURR:HIGH"
was not being parsed correctly by the device for queries. Now using the
second form (CURR:HIGH, RES:HIGH, VOLT:HIGH) which works for both set
and query operations. Verified readback works: set 1A -> reads 0.9999A.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 11:07:07 +07:00
parent dc4ea820cf
commit 6635fa3e12

View File

@@ -170,12 +170,12 @@ class Prodigit3366G:
level: 'HIGH' or 'LOW' level.
"""
level = level.upper()
self.write(f"CC CURR:{level} {amps:.5f}")
self.write(f"CURR:{level} {amps:.5f}")
def get_cc_current(self, level: str = "HIGH") -> float:
"""Query CC mode current setting."""
level = level.upper()
resp = self.query(f"CC CURR:{level}?")
resp = self.query(f"CURR:{level}?")
return float(resp)
# -- Constant Resistance (CR) --
@@ -188,12 +188,12 @@ class Prodigit3366G:
level: 'HIGH' or 'LOW' level.
"""
level = level.upper()
self.write(f"CR RES:{level} {ohms:.3f}")
self.write(f"RES:{level} {ohms:.3f}")
def get_cr_resistance(self, level: str = "HIGH") -> float:
"""Query CR mode resistance setting."""
level = level.upper()
resp = self.query(f"CR RES:{level}?")
resp = self.query(f"RES:{level}?")
return float(resp)
# -- Constant Voltage (CV) --
@@ -206,12 +206,12 @@ class Prodigit3366G:
level: 'HIGH' or 'LOW' level.
"""
level = level.upper()
self.write(f"CV VOLT:{level} {volts:.5f}")
self.write(f"VOLT:{level} {volts:.5f}")
def get_cv_voltage(self, level: str = "HIGH") -> float:
"""Query CV mode voltage setting."""
level = level.upper()
resp = self.query(f"CV VOLT:{level}?")
resp = self.query(f"VOLT:{level}?")
return float(resp)
# -- Constant Power (CP) --