def get_error_info32bit(self, verbose=False): """Read an error from the error register. Args: verbose (bool): If True then print the error message to stdout Returns: errorreg (int) errorvalue (int) """ dwErrorReg = pyspcm.uint32(0) lErrorValue = pyspcm.int32(0) if verbose: buffer = (ct.c_uint8 * pyspcm.ERRORTEXTLEN)() pyspcm.spcm_dwGetErrorInfo_i32(self.hCard, pyspcm.byref(dwErrorReg), pyspcm.byref(lErrorValue), buffer) bb = (bytearray(buffer)).decode().strip('\x00') print('get_error_info32bit: %d %d: %s' % (dwErrorReg.value, lErrorValue.value, bb)) else: pyspcm.spcm_dwGetErrorInfo_i32(self.hCard, pyspcm.byref(dwErrorReg), pyspcm.byref(lErrorValue), None) return (dwErrorReg.value, lErrorValue.value)
def get_error_info32bit(session): """ Read an error from the error register """ dwErrorReg = pyspcm.uint32(0) lErrorValue = pyspcm.int32(0) pyspcm.spcm_dwGetErrorInfo_i32(session, pyspcm.byref(dwErrorReg), pyspcm.byref(lErrorValue), None) return (dwErrorReg.value, lErrorValue.value)