Skip to content

Instantly share code, notes, and snippets.

@greyltc
Last active July 4, 2019 17:27
Show Gist options
  • Save greyltc/a4941acb4eaefa688c1c4caa80690f5b to your computer and use it in GitHub Desktop.
Save greyltc/a4941acb4eaefa688c1c4caa80690f5b to your computer and use it in GitHub Desktop.
gpib comms test
import visa
rm = visa.ResourceManager()
rn = 'GPIB0::24::INSTR'
inst = rm.open_resource(rn)
first_idn = inst.query("*IDN?")
print(f'Instrument identified as {first_idn.strip()}')
q = 0
q_max = 100000
print(f'Running {q_max} comms queries...')
while q < q_max:
this_idn = inst.query("*IDN?")
assert (first_idn ==this_idn)
q += 1
print(f'Successful queries: {q}', end='\r', flush=True)
print('')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment