Last active
July 4, 2019 17:27
-
-
Save greyltc/a4941acb4eaefa688c1c4caa80690f5b to your computer and use it in GitHub Desktop.
gpib comms test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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