def _find_listeners(): """Find GPIB listeners. """ for i in range(31): try: if gpib.listener(BOARD, i) and gpib.ask(BOARD, 1) != i: yield i except gpib.GpibError as e: logger.debug("GPIB error in _find_listeners(): %s", repr(e))
def scanGpib(board): if not has_gpib: warnings.warn( "Linux-GPIB is not available. ScanGpib with VISA not implemented at the moment.", RuntimeWarning, stacklevel=2, ) else: for pad in range(1, 31): listen = gpib.listener(board, pad) # print(board, pad, listen) if listen: print("GPIB" + str(board) + "::" + str(pad)) try: ud = gpib.dev(board, pad, 0, 10, 1, 0) if ud > 0: gpib.write(ud, "*CLS;*IDN?") description = gpib.read(ud, 256) print(description.strip().decode("ascii")) except Exception: pass
def _find_listeners(): """Find GPIB listeners. """ for i in range(31): if gpib.listener(BOARD, i) and gpib.ask(BOARD, 1) != i: yield i
def listener(self, pad, sad=0): self.res = gpib.listener(self.id, pad, sad) return self.res
def _find_listeners(): """Find GPIB listeners. """ for i in range(1, 31): if gpib.listener(0, i): yield i