Skip to content

Commit b1ce440

Browse files
author
neil.hamilton
committed
Create ps6000aExamples/ps6000aBlockExample.py with open and close device functions
1 parent be5acb5 commit b1ce440

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Copyright (C) 2020 Pico Technology Ltd. See LICENSE file for terms.
3+
#
4+
# PS6000 A BLOCK MODE EXAMPLE
5+
# This example opens a 6000a driver device, sets up two channels and a trigger then collects a block 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+
import matplotlib.pyplot as plt
12+
from picosdk.functions import adc2mV, assert_pico_ok
13+
14+
# Create chandle and status ready for use
15+
chandle = ctypes.c_int16()
16+
status = {}
17+
18+
# Open 6000 A series PicoScope
19+
# returns handle to chandle for use in future API functions
20+
status["openunit"] = ps.ps6000aOpenUnit(ctypes.byref(chandle), None, 0)
21+
assert_pico_ok(status["openunit"])
22+
23+
# Close the scope
24+
status["closeunit"] = ps.ps6000aCloseUnit(chandle)
25+
assert_pico_ok(status["closeunit"])
26+
27+
print(status)

0 commit comments

Comments
 (0)