Answers for "pyvisa instrument connection"

1

pyvisa instrument connection

import visa
import numpy as np

rm = visa.ResourceManager()
instruments  = np.array(rm.list_resources())

for instrument in instruments:
  my_instrument = rm.open_resource(instrument)
  try:  
    identity = my_instrument.query('*IDN?') 
    print("Resource: '"+instrument+"' is") 
    print(identity+'\n')
  except Exception: 
    print('No connection to: '+instrument)
Posted by: Guest on October-11-2021

Python Answers by Framework

Browse Popular Code Answers by Language