Skip to content

Commit 276cfb9

Browse files
author
neil.hamilton
committed
add block example for ps3000 driver
1 parent 755820b commit 276cfb9

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

ps3000aExamples/ps3000aRapidBlockExample.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import ctypes
99
from picosdk.ps3000a import ps3000a as ps
1010
import numpy as np
11+
import matplotlib
1112
import matplotlib.pyplot as plt
1213
from picosdk.functions import adc2mV, assert_pico_ok
1314

@@ -292,7 +293,9 @@
292293
Times = (ctypes.c_int16*10)()
293294
TimeUnits = ctypes.c_char()
294295
status["GetValuesTriggerTimeOffsetBulk"] = ps.ps3000aGetValuesTriggerTimeOffsetBulk64(chandle, ctypes.byref(Times), ctypes.byref(TimeUnits), 0, 9)
295-
assert_pico_ok(status["GetValuesTriggerTimeOffsetBulk"])
296+
297+
print(Times[0:9])
298+
print(TimeUnits)
296299

297300
# Finds the max ADC count
298301
# Handle = chandle
@@ -312,21 +315,25 @@
312315
adc2mVChAMax7 = adc2mV(bufferAMax7, chARange, maxADC)
313316
adc2mVChAMax8 = adc2mV(bufferAMax8, chARange, maxADC)
314317
adc2mVChAMax9 = adc2mV(bufferAMax9, chARange, maxADC)
318+
assert_pico_ok(status["GetValuesTriggerTimeOffsetBulk"])
315319

316320
# Creates the time data
317321
time = np.linspace(0, (cmaxSamples.value - 1) * timeIntervalns.value, cmaxSamples.value)
318322

319323
# Plots the data from channel A onto a graph
320-
plt.plot(time, adc2mVChAMax[:])
321-
plt.plot(time, adc2mVChAMax1[:])
322-
plt.plot(time, adc2mVChAMax2[:])
323-
plt.plot(time, adc2mVChAMax3[:])
324-
plt.plot(time, adc2mVChAMax4[:])
325-
plt.plot(time, adc2mVChAMax5[:])
326-
plt.plot(time, adc2mVChAMax6[:])
327-
plt.plot(time, adc2mVChAMax7[:])
328-
plt.plot(time, adc2mVChAMax8[:])
329-
plt.plot(time, adc2mVChAMax9[:])
324+
325+
plt.plot(time, adc2mVChAMax)
326+
print('test')
327+
plt.plot(time, adc2mVChAMax1)
328+
plt.plot(time, adc2mVChAMax2)
329+
plt.plot(time, adc2mVChAMax3)
330+
plt.plot(time, adc2mVChAMax4)
331+
plt.plot(time, adc2mVChAMax5)
332+
plt.plot(time, adc2mVChAMax6)
333+
plt.plot(time, adc2mVChAMax7)
334+
plt.plot(time, adc2mVChAMax8)
335+
plt.plot(time, adc2mVChAMax9)
336+
330337
plt.xlabel('Time (ns)')
331338
plt.ylabel('Voltage (mV)')
332339
plt.show()

0 commit comments

Comments
 (0)