File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -528,14 +528,20 @@ def list_resources(ip=None, timeout=1):
528528
529529 for host in list_devices (ip , timeout ):
530530 try :
531- # try connecting as a GPIB interface
532- intf_dev = InterfaceDevice (host )
533- # enumerate connected devices
534- devs = intf_dev .find_listeners ()
535- res .extend (['TCPIP::%s::gpib0,%d::INSTR' % (host , d ) for d in devs ])
536- except :
537- # if that fails, just list the host
531+ # try connecting as an instrument
532+ instr = Instrument (host )
533+ instr .open ()
538534 res .append ("TCPIP::%s::INSTR" % host )
535+ except :
536+ try :
537+ # try connecting as a GPIB interface
538+ intf_dev = InterfaceDevice (host )
539+ # enumerate connected devices
540+ devs = intf_dev .find_listeners ()
541+ res .extend (['TCPIP::%s::gpib0,%d::INSTR' % (host , d ) for d in devs ])
542+ except :
543+ # if that fails, just list the host
544+ res .append ("TCPIP::%s::INSTR" % host )
539545
540546 return res
541547
You can’t perform that action at this time.
0 commit comments