Skip to content

Commit 87e6d23

Browse files
author
neil.hamilton
committed
Create ps6000Examples/ps6000GetInfoExample.py
1 parent 22c8c6d commit 87e6d23

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# Copyright (C) 2020 Pico Technology Ltd. See LICENSE file for terms.
3+
#
4+
# PS6000 GET INFO EXAMPLE
5+
# This example opens a 6000 driver device, gets the variant info and closes the scope.
6+
7+
import ctypes
8+
import numpy as np
9+
from picosdk.ps6000 import ps6000 as ps
10+
import matplotlib.pyplot as plt
11+
from picosdk.functions import adc2mV, assert_pico_ok
12+
13+
# Create chandle and status ready for use
14+
chandle = ctypes.c_int16()
15+
status = {}
16+
17+
# Open 6000 series PicoScope
18+
# Returns handle to chandle for use in future API functions
19+
status["openunit"] = ps.ps6000OpenUnit(ctypes.byref(chandle), None)
20+
assert_pico_ok(status["openunit"])
21+
22+
# Get Info from scope
23+
string = ctypes.c_int8()
24+
stringLength = ctypes.c_int16(1)
25+
requiredSize = ctypes.c_int16()
26+
info = ps.PICO_INFO["PICO_VARIANT_INFO"]
27+
status["getInfo"] = ps.ps6000GetUnitInfo(chandle, ctypes.byref(string),stringLength, ctypes.byref(requiredSize), info)
28+
assert_pico_ok(status["getInfo"])
29+
30+
# Close unitDisconnect the scope
31+
# handle = chandle
32+
ps.ps6000CloseUnit(chandle)
33+
34+
# display status returns
35+
print(status)

0 commit comments

Comments
 (0)