aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware/power_supply/psw25045.py
diff options
context:
space:
mode:
authorMichael Vorobiov <mvorobiov@wm.edu>2024-11-07 11:09:05 -0500
committerMichael Vorobiov <mvorobiov@wm.edu>2024-11-07 11:09:05 -0500
commit8deb83e348c1c6af47cbd9d74dc09bddb474f147 (patch)
tree88147397ef9874eb29d1e76a79232340406ddbc6 /qolab/hardware/power_supply/psw25045.py
parent5f0a9493ea33bfbb482b60b2ab5a3dbe3d2c4676 (diff)
downloadqolab-8deb83e348c1c6af47cbd9d74dc09bddb474f147.tar.gz
qolab-8deb83e348c1c6af47cbd9d74dc09bddb474f147.zip
methods returning output voltage, current and power return NaN if unsuccessful
Diffstat (limited to 'qolab/hardware/power_supply/psw25045.py')
-rw-r--r--qolab/hardware/power_supply/psw25045.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/qolab/hardware/power_supply/psw25045.py b/qolab/hardware/power_supply/psw25045.py
index d0fc1c2..bb2357f 100644
--- a/qolab/hardware/power_supply/psw25045.py
+++ b/qolab/hardware/power_supply/psw25045.py
@@ -6,11 +6,14 @@ Description: This module provides a class to interface with the GW INSTEK GPP250
Author: Mykhailo Vorobiov
Email: mvorobiov@wm.edu
Date: 2024-10-02
-Update: 2024-11-05
+Update: 2024-11-06
"""
from qolab.hardware.power_supply._basic import PowerSupplySCPI
+from qolab.hardware.basic import BasicInstrument
+
import pyvisa
+import numpy as np
class PSW25045(PowerSupplySCPI):
"""
@@ -44,9 +47,8 @@ class PSW25045(PowerSupplySCPI):
except pyvisa.VisaIOError as e:
print(f'[ERROR!] Error retrieving identification: {e}')
return None
-
-
- def get_current_meas(self):
+ @BasicInstrument.tsdb_append
+ def get_out_current(self):
"""
Query the current reading of the instrument.
@@ -57,9 +59,10 @@ class PSW25045(PowerSupplySCPI):
return float(self.query('MEAS:CURR?'))
except pyvisa.VisaIOError as e:
print(f"[ERROR!] Error querying the current reading: {e}")
- return None
-
- def get_voltage_meas(self):
+ return np.nan()
+
+ @BasicInstrument.tsdb_append
+ def get_out_voltage(self):
"""
Query the voltage reading of the instrument.
@@ -70,9 +73,9 @@ class PSW25045(PowerSupplySCPI):
return float(self.query('MEAS:VOLT?'))
except pyvisa.VisaIOError as e:
print(f"[ERROR!] Error querying the voltage reading: {e}")
- return None
+ return np.nan()
- def get_power_meas(self):
+ def get_out_power(self):
"""
Query the power reading of the instrument.
@@ -83,7 +86,7 @@ class PSW25045(PowerSupplySCPI):
return float(self.query('MEAS:POWE?'))
except pyvisa.VisaIOError as e:
print(f"[ERROR!] Error querying the power reading: {e}")
- return None
+ return np.nan()