Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cli_tool: new parameter for checking ESR

If --always-check-esr is enabled, the tool will check the error status
register after every command and print a warning if there was an error.

Signed-off-by: Michael Walle <michael@walle.cc>
  • Loading branch information...
commit e81b6153992556ecf21a223176726493f8c73007 1 parent 6d6c218
Michael Walle authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 pyvxi11/vxi11_cli.py
7 pyvxi11/vxi11_cli.py
View
@@ -53,6 +53,9 @@ def main():
help='be more verbose')
parser.add_option('-V', action='store_true', dest='version',
help='show version')
+ parser.add_option('--always-check-esr', action='store_true',
+ dest='check_esr',
+ help='Check the error status register after every command')
(options, args) = parser.parse_args()
@@ -91,6 +94,10 @@ def main():
print v.ask(cmd)
else:
v.write(cmd)
+ if options.check_esr:
+ esr = int(v.ask('*ESR?').strip())
+ if esr != 0:
+ print 'Warning: ESR was %d' % esr
except Vxi11Error, e:
print 'ERROR: %s' % e
except EOFError:
Please sign in to comment.
Something went wrong with that request. Please try again.