def read_raw(self, num=-1):

        read_len = self.RECV_CHUNK
        if 0 < num < self.RECV_CHUNK:
            read_len = num
        
        flags = 0
        reason = 0
        
        term_char = 0
        
        if self.term_char is not None:
            flags = OP_FLAG_TERMCHAR_SET
            term_char = str(self.term_char).encode('utf-8')[0]
        
        read_data = b''
        
        while reason & (RX_END | RX_CHR) == 0:
            error, reason, data = self.client.device_read(self.link, read_len, self.io_timeout, self.lock_timeout, flags, term_char)
            
            if error:
                raise Vxi11Error("error reading data: %d" % error)
            
            read_data += data
            
            if num > 0:
                num = num - len(data)
                if num <= 0:
                    break
                if num < read_len:
                    read_len = num
            
        return read_data
Read binary data from instrument
dataset/ETHPy150Open LabPy/lantz/lantz/drivers/legacy/vxi11.py/Vxi11Driver.read_raw