예제 #1
0
파일: gpib.py 프로젝트: dpirly/pyvisa-py
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))
예제 #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))
예제 #3
0
파일: gpib.py 프로젝트: lcarde/pymanip
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
예제 #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
예제 #5
0
 def listener(self, pad, sad=0):
     self.res = gpib.listener(self.id, pad, sad)
     return self.res
예제 #6
0
파일: gpib.py 프로젝트: herm/pyvisa-py
def _find_listeners():
    """Find GPIB listeners.
    """
    for i in range(31):
        if gpib.listener(BOARD, i) and gpib.ask(BOARD, 1) != i:
            yield i
예제 #7
0
파일: gpib.py 프로젝트: vikasuy/pyvisa-py
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
예제 #9
0
파일: gpib.py 프로젝트: vikasuy/pyvisa-py
def _find_listeners():
    """Find GPIB listeners.
    """
    for i in range(1, 31):
        if gpib.listener(0, i):
            yield i