Skip to content

Commit b9637b7

Browse files
author
neil.hamilton
committed
Add simple trigger to ps6000aBlockExample.py
1 parent 8513726 commit b9637b7

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

ps6000aExamples/ps6000aBlockExample.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,31 @@
1818

1919
# Open 6000 A series PicoScope
2020
# returns handle to chandle for use in future API functions
21-
status["openunit"] = ps.ps6000aOpenUnit(ctypes.byref(chandle), None, 0)
21+
resolution = 0 # PICO_DEVICE_RESOLUTION["PICO_DR_8BIT"]
22+
status["openunit"] = ps.ps6000aOpenUnit(ctypes.byref(chandle), None, resolution)
2223
assert_pico_ok(status["openunit"])
2324

2425
# Set channel A on
2526
# handle = chandle
26-
channel = 0 #enums.PICO_CHANNEL["PICO_CHANNEL_A"]
27+
channelA = 0 #enums.PICO_CHANNEL["PICO_CHANNEL_A"]
2728
coupling = 0 #enums.PICO_COUPLING["PICO_DC"]
2829
range = 7
2930
# analogueOffset = 0 V
3031
bandwidth = 0 #enums.PICO_CHANNEL["PICO_BW_FULL"]
31-
status["setChannelA"] = ps.ps6000aSetChannelOn(chandle, channel, coupling, range, 0, bandwidth)
32+
status["setChannelA"] = ps.ps6000aSetChannelOn(chandle, channelA, coupling, range, 0, bandwidth)
3233
assert_pico_ok(status["setChannelA"])
3334

35+
# Set simple trigger on channel A, 1 V rising with 1 s autotrigger
36+
# handle = chandle
37+
# enable = 1
38+
source = channelA
39+
# threshold = 1000 mV
40+
direction = 2 # PICO_THRESHOLD_DIRECTION["PICO_RISING"]
41+
# delay = 0 s
42+
# autoTriggerMicroSeconds = 1000000 us
43+
status["setSimpleTrigger"] = ps.ps6000aSetSimpleTrigger(chandle, 1, source, 1000, direction, 0, 1000000)
44+
assert_pico_ok(status["setSimpleTrigger"])
45+
3446
# Close the scope
3547
status["closeunit"] = ps.ps6000aCloseUnit(chandle)
3648
assert_pico_ok(status["closeunit"])

0 commit comments

Comments
 (0)