Skip to content

Commit df61e67

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

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

ps5000aExamples/ps5000aBlockAdvancedTriggerExample.py

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

176176
# Create time data
177-
time = np.linspace(0, (cmaxSamples.value) * timeIntervalns.value, cmaxSamples.value)
177+
time = np.linspace(0, (cmaxSamples.value - 1) * timeIntervalns.value, cmaxSamples.value)
178178

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

ps5000aExamples/ps5000aBlockCallbackExample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def block_callback(handle, statusCallback, param):
174174
adc2mVChBMax = adc2mV(bufferBMax, chBRange, maxADC)
175175

176176
# Create time data
177-
time = np.linspace(0, (cmaxSamples.value) * timeIntervalns.value, cmaxSamples.value)
177+
time = np.linspace(0, (cmaxSamples.value - 1) * timeIntervalns.value, cmaxSamples.value)
178178

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

ps5000aExamples/ps5000aBlockExample.py

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

161161
# Create time data
162-
time = np.linspace(0, (cmaxSamples.value) * timeIntervalns.value, cmaxSamples.value)
162+
time = np.linspace(0, (cmaxSamples.value - 1) * timeIntervalns.value, cmaxSamples.value)
163163

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

ps5000aExamples/ps5000aBlockMSOExample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
bufferDPort0 = splitMSODataFast(cTotalSamples, bufferDPort0Max)
151151

152152
# Creates the time data
153-
time = np.linspace(0, cTotalSamples.value * timeIntervalNs.value, cTotalSamples.value)
153+
time = np.linspace(0, (cTotalSamples.value - 1) * timeIntervalNs.value, cTotalSamples.value)
154154

155155
print ("Plotting data...")
156156

ps5000aExamples/ps5000aRapidBlockExample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
adc2mVChAMax9 = adc2mV(bufferAMax9, chARange, maxADC)
320320

321321
# Creates the time data
322-
time = np.linspace(0, (cmaxSamples.value) * timeIntervalns.value, cmaxSamples.value)
322+
time = np.linspace(0, (cmaxSamples.value - 1) * timeIntervalns.value, cmaxSamples.value)
323323

324324
# Plots the data from channel A onto a graph
325325
plt.plot(time, adc2mVChAMax[:])

ps5000aExamples/ps5000aStreamingExample.py

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

191191
# Create time data
192-
time = np.linspace(0, (totalSamples) * actualSampleIntervalNs, totalSamples)
192+
time = np.linspace(0, (totalSamples - 1) * actualSampleIntervalNs, totalSamples)
193193

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

0 commit comments

Comments
 (0)