|
26 | 26 | # handle = chandle |
27 | 27 | channelA = 0 #enums.PICO_CHANNEL["PICO_CHANNEL_A"] |
28 | 28 | coupling = 0 #enums.PICO_COUPLING["PICO_DC"] |
29 | | -range = 7 |
| 29 | +channelRange = 7 |
30 | 30 | # analogueOffset = 0 V |
31 | 31 | 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) |
33 | 33 | assert_pico_ok(status["setChannelA"]) |
34 | 34 |
|
| 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 | + |
35 | 41 | # Set simple trigger on channel A, 1 V rising with 1 s autotrigger |
36 | 42 | # handle = chandle |
37 | 43 | # enable = 1 |
|
43 | 49 | status["setSimpleTrigger"] = ps.ps6000aSetSimpleTrigger(chandle, 1, source, 1000, direction, 0, 1000000) |
44 | 50 | assert_pico_ok(status["setSimpleTrigger"]) |
45 | 51 |
|
| 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 | + |
46 | 62 | # Close the scope |
47 | 63 | status["closeunit"] = ps.ps6000aCloseUnit(chandle) |
48 | 64 | assert_pico_ok(status["closeunit"]) |
|
0 commit comments