Skip to content

Commit 7a675c2

Browse files
author
neil.hamilton
committed
Add channelOff functions for channels B-H and finding fastest timebase to ps6000aBlockExample.py
1 parent b9637b7 commit 7a675c2

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

ps6000aExamples/ps6000aBlockExample.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@
2626
# handle = chandle
2727
channelA = 0 #enums.PICO_CHANNEL["PICO_CHANNEL_A"]
2828
coupling = 0 #enums.PICO_COUPLING["PICO_DC"]
29-
range = 7
29+
channelRange = 7
3030
# analogueOffset = 0 V
3131
bandwidth = 0 #enums.PICO_CHANNEL["PICO_BW_FULL"]
32-
status["setChannelA"] = ps.ps6000aSetChannelOn(chandle, channelA, coupling, range, 0, bandwidth)
32+
status["setChannelA"] = ps.ps6000aSetChannelOn(chandle, channelA, coupling, channelRange, 0, bandwidth)
3333
assert_pico_ok(status["setChannelA"])
3434

35+
# set channel B-H off
36+
for x in range (1, 7, 1):
37+
channel = x
38+
status["setChannel",x] = ps.ps6000aSetChannelOff(chandle,channel)
39+
assert_pico_ok(status["setChannel",x])
40+
3541
# Set simple trigger on channel A, 1 V rising with 1 s autotrigger
3642
# handle = chandle
3743
# enable = 1
@@ -43,6 +49,16 @@
4349
status["setSimpleTrigger"] = ps.ps6000aSetSimpleTrigger(chandle, 1, source, 1000, direction, 0, 1000000)
4450
assert_pico_ok(status["setSimpleTrigger"])
4551

52+
# Get fastest available timebase
53+
# handle = chandle
54+
enabledChannelFlags = 1 #PICO_CHANNEL_FLAGS["PICOCHANNEL_A_FLAGS"]
55+
timebase = ctypes.c_uint32(0)
56+
timeInterval = ctypes.c_double(0)
57+
# resolution = resolution
58+
status["getMinimumTimebaseStateless"] = ps.ps6000aGetMinimumTimebaseStateless(chandle, enabledChannelFlags, ctypes.byref(timebase), ctypes.byref(timeInterval), resolution)
59+
print("timebase = ", timebase.value)
60+
print("sample interval =", timeInterval.value, "s")
61+
4662
# Close the scope
4763
status["closeunit"] = ps.ps6000aCloseUnit(chandle)
4864
assert_pico_ok(status["closeunit"])

0 commit comments

Comments
 (0)