From c6742475074836dc97529ed734d1345e58c3ee00 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Wed, 21 Jun 2023 17:17:55 -0400 Subject: human readable measurements names for HP_34401 --- qolab/hardware/multimeter/hp_34401.py | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'qolab/hardware/multimeter/hp_34401.py') diff --git a/qolab/hardware/multimeter/hp_34401.py b/qolab/hardware/multimeter/hp_34401.py index 7e1b1a5..2d9abdd 100644 --- a/qolab/hardware/multimeter/hp_34401.py +++ b/qolab/hardware/multimeter/hp_34401.py @@ -22,7 +22,7 @@ class HP_34401(MultimeterSCPI): self.switchTime = 0.5 # switch time in seconds for Function/Measurement change self.deviceProperties.update({'Function'}) - Function = SCPI_PROPERTY(scpi_prfx='SENSe:FUNCtion', ptype=str, doc=""" + rawFunction = SCPI_PROPERTY(scpi_prfx='SENSe:FUNCtion', ptype=str, doc=""" Current measurement function (Voltmeter DC/AC, Currentmeter DC/AC, etc. Important! When assigning, string should be quoted, i.e. use: Function=\'"VOLT:DC"\' @@ -42,6 +42,31 @@ class HP_34401(MultimeterSCPI): """ ) + def getFunction(self): + rfunc = self.rawFunction + if rfunc == '"VOLT"': + return "Vdc" + elif rfunc == '"VOLT:AC"': + return "Vac" + elif rfunc == '"CURR"': + return "Adc" + elif rfunc == '"CURR:AC"': + return "Aac" + elif rfunc == '"RES"': + return "Resistance" + elif rfunc == '"FRES"': + return "Resistance4Wires" + elif rfunc == '"DIOD"': + return "Diode" + elif rfunc == '"FREQ"': + return "Frequency" + elif rfunc == '"PER"': + return "Period" + elif rfunc == '"CONT"': + return "Continuity" + else: + return "Unknown" + def toRemote(self): self.write("SYSTem:REMote") @@ -49,7 +74,7 @@ class HP_34401(MultimeterSCPI): self.write("SYSTem:LOCal") def isSensing(self, test): - return test == self.Function + return test == self.rawFunction Reading = SCPI_PROPERTY(scpi_prfx='SYSTem:REMote; :READ', ptype=float, doc='Report current measurement', no_setter=True) @@ -64,8 +89,7 @@ class HP_34401(MultimeterSCPI): Note: the function name should be in quotes, i.e. '"Volt"' """ if not self.isSensing(function_internal_name): - # print(f"function {self.Function} switching function to {desired_function_string}") - self.Function=desired_function_string + self.rawFunction=desired_function_string time.sleep(self.switchTime) # self.toRemote() # this is done inside of Reading ret = self.Reading -- cgit v1.2.3