PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
import ctypes
from ctypes import *
from array import array
c_handle = c_int16()
maxvalue = c_int16()
reqd = c_int16()
zstr='abcdefghijklmnop'
testlib = ctypes.CDLL('/opt/picoscope/lib/libpl1000.so')
a=testlib.pl1000OpenUnit( byref(c_handle))
print a, c_handle
a=testlib.pl1000MaxValue(1,byref(maxvalue))
print maxvalue
dat1=c_uint * 16
channel = dat1(1, 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)
print channel
b=testlib.pl1000GetUnitInfo(1,zstr,100,byref(reqd),1)
print b, zstr
b=testlib.pl1000GetUnitInfo(1,zstr,100,byref(reqd),2)
print b, zstr
b=testlib.pl1000GetUnitInfo(1,zstr,100,byref(reqd),3)
print b, zstr
b=testlib.pl1000GetUnitInfo(1,zstr,100,byref(reqd),4)
print b, zstr
b=testlib.pl1000GetUnitInfo(1,zstr,100,byref(reqd),5)
print b, zstr
b=testlib.pl1000GetUnitInfo(1,zstr,100,byref(reqd),6)
print b, zstr
b=testlib.pl1000SetInterval(1,10000,5,byref(channel),16)
print b, channel
a=testlib.pl1000CloseUnit( byref(c_handle))
print a
Code: Select all
import ctypes
import numpy as np
from ctypes import *
maxvalue = c_int16()
device = c_int16()
mydll = ctypes.CDLL('/opt/picoscope/lib/libpl1000.so')
a=mydll.pl1000OpenUnit( byref(device))
print a, device
a=mydll.pl1000MaxValue(device,byref(maxvalue))
print a, maxvalue
channel = np.zeros((4,), dtype=np.intc)
channel[0]=1
channel[1]=2
channel[2]=3
channel[3]=4
b=mydll.pl1000SetInterval(device,10000,20,channel.ctypes.data,4)
print b
print channel[0],channel[1],channel[2],channel[3]
Code: Select all
us_for_block = c_int32()
us_for_block = 10000
b=mydll.pl1000SetInterval(device,byref(us_for_block),20,byref(channel.ctypes.data),4)
Code: Select all
for i in range(1, 16):
b=mydll.pl1000GetSingle(device,i,value.ctypes.data)