MCPcopy Create free account
hub / github.com/LabPy/lantz / read_buffer

Method read_buffer

lantz/drivers/legacy/stanford/sr830.py:481–502  ·  view source on GitHub ↗

Queries points stored in the Channel buffer :param channel: Number of the channel (1, 2). :param start: Index of the buffer to start. :param length: Number of points to read. Defaults to the number of points in the buffer. :param format: Transf

(self, channel, start=0, length=None, format='A')

Source from the content-addressed store, hash-verified

479
480 @Action()
481 def read_buffer(self, channel, start=0, length=None, format='A'):
482 """Queries points stored in the Channel buffer
483
484 :param channel: Number of the channel (1, 2).
485 :param start: Index of the buffer to start.
486 :param length: Number of points to read.
487 Defaults to the number of points in the buffer.
488 :param format: Transfer format
489 'a': ASCII (slow)
490 'b': IEEE Binary (fast) - NOT IMPLEMENTED
491 'c': Non-IEEE Binary (fastest) - NOT IMPLEMENTED
492 """
493
494 cmd = 'TRCA'
495 if not length:
496 length = self.buffer_length
497 self.send('{}? {},{},{}'.format(cmd, channel, start, length))
498 if cmd == 'TRCA':
499 data = self.recv()
500 return np.fromstring(data, sep=',') * ureg.volt
501 else:
502 raise ValueError('{} transfer format is not implemented'.format(format))
503
504 # Fast
505 # STRD

Callers

nothing calls this directly

Calls 2

sendMethod · 0.45
recvMethod · 0.45

Tested by

no test coverage detected