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

Method read

lantz/drivers/labjack/_internal/u12.py:534–545  ·  view source on GitHub ↗
(self, numBytes = 8)

Source from the content-addressed store, hash-verified

532 return writeBuffer
533
534 def read(self, numBytes = 8):
535 if ON_WINDOWS:
536 pass
537 else:
538 if self.handle is None:
539 raise U12Exception("The U12's handle is None. Please open a U12 with open()")
540 newA = (ctypes.c_byte*numBytes)()
541 readBytes = staticLib.LJUSB_Read(self.handle, ctypes.byref(newA), numBytes)
542 # return a list of integers in command/response mode
543 result = [(newA[i] & 0xff) for i in range(readBytes)]
544 if self.debug: print("Received:", hexWithoutQuotes(result))
545 return result
546
547
548 # Low-level helpers

Callers 15

openMethod · 0.95
rawAISampleMethod · 0.95
rawDIOMethod · 0.95
rawCounterMethod · 0.95
rawCounterPWMDIOMethod · 0.95
rawAIBurstMethod · 0.95
rawAIContinuousMethod · 0.95
rawPulseoutMethod · 0.95
rawWatchdogMethod · 0.95
rawReadRAMMethod · 0.95
rawWriteRAMMethod · 0.95
rawAsynchMethod · 0.95

Calls 2

U12ExceptionClass · 0.70
hexWithoutQuotesFunction · 0.70

Tested by

no test coverage detected