stfc-aeg / odin-pico

Python package to manage data acquisition from a PicoScope (5444D)
0 stars 1 forks source link

Ability to abort a capture cleanly #18

Closed JoshHarris2108 closed 1 year ago

JoshHarris2108 commented 1 year ago

Noticed in testing that picoscope will wait indefinetly for trigger if trigger is active, and no suitable condition is found on source channel (expected behaviour, but not encountered in previous testing as always had constant trigger source from SigGen).

Would be good to have an abort capture button? or be able to set some kind of flag to abandon a capture after certain time

JoshHarris2108 commented 1 year ago

start_time = time.time() while run_block condition:

check for run_block conditon

# Check if the capture has taken over certain time and if "abort_flag" is true
if (time.time() - start_time >= desired_time) and (abort_flag):
    # manually set run_block condition

This implementation would need testing, as it would cause get_values_blk to throw an error, it is unknown if the next capture would run successfully after this error has been thrown

JoshHarris2108 commented 1 year ago

ps5000aStop - Can be used to stop captures cleanly mid-capture

JoshHarris2108 commented 1 year ago

Look at ps500aGetValues instead of getVlauesBulk, to see if data captured before abort can be saved