def isBusy(self): ''' returns True if the scope is busy and False otherwise ''' check = ctypes.c_int16(0) self.status["isReady"] = ps.ps2000_ready(self.chandle) ready = ctypes.c_int16(self.status["isReady"]) return ready.value == check.value
# Run block capture # handle = chandle # no_of_samples = maxSamples # timebase = timebase # oversample = oversample # pointer to time_indisposed_ms = ctypes.byref(timeIndisposedms) timeIndisposedms = ctypes.c_int32() status["runBlock"] = ps.ps2000_run_block(chandle, maxSamples, timebase, oversample, ctypes.byref(timeIndisposedms)) assert_pico2000_ok(status["runBlock"]) # Check for data collection to finish using ps5000aIsReady ready = ctypes.c_int16(0) check = ctypes.c_int16(0) while ready.value == check.value: status["isReady"] = ps.ps2000_ready(chandle) ready = ctypes.c_int16(status["isReady"]) # Create buffers ready for data bufferA = (ctypes.c_int16 * maxSamples)() bufferB = (ctypes.c_int16 * maxSamples)() # Get data from scope # handle = chandle # pointer to buffer_a = ctypes.byref(bufferA) # pointer to buffer_b = ctypes.byref(bufferB) # poiner to overflow = ctypes.byref(oversample) # no_of_values = cmaxSamples cmaxSamples = ctypes.c_int32(maxSamples) status["getValues"] = ps.ps2000_get_values(chandle, ctypes.byref(bufferA), ctypes.byref(bufferB), None, None, ctypes.byref(oversample), cmaxSamples) assert_pico2000_ok(status["getValues"])