2405A BlockReadyType Python support?

Post any questions you may have about our current range of oscilloscopes
Post Reply
brian.w.hall
Newbie
Posts: 0
Joined: Thu Nov 11, 2021 7:55 pm

2405A BlockReadyType Python support?

Post by brian.w.hall »

We have several 2000a series PicoScopes (2405A). Our code uses the PicoScope Python wrappers and we want to use the blocking call to wait for our trigger, instead of polling. However, the BlockReadyType and the supporting Python methods appear to be missing, although they are present in the 2000a C code API and documentation.

How can we use the blocking / callback interface with the 2405a from Python? Will you be updating the wrapper code on github? There is a 5000a-series Python example in the sample code, but it doesn't work for the 2405a due to the missing BlockReadyType.

Thank you.

Code: Select all

ready = False

def block_callback(handle, statusCallback, param):
    global wasCalledBack, ready
    wasCalledBack = True
    if statusCallback != PICO_STATUS['PICO_CANCELLED']:
       ready = True

# Convert the python function into a C function pointer.
cFuncPtr = ps.BlockReadyType(block_callback)

status["runBlock"] = ps.ps2000aRunBlock(chandle,
                                        preTriggerSamples,
                                        postTriggerSamples,
                                        timebase,
                                        oversample,
                                        None,
                                        0,
                                        cFuncPtr,
                                        None)

while ready == False: # support blocking call
    time.sleep(0.01)


Post Reply