sciencelab.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:pslab-python 作者: fossasia 项目源码 文件源码
def fetch_long_data_from_LA(self,bytes,chan=1):
        """ 
        fetches the data stored by DMA. long address increments

        .. tabularcolumns:: |p{3cm}|p{11cm}|

        ==============  ============================================================================================
        **Arguments** 
        ==============  ============================================================================================
        bytes:          number of readings(long integers) to fetch
        chan:           channel number (1,2)
        ==============  ============================================================================================
        """
        try:
            self.H.__sendByte__(CP.TIMING)
            self.H.__sendByte__(CP.FETCH_LONG_DMA_DATA)
            self.H.__sendInt__(bytes)
            self.H.__sendByte__(chan-1)
            ss = self.H.fd.read(int(bytes*4))
            self.H.__get_ack__()
            tmp = np.zeros(bytes)
            for a in range(int(bytes)):
                tmp[a] = CP.Integer.unpack(ss[a*4:a*4+4])[0]
            tmp = np.trim_zeros(tmp) 
            return tmp
        except Exception as ex:
            self.raiseException(ex, "Communication Error , Function : "+inspect.currentframe().f_code.co_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号