Esempio n. 1
0
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))
Esempio n. 2
0
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))
Esempio n. 3
0
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
Esempio n. 4
0
def _find_listeners():
    """Find GPIB listeners.
    """
    for i in range(31):
        if gpib.listener(BOARD, i) and gpib.ask(BOARD, 1) != i:
            yield i
Esempio n. 5
0
 def listener(self, pad, sad=0):
     self.res = gpib.listener(self.id, pad, sad)
     return self.res
Esempio n. 6
0
def _find_listeners():
    """Find GPIB listeners.
    """
    for i in range(31):
        if gpib.listener(BOARD, i) and gpib.ask(BOARD, 1) != i:
            yield i
Esempio n. 7
0
def _find_listeners():
    """Find GPIB listeners.
    """
    for i in range(1, 31):
        if gpib.listener(0, i):
            yield i
	def listener(self, pad, sad=0):
		self.res = gpib.listener(self.id, pad, sad)
		return self.res
Esempio n. 9
0
def _find_listeners():
    """Find GPIB listeners.
    """
    for i in range(1, 31):
        if gpib.listener(0, i):
            yield i