Skip to content

Commit cd662dc

Browse files
author
neil.hamilton
committed
Start ps6000aExamples/ps6000aStreamingModeExample.py
1 parent dd173db commit cd662dc

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Copyright (C) 2020 Pico Technology Ltd. See LICENSE file for terms.
3+
#
4+
# PS6000 A STREAMING MODE EXAMPLE
5+
# This example opens a 6000a driver device, sets up one channel then collects a streamed set of data.
6+
# This data is then plotted as mV against time in ns.
7+
8+
import ctypes
9+
import numpy as np
10+
from picosdk.ps6000a import ps6000a as ps
11+
from picosdk.PicoDeviceEnums import picoEnum as enums
12+
import matplotlib.pyplot as plt
13+
from picosdk.functions import adc2mV, assert_pico_ok
14+
15+
# Create chandle and status ready for use
16+
chandle = ctypes.c_int16()
17+
status = {}
18+
19+
# Open 6000 A series PicoScope
20+
# returns handle to chandle for use in future API functions
21+
resolution = enums.PICO_DEVICE_RESOLUTION["PICO_DR_8BIT"]
22+
status["openunit"] = ps.ps6000aOpenUnit(ctypes.byref(chandle), None, resolution)
23+
assert_pico_ok(status["openunit"])
24+
25+
# Set channel A on
26+
# handle = chandle
27+
channelA = enums.PICO_CHANNEL["PICO_CHANNEL_A"]
28+
coupling = enums.PICO_COUPLING["PICO_DC"]
29+
channelRange = 7
30+
# analogueOffset = 0 V
31+
bandwidth = enums.PICO_BANDWIDTH_LIMITER["PICO_BW_FULL"]
32+
status["setChannelA"] = ps.ps6000aSetChannelOn(chandle, channelA, coupling, channelRange, 0, bandwidth)
33+
assert_pico_ok(status["setChannelA"])
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])

0 commit comments

Comments
 (0)