Skip to content

Commit f6dff6e

Browse files
author
neil.hamilton
committed
Update ps3000a examples time axis generation
1 parent bda780e commit f6dff6e

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

ps3000aExamples/ps3000aBlockAdvancedTriggerExample.py

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

176176
# Creates the 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
# Plots the data from channel A onto a graph
180180
plt.plot(time, adc2mVChAMax[:])

ps3000aExamples/ps3000aBlockExample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
adc2mVChAMax = adc2mV(bufferAMax, chARange, maxADC)
144144

145145
# Creates the time data
146-
time = np.linspace(0, (cmaxSamples.value) * timeIntervalns.value, cmaxSamples.value)
146+
time = np.linspace(0, (cmaxSamples.value - 1) * timeIntervalns.value, cmaxSamples.value)
147147

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

ps3000aExamples/ps3000aBlockMSOExample.py

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

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

153153
# Plot the data from digital channels onto a graph
154154

ps3000aExamples/ps3000aRapidBlockExample.py

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

314314
# Creates the time data
315-
time = np.linspace(0, (cmaxSamples.value) * timeIntervalns.value, cmaxSamples.value)
315+
time = np.linspace(0, (cmaxSamples.value - 1) * timeIntervalns.value, cmaxSamples.value)
316316

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

ps3000aExamples/ps3000aStreamingExample.py

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

188188
# Create time data
189-
time = np.linspace(0, (totalSamples) * actualSampleIntervalNs, totalSamples)
189+
time = np.linspace(0, (totalSamples - 1) * actualSampleIntervalNs, totalSamples)
190190

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

0 commit comments

Comments
 (0)