aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware/multimeter/hp_34401.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2023-06-21 17:17:55 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2023-06-21 17:18:31 -0400
commitc6742475074836dc97529ed734d1345e58c3ee00 (patch)
tree223e397a2a9fbea2d65b23148a4971d7fd93cf1a /qolab/hardware/multimeter/hp_34401.py
parentc712aea9c3d282ae0684619afbd1b73849d12909 (diff)
downloadqolab-c6742475074836dc97529ed734d1345e58c3ee00.tar.gz
qolab-c6742475074836dc97529ed734d1345e58c3ee00.zip
human readable measurements names for HP_34401
Diffstat (limited to 'qolab/hardware/multimeter/hp_34401.py')
-rw-r--r--qolab/hardware/multimeter/hp_34401.py32
1 files changed, 28 insertions, 4 deletions
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