diff options
Diffstat (limited to 'qolab/hardware/multimeter/hp_34401.py')
-rw-r--r-- | qolab/hardware/multimeter/hp_34401.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/qolab/hardware/multimeter/hp_34401.py b/qolab/hardware/multimeter/hp_34401.py new file mode 100644 index 0000000..ad11614 --- /dev/null +++ b/qolab/hardware/multimeter/hp_34401.py @@ -0,0 +1,28 @@ +from qolab.hardware.basic import BasicInstrument +from qolab.hardware.multimeter import MultimeterSCPI +from qolab.hardware.scpi import SCPI_PROPERTY + +class HP_34401(MultimeterSCPI): + """ HP 34401 multimeter (same as Agilent) """ + """ + rm = pyvisa.ResourceManager() + instr=rm.open_resource('ASRL/dev/ttyUSB0::INSTR', baud_rate = 9600) + """ + def __init__(self, resource, *args, baud_rate=9600, data_bits=8, parity=None, stop_bits=1, timeout=1, **kwds): + super().__init__(resource, *args, **kwds) + self.config['Device model']='hp 34401' + # self.resource.read_termination='\n' + self.deviceProperties.update({}) + + measurement = SCPI_PROPERTY(scpi_prfx='SYSTem:REMote\n read', ptype=float, doc='Report current measurement', no_setter=True) + +if __name__ == '__main__': + import pyvisa + print("testing") + rm = pyvisa.ResourceManager() + print(rm.list_resources()) + instr=rm.open_resource('ASRL/dev/ttyUSB0::INSTR', baud_rate = 9600) + multimeter = HP_34401(instr) + print('------ Header start -------------') + print(str.join('\n', multimeter.getHeader())) + print('------ Header ends -------------') |