diff options
Diffstat (limited to 'qolab')
-rw-r--r-- | qolab/hardware/multimeter/bk_5491.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/qolab/hardware/multimeter/bk_5491.py b/qolab/hardware/multimeter/bk_5491.py index 015c36c..cbab6e0 100644 --- a/qolab/hardware/multimeter/bk_5491.py +++ b/qolab/hardware/multimeter/bk_5491.py @@ -5,12 +5,15 @@ import time class BK_5491(Multimeter): - """BK 5491 multimeter""" + """BK 5491 multimeter - """ - rm = pyvisa.ResourceManager() - instr=rm.open_resource('ASRL/dev/ttyUSB0::INSTR') - Make sure to switch off the ECHO at the multimeter communication setup + Make sure to switch off the ECHO at the multimeter communication setup. + + Example + ------- + >>> rm = pyvisa.ResourceManager() + >>> instr=rm.open_resource('ASRL/dev/ttyUSB0::INSTR') + >>> multimeter = BK_5491(instr) """ def __init__(self, resource, *args, **kwds): @@ -49,14 +52,16 @@ class BK_5491(Multimeter): return False def write(self, cmd_string): + """Write/send command to instrument""" return self._readwrite(cmd_string, expect_reply=False, Nattemts=1) def query(self, cmd_string): + """Query instrument with command""" return self._readwrite(cmd_string, expect_reply=True, Nattemts=5) def _readwrite(self, cmd_string, expect_reply=True, Nattemts=5): """ - Set command to instrument or query it readings (which is also a command) + Send command to instrument or query it readings (which is also a command) BK_5491 is not a SCPI instrument, so we get some replies (prompts *>, =>, etc) even if we just send a command not a query. So we have to work around this. |