Skip to content

Commit 7b21d85

Browse files
author
neil.hamilton
committed
Add run block and checking for data to ps6000aBlockExample.py
1 parent 7a675c2 commit 7b21d85

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ps6000aExamples/ps6000aBlockExample.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,24 @@
5959
print("timebase = ", timebase.value)
6060
print("sample interval =", timeInterval.value, "s")
6161

62+
# Run block capture
63+
# handle = chandle
64+
noOfPreTriggerSamples = 500
65+
noOfPostTriggerSamples = 1000000
66+
# timebase = timebase
67+
timeIndisposedMs = ctypes.c_double(0)
68+
# segmentIndex = 0
69+
# lpReady = None Using IsReady rather than a callback
70+
# pParameter = None
71+
status["runBlock"] = ps.ps6000aRunBlock(chandle, noOfPreTriggerSamples, noOfPostTriggerSamples, timebase, ctypes.byref(timeIndisposedMs), 0, None, None)
72+
assert_pico_ok(status["runBlock"])
73+
74+
# Check for data collection to finish using ps5000aIsReady
75+
ready = ctypes.c_int16(0)
76+
check = ctypes.c_int16(0)
77+
while ready.value == check.value:
78+
status["isReady"] = ps.ps6000aIsReady(chandle, ctypes.byref(ready))
79+
6280
# Close the scope
6381
status["closeunit"] = ps.ps6000aCloseUnit(chandle)
6482
assert_pico_ok(status["closeunit"])

0 commit comments

Comments
 (0)