Skip to content

Commit 9b3b458

Browse files
author
neil.hamilton
committed
Update ps4000 examples time axis generation
1 parent b048395 commit 9b3b458

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ps4000Examples/ps4000BlockExample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
adc2mVChBMax = adc2mV(bufferBMax, chBRange, maxADC)
139139

140140
# Create time data
141-
time = np.linspace(0, (cmaxSamples.value) * timeIntervalns.value, cmaxSamples.value)
141+
time = np.linspace(0, (cmaxSamples.value - 1) * timeIntervalns.value, cmaxSamples.value)
142142

143143
# plot data from channel A and B
144144
plt.plot(time, adc2mVChAMax[:])

ps4000Examples/ps4000StreamingExample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def streaming_callback(handle, noOfSamples, startIndex, overflow, triggerAt, tri
162162
adc2mVChBMax = adc2mV(bufferCompleteB, channel_range, maxADC)
163163

164164
# Create time data
165-
time = np.linspace(0, (totalSamples) * actualSampleIntervalNs, totalSamples)
165+
time = np.linspace(0, (totalSamples - 1) * actualSampleIntervalNs, totalSamples)
166166

167167
# Plot data from channel A and B
168168
plt.plot(time, adc2mVChAMax[:])

0 commit comments

Comments
 (0)