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)
评论列表
文章目录