PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
# coding=utf-8
import ctypes
import matplotlib.pyplot as plt
import time,datetime
import numpy as np
import os
from picosdk.functions import adc2mV, assert_pico_ok
from picosdk.constants import PICO_STATUS
# from picosdk.ps6000a import ps6000a as ps_org
# from picosdk.ps6000a import ps6000b as ps_new
from picosdk.PicoDeviceEnums import picoEnum as enums
import sys
import threading
import json
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from ps6000ax import create_ps6000ax_instance
if len(sys.argv)<6:
raise RuntimeError("Input parameters should be at least 6")
input_channel_idx = int(sys.argv[1]) # 1,2,3,4
if input_channel_idx==None or input_channel_idx not in [1,2,3,4]:
raise RuntimeError("Pico channel index wrong:"+input_channel_idx)
boardsn = str(sys.argv[2])
image_name_extension = str(sys.argv[3])
if (boardsn==None or len(boardsn)==0) or (image_name_extension==None or len(image_name_extension)==0):
raise RuntimeError("Wrong with parameter of BoardSN :"+boardsn+' or image_name_extension:'+image_name_extension)
pico_serial_1st = sys.argv[4] # IW990/0043
assert pico_serial_1st and len(pico_serial_1st)>=9,"Wrong pico_serial_1st"
pico_serial_2nd = sys.argv[5] # JP433/0003
assert pico_serial_2nd and len(pico_serial_2nd)>=9,"Wrong pico_serial_2nd"
# timebase=int(sys.argv[4])
# channelRange = int(sys.argv[5])
# TotalSample=int(sys.argv[6])
# data_directory=str(sys.argv[7])
data_directory = os.path.join('/vault/LVCCAC/Data3',boardsn)
input_channel_data = ['','PICO_CHANNEL_A','PICO_CHANNEL_B','PICO_CHANNEL_C','PICO_CHANNEL_D',]
class LVCC_PICO(threading.Thread):
def __init__(self,**kwargs):
super(LVCC_PICO,self).__init__()
self.input_channel_idx = kwargs.get('input_channel_idx',None)
self.boardsn = kwargs.get('boardsn',None)
self.image_name_extension = kwargs.get('image_name_extension',None)
self.pico_serial = kwargs.get('pico_serial',None)
self.ps = kwargs.get('psobject',None)
_time_stamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
self.ret_file = os.path.join(data_directory,'retdata_{}_{}.log'.format(_time_stamp,self.pico_serial.replace('/','_')))
self.input_channel = input_channel_data[self.input_channel_idx]
self.check_path()
self.print_log('Input_channel:' + self.input_channel)
self.channelRange = 6 # 量程
# 0: 10MV, 1: 20MV, 2: 50MV, 3: 100MV, 4: 200MV, 5: 500MV, 6: 1V, 7: 2V, 8: 5V, 9: 10V, 10: 20V, 11: 50V, 12: 100V, 13: 200V,
self.TotalSample=1000000
self.print_log('TotalSample:'+repr(self.TotalSample))
self.status = {}
def print_log(self,info):
with open(self.ret_file,'a') as fa:
fa.write(info+'\n')
fa.flush()
def print_error_value(self,eInfo=None):
if eInfo:
self.print_log(eInfo)
self.print_log("Vhigh_output: -1 mv")
self.print_log("Vmin_output: -1 mV")
self.print_log("Vpeak_output: -v mV")
def check_path(self):
if not os.path.exists(data_directory):
os.system('mkdir -p ' + data_directory)
def open_unit(self):
# 1. open unit
self.picohandle = ctypes.c_int16()
self.resolution = enums.PICO_DEVICE_RESOLUTION["PICO_DR_12BIT"]
self.serial = ctypes.create_string_buffer(self.pico_serial)
try:
self.status["openunit"] = self.ps.ps6000aOpenUnit(ctypes.byref(self.picohandle), self.serial, self.resolution)
# print status["openunit"]
assert_pico_ok(self.status["openunit"])
except Exception as e:
self.print_error_value(str(e))
raise e
def set_channel_on_off(self):
# 2. set channel on/off
self.channel = enums.PICO_CHANNEL[self.input_channel] # 通道
self.coupling = enums.PICO_COUPLING["PICO_DC"] # PICO_AC 耦合
self.print_log('Coupling:PICO_DC')
self.offset = 0 # -0.8 # V 偏移
self.bandwidth = enums.PICO_BANDWIDTH_LIMITER["PICO_BW_FULL"] # 带宽
self.print_log('Bandwidth:PICO_BW_FULL')
try:
self.status["setChannel"] = self.ps.ps6000aSetChannelOn(self.picohandle, self.channel, self.coupling, self.channelRange, self.offset, self.bandwidth)
assert_pico_ok(self.status["setChannel"])
PS6424EChannels = ['PICO_CHANNEL_A','PICO_CHANNEL_B','PICO_CHANNEL_C','PICO_CHANNEL_D']
for x in range(len(PS6424EChannels)):
if PS6424EChannels[x]!=self.input_channel:
self.status["setChannel_{}".format(x)] = self.ps.ps6000aSetChannelOff(self.picohandle,x)
assert_pico_ok(self.status["setChannel_{}".format(x)])
except Exception as e:
self.print_error_value(str(e))
raise e
def set_simple_trigger(self):
# 3. set Simple Trigger
try:
self.direction = enums.PICO_THRESHOLD_DIRECTION["PICO_RISING"]
self.status["setSimpleTrigger"] = self.ps.ps6000aSetSimpleTrigger(self.picohandle, 1, self.channel, 1000, self.direction, 0, 1000000)
assert_pico_ok(self.status["setSimpleTrigger"])
except Exception as e:
self.print_error_value(str(e))
raise e
def get_timebase(self):
# 4.get timebase
# timebase = ctypes.c_uint32(1000)
self.timebase=4
self.timeIntervalNanoseconds = ctypes.c_double(0)
self.maxSamples = ctypes.c_uint64()
try:
self.status["getTimebase"] = self.ps.ps6000aGetTimebase(self.picohandle,self.timebase,self.TotalSample,ctypes.byref(self.timeIntervalNanoseconds),ctypes.byref(self.maxSamples),1)
assert_pico_ok(self.status["getTimebase"])
except Exception as e:
self.print_error_value(str(e))
raise e
self.timeInterval = self.timeIntervalNanoseconds
self.print_log('timebase:'+repr(self.timebase))
self.print_log('timeIntervalNanoseconds:'+repr(self.timeIntervalNanoseconds.value)+'ns')
# print 'maxSamples:'+repr(self.maxSamples.value)
def set_data_buffer(self):
# 5. set data buffer
# Set number of samples to be collected
self.noOfPreTriggerSamples = self.TotalSample
self.noOfPostTriggerSamples = self.TotalSample
self.nSamples = self.noOfPreTriggerSamples + self.noOfPostTriggerSamples
# Create buffers
self.bufferAMax = (ctypes.c_int16 * self.nSamples)()
self.bufferAMin = (ctypes.c_int16 * self.nSamples)() # used for downsampling which isn't in the scope of this example
self.dataType = enums.PICO_DATA_TYPE["PICO_INT16_T"]
self.waveform = 0
self.downSampleMode = enums.PICO_RATIO_MODE["PICO_RATIO_MODE_RAW"]
self.clear = enums.PICO_ACTION["PICO_CLEAR_ALL"]
self.add = enums.PICO_ACTION["PICO_ADD"]
self.action = self.clear|self.add # PICO_ACTION["PICO_CLEAR_WAVEFORM_CLEAR_ALL"] | PICO_ACTION["PICO_ADD"]
try:
self.status["setDataBuffers"] = self.ps.ps6000aSetDataBuffers(self.picohandle, self.channel, ctypes.byref(self.bufferAMax), ctypes.byref(self.bufferAMin), self.nSamples, self.dataType, self.waveform, self.downSampleMode, self.action)
assert_pico_ok(self.status["setDataBuffers"])
except Exception as e:
self.print_error_value(str(e))
raise e
# bufferDPort0Max = (ctypes.c_int16 * nSamples)()
# bufferDPort0Min = (ctypes.c_int16 * nSamples)()
# status["setDataDP0Buffers"] = self.ps.ps6000aSetDataBuffers(picohandle, channel, ctypes.byref(bufferDPort0Max), ctypes.byref(bufferDPort0Min), nSamples, dataType, waveform, downSampleMode, action)
# assert_pico_ok(status["setDataDP0Buffers"])
def run_block(self):
# 6. run block
self.timeIndisposedMs = ctypes.c_double(0)
try:
self.status["runBlock"] = self.ps.ps6000aRunBlock(self.picohandle, self.noOfPreTriggerSamples, self.noOfPostTriggerSamples, self.timebase, ctypes.byref(self.timeIndisposedMs), 0, None, None)
# print 'timeIndisposedMs = ',timeIndisposedMs.value
assert_pico_ok(self.status["runBlock"])
except Exception as e:
self.print_error_value(str(e))
raise e
def wait_for_data_is_ready(self):
# 7. wait for data is ready
self.start_time = time.time()
self.ready = ctypes.c_int16(0)
self.check = ctypes.c_int16(0)
while self.ready.value == self.check.value:
self.status["isReady"] = self.ps.ps6000aIsReady(self.picohandle, ctypes.byref(self.ready))
def get_pico_data(self):
# 8. get data
self.noOfSamples = ctypes.c_uint64(self.nSamples)
# downSampleRatio = 1
# segmentIndex = 0
self.overflow = ctypes.c_int16(0)
try:
self.status["getValues"] = self.ps.ps6000aGetValues(self.picohandle, 0, ctypes.byref(self.noOfSamples), 1, self.downSampleMode, 0, ctypes.byref(self.overflow))
assert_pico_ok(self.status["getValues"])
except Exception as e:
self.print_error_value(str(e))
raise e
self.minADC = ctypes.c_int16()
self.maxADC = ctypes.c_int16()
try:
self.status["getAdcLimits"] = self.ps.ps6000aGetAdcLimits(self.picohandle, self.resolution, ctypes.byref(self.minADC), ctypes.byref(self.maxADC))
assert_pico_ok(self.status["getAdcLimits"])
except Exception as e:
self.print_error_value(str(e))
raise e
self.adc2mVChAMax = adc2mV(self.bufferAMax, self.channelRange, self.maxADC)
def parse_pico_data(self):
self.elapsed_time = time.time() - self.start_time
self.Vpeak_output = np.max(self.adc2mVChAMax)
self.Vmin_output = np.min(self.adc2mVChAMax)
self.Vhigh_output = np.mean(self.adc2mVChAMax)
self.Vstd_output = np.std(self.adc2mVChAMax)
self.vpeak_output_str = "Vpeak_output: "+repr(round(self.Vpeak_output,3))+'mV'
self.vmin_output_str = "Vmin_output: "+repr(round(self.Vmin_output,3))+'mV'
self.vhigh_output_str = "Vhigh_output: "+repr(round(self.Vhigh_output,3))+'mV'
self.vstd_ouput_str = "Vstd_output: "+repr(round(self.Vstd_output,3))
# print "time passed:"+repr(elapsed_time)+' s'
# print "Vhigh_output:"+repr(Vhigh_output)+'mV'
# print "Vmin_output:"+repr(Vmin_output)+'mV'
# print "Vpeak_output:"+repr(Vpeak_output)+'mV'
self.print_log(self.vhigh_output_str)
self.print_log(self.vmin_output_str)
self.print_log(self.vpeak_output_str)
self.print_log(self.vstd_ouput_str)
def close_unit(self):
self.status["closeunit"] = self.ps.ps6000aCloseUnit(self.picohandle)
assert_pico_ok(self.status["closeunit"])
# print time.shape # (2000000,)
def plt_figure(self):
# time = np.linspace(0, (nSamples -1) * timeInterval.value * 1000000000, nSamples)
self.plt_time = np.linspace(0, (self.nSamples -1) * self.timeInterval.value, self.nSamples)
self.time_stamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
self.png_file = os.path.join(data_directory,self.boardsn+'_'+self.time_stamp+"_"+self.image_name_extension+".png")
plt_data = {
"plt_time":self.plt_time,
"plt_adc":self.adc2mVChAMax,
"plt_vhigh_output":self.vhigh_output_str,
"plt_vmin_output":self.vmin_output_str,
"plt_vpeak_output":self.vpeak_output_str,
"plt_vstd_ouput":self.vstd_ouput_str
}
data_file = os.path.join(data_directory,'pltdata_{}_{}.json'.format(self.time_stamp,self.pico_serial.replace('/','_')))
with open(data_file,'w') as fw:
json.dump(plt_data,fw)
fw.flush()
plt_py_path = os.path.basename(os.path.abspath(__file__))
plt_py_file = os.path.join(py_path,'plt_figure.py')
plt_cmd = "python {} {} {}".format(plt_py_file,data_file,self.png_file)
os.system(plt_cmd)
def run(self):
self.open_unit()
self.set_channel_on_off()
self.set_simple_trigger()
self.get_timebase()
self.set_data_buffer()
self.run_block()
self.wait_for_data_is_ready()
self.get_pico_data()
self.parse_pico_data()
self.close_unit()
self.plt_figure()
if __name__ == '__main__':
kwargs_1st = {
"input_channel_idx":input_channel_idx,
"boardsn":boardsn,
"image_name_extension":image_name_extension,
"pico_serial":pico_serial_1st,
"psobject":create_ps6000ax_instance()
}
pico_1st = LVCC_PICO(**kwargs_1st)
kwargs_2nd = {
"input_channel_idx":input_channel_idx,
"boardsn":boardsn,
"image_name_extension":image_name_extension,
"pico_serial":pico_serial_2nd,
"psobject":create_ps6000ax_instance()
}
pico_2nd = LVCC_PICO(**kwargs_2nd)
pico_1st.start()
time.sleep(0.015)
pico_2nd.start()
print 'pico_1st_retfile:{}\npico_2nd_retfile:{}\n'.format(pico_1st.ret_file,pico_2nd.ret_file)
Code: Select all
# ps6000ax.py
from ctypes import *
from picosdk.library import Library
from picosdk.ctypes_wrapper import C_CALLBACK_FUNCTION_FACTORY
from picosdk.constants import make_enum
class Ps6000axlib(Library):
def __init__(self):
super(Ps6000axlib, self).__init__("ps6000a")
def create_ps6000ax_instance():
ps6000ax = Ps6000axlib()
doc = """ void ps6000aBlockReady
(
int16_t handle,
PICO_STATUS status,
PICO_POINTER pParameter
); """
ps6000ax.BlockReadyType = C_CALLBACK_FUNCTION_FACTORY(None,
c_int16,
c_uint32,
c_void_p)
ps6000ax.BlockReadyType.__doc__ = doc
doc = """ void ps6000aStreamingReady
(
int16_t handle,
int64_t noOfSamples,
uint64_t bufferIndex,
uint32_t startIndex,
int16_t overflow,
uint32_t triggerAt,
int16_t triggered,
int16_t autoStop,
PICO_POINTER pParameter
); """
ps6000ax.StreamingReadyType = C_CALLBACK_FUNCTION_FACTORY(None,
c_int16,
c_int64,
c_uint64,
c_uint32,
c_int16,
c_uint32,
c_int16,
c_int16,
c_void_p)
ps6000ax.StreamingReadyType.__doc__ = doc
doc = """ void ps6000aDataReady
(
int16_t handle,
PICO_STATUS status,
uint64_t noOfSamples,
int16_t overflow,
PICO_POINTER pParameter
); """
ps6000ax.DataReadyType = C_CALLBACK_FUNCTION_FACTORY(None,
c_int16,
c_uint32,
c_uint64,
c_int16,
c_void_p)
ps6000ax.DataReadyType.__doc__ = doc
doc = """ void ps6000aProbeInteractions
(
int16_t handle,
PICO_STATUS status,
PICO_USER_PROBE_INTERACTIONS *probes,
uint32_t nProbes
); """
ps6000ax.ProbeInteractionsType = C_CALLBACK_FUNCTION_FACTORY(None,
c_int16,
c_uint32,
c_void_p,
c_uint32)
ps6000ax.ProbeInteractionsType.__doc__ = doc
doc = """ void ps6000aDigitalPortInteractions
(
int16_t handle,
PICO_STATUS status,
PICO_DIGITAL_PORT_INTERACTIONS *ports,
uint32_t nPorts
); """
ps6000ax.DigitalPortInteractionsType = C_CALLBACK_FUNCTION_FACTORY(None,
c_int16,
c_uint32,
c_void_p,
c_uint32)
ps6000ax.DigitalPortInteractionsType.__doc__ = doc
doc = """ PICO_STATUS ps6000aOpenUnit
(
int16_t *handle,
int8_t *serial
PICO_DEVICE_RESOLUTION resolution
); """
ps6000ax.make_symbol("_OpenUnit", "ps6000aOpenUnit", c_uint32, [c_void_p, c_char_p, c_int32], doc)
doc = """ PICO_STATUS ps6000aOpenUnitAsync
(
int16_t *handle,
int8_t *serial,
PICO_DEVICE_RESOLUTION resolution
); """
ps6000ax.make_symbol("_OpenUnitAsync", "ps6000aOpenUnitAsync", c_uint32, [c_void_p, c_char_p, c_int32], doc)
doc = """ PICO_STATUS ps6000aOpenUnitProgress
(
int16_t *handle,
int16_t *progressPercent,
int16_t *complete
); """
ps6000ax.make_symbol("_OpenUnitProgress", "ps6000aOpenUnitProgress", c_uint32, [c_void_p, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aGetUnitInfo
(
int16_t handle,
int8_t *string,
int16_t stringLength,
int16_t *requiredSize,
PICO_INFO info
); """
ps6000ax.make_symbol("_GetUnitInfo", "ps6000aGetUnitInfo", c_uint32, [c_int16, c_char_p, c_int16, c_void_p, c_int32], doc)
doc = """ PICO_STATUS ps6000aCloseUnit
(
int16_t handle
); """
ps6000ax.make_symbol("_CloseUnit", "ps6000aCloseUnit", c_uint32, [c_int16], doc)
doc = """ PICO_STATUS ps6000aFlashLed
(
int16_t handle,
int16_t start
); """
ps6000ax.make_symbol("_FlashLed", "ps6000aFlashLed", c_uint32, [c_int16, c_int16], doc)
doc = """ PICO_STATUS ps6000aMemorySegments
(
int16_t handle,
uint64_t nSegments,
uint64_t *nMaxSegments
); """
ps6000ax.make_symbol("_MemorySegments", "ps6000aMemorySegments", c_uint32, [c_int16, c_uint64, c_void_p], doc)
doc = """ PICO_STATUS ps6000aMemorySegmentsBySamples
(
int16_t handle,
uint64_t nSamples,
uint64_t *nMaxSegments
); """
ps6000ax.make_symbol("_MemorySegmentsBySamples", "ps6000aMemorySegmentsBySamples", c_uint32, [c_int16, c_uint64, c_void_p], doc)
doc = """ PICO_STATUS ps6000aGetMaximumAvailableMemory
(
int16_t handle,
uint64_t *nMaxSamples,
PICO_DEVICE_RESOLUTION resolution
); """
ps6000ax.make_symbol("_GetMaximumAvailableMemory", "ps6000aGetMaximumAvailableMemory", c_uint32, [c_int16, c_void_p, c_uint32], doc)
doc = """ PICO_STATUS ps6000aQueryMaxSegmentsBySamples
(
int16_t handle,
uint64_t nSamples,
uint32_t nChannelsEnabled,
uint64_t *nMaxSegments,
PICO_DEVICE_RESOLUTION resolution
); """
ps6000ax.make_symbol("_QueryMaxSegmentsBySamples", "ps6000aQueryMaxSegmentsBySamples", c_uint32, [c_int16, c_uint64, c_int32, c_void_p, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetChannelOn
(
int16_t handle,
PICO_CHANNEL channel,
PICO_COUPLING coupling,
PICO_CONNECT_PROBE_RANGE range,
double analogueOffset,
PICO_BANDWIDTH_LIMITER bandwidth
); """
ps6000ax.make_symbol("_SetChannelOn", "ps6000aSetChannelOn", c_uint32, [c_int16, c_uint32, c_uint32, c_uint32, c_double, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetChannelOff
(
int16_t handle,
PICO_CHANNEL channel
); """
ps6000ax.make_symbol("_SetChannelOff", "ps6000aSetChannelOff", c_uint32, [c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetDigitalPortOn
(
int16_t handle,
PICO_CHANNEL port,
int16_t *logicThresholdLevel,
int16_t logicThresholdLevelLength
PICO_DIGITAL_PORT_HYSTERESIS hysteresis
); """
ps6000ax.make_symbol("_SetDigitalPortOn", "ps6000aSetDigitalPortOn", c_uint32, [c_int16, c_uint32, c_void_p, c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetDigitalPortOff
(
int16_t handle,
PICO_CHANNEL port
); """
ps6000ax.make_symbol("_SetDigitalPortOff", "ps6000aSetDigitalPortOff", c_uint32, [c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps6000aGetTimebase
(
int16_t handle,
uint32_t timebase,
uint64_t noSamples,
double *timeIntervalNanoseconds,
uint64_t *maxSamples,
uint64_t segmentIndex
); """
ps6000ax.make_symbol("_GetTimebase", "ps6000aGetTimebase", c_uint32, [c_int16, c_uint32, c_uint64, c_void_p, c_void_p, c_uint64], doc)
doc = """ PICO_STATUS ps6000aSigGenWaveform
(
int16_t handle,
PICO_WAVE_TYPE wavetype,
int16_t *buffer,
uint16 bufferLength
); """
ps6000ax.make_symbol("_SigGenWaveform", "ps6000aSigGenWaveform", c_uint32, [c_int16, c_uint32, c_void_p, c_uint16], doc)
doc = """ PICO_STATUS ps6000aSignGenRange
(
int16_t handle,
double peakToPeakVolts,
double offsetVolts
); """
ps6000ax.make_symbol("_SigGenRange", "ps6000aSigGenRange", c_uint32, [c_int16, c_double, c_double], doc)
doc = """ PICO_STATUS ps6000aSigGenWaveformDutyCycle
(
int16_t handle,
double dutyCyclePercent
); """
ps6000ax.make_symbol("_SigGenWaveformDutyCycle", "ps6000aSigGenWaveformDutyCycle", c_uint32, [c_int16, c_double], doc)
doc = """ PICO_STATUS ps6000aSigGenTrigger
(
int16_t handle,
PICO_SIGGEN_TRIG_TYPE triggerType,
PICO_SIGGEN_TRIG_SOURCE triggerSource,
uint64_t cycles,
uint64_t autoTriggerPicoSeconds
); """
ps6000ax.make_symbol("_SigGenTrigger", "ps6000aSigGenTrigger", c_uint32, [c_int16, c_uint32, c_uint32, c_uint64, c_uint64], doc)
doc = """ PICO_STATUS ps6000aSigGenFilter
(
int16_t handle,
PICO_SIGGEN_FILTER_STATE filterState
); """
ps6000ax.make_symbol("_SigGenFilter", "ps6000aSigGenFilter", c_uint32, [c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSigGenFrequency
(
int16_t handle,
double frequencyHz
); """
ps6000ax.make_symbol("_SigGenFrequency", "ps6000aSigGenFrequency", c_uint32, [c_int16, c_double], doc)
doc = """ PICO_STATUS ps6000aSigGenFrequencySweep
(
int16_t handle,
double stopFrequencyHz,
double frequencyIncrement,
double dwellTimeSeconds,
PICO_SWEEP_TYPE sweepType
); """
ps6000ax.make_symbol("_SigGenFrequencySweep", "ps6000aSigGenFrequencySweep", c_uint32, [c_int16, c_double, c_double, c_double, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSigGenPhase
(
int16_t handle,
uint64_t deltaPhase
); """
ps6000ax.make_symbol("_SigGenPhase", "ps6000aSigGenPhase", c_uint32, [c_int16, c_uint64], doc)
doc = """ PICO_STATUS ps6000aSigGenPhaseSweep
(
int16_t handle,
uint64_t stopDeltaPhase,
uint64_t deltaPhaseIncrement,
uint64_t dwellCount,
PICO_SWEEP_TYPE sweepType
); """
ps6000ax.make_symbol("_SigGenPhaseSweep", "ps6000aSigGenPhaseSweep", c_uint32, [c_int16, c_uint64, c_uint64, c_uint64, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSigGenClockManual
(
int16_t handle,
double dacClockFrequency,
uint64_t prescaleRatio
); """
ps6000ax.make_symbol("_SigGenClockManual", "ps6000aSigGenClockManual", c_uint32, [c_int16, c_double, c_uint64], doc)
doc = """ PICO_STATUS ps6000aSigGenSoftwareTriggerControl
(
int16_t handle,
PICO_SIGGEN_TRIG_TYPE triggerState
); """
ps6000ax.make_symbol("_SigGenSoftwareTriggerControl", "ps6000aSigGenSoftwareTriggerControl", c_uint32, [c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSigGenApply
(
int16_t handle,
int16_t sigGenEnabled,
int16_t sweepEnabled,
int16_t triggerEnabled,
int16_t automaticClockOptimisationEnabled,
int16_t overrideAutomaticClockAndPrescale,
double *frequency,
double *stopFrequency,
double *frequencyIncrement,
double *dwellTime
); """
ps6000ax.make_symbol("_SigGenApply", "ps6000aSigGenApply", c_uint32, [c_int16, c_int16, c_int16, c_int16, c_int16, c_int16, c_void_p, c_void_p, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aSigGenLimits
(
int16_t handle,
PICO_SIGGEN_PARAMETER parameter,
double *minimumPermissibleValue,
double *maximumPermissibleValue,
double *step
); """
ps6000ax.make_symbol("_SigGenLimits", "ps6000aSigGenLimits", c_uint32, [c_int16, c_uint32, c_double, c_double, c_double], doc)
doc = """ PICO_STATUS ps6000aSigGenFrequencyLimits
(
int16_t handle,
PICO_WAVE_TYPE waveType,
uint64_t *numSamples,
double *startFrequency,
int16_t sweepEnabled,
double *manualDacClockFrequency,
uint64_t *manualPrescaleRatio,
double *maxStopFrequencyOut,
double *minFrequencyStepOut,
double *maxFrequencyStepOut,
double *minDwellTimeOut,
double *maxDwellTimeOut
); """
ps6000ax.make_symbol("_SigGenFrequencyLimits", "ps6000aSigGenFrequencyLimits", c_uint32, [c_int16, c_uint32, c_void_p, c_void_p, c_int16, c_void_p, c_void_p, c_void_p, c_void_p, c_void_p, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aSigGenPause
(
int16_t handle
); """
ps6000ax.make_symbol("_SigGenPause", "ps6000aSigGenPause", c_uint32, [c_int16], doc)
doc = """ PICO_STATUS ps6000aSigGenRestart
(
int16_t handle
); """
ps6000ax.make_symbol("_SigGenRestart", "ps6000aSigGenRestart", c_uint32, [c_int16], doc)
doc = """ PICO_STATUS ps6000aSetSimpleTrigger
(
int16_t handle
int16_t enable,
PICO_CHANNEL source,
int16_t threshold,
PICO_THRESHOLD_DIRECTION direction,
uint64_t delay,
uint32_t autoTriggerMicroSeconds
); """
ps6000ax.make_symbol("_SetSimpleTrigger", "ps6000aSetSimpleTrigger", c_uint32, [c_int16, c_int16, c_uint32, c_int16, c_uint32, c_uint64, c_uint32], doc)
doc = """ PICO_STATUS ps6000aTriggerWithinPreTriggerSamples
(
int16_t handle,
PICO_TRIGGER_WITHIN_PRE_TRIGGER state
); """
ps6000ax.make_symbol("_TriggerWithinPreTriggerSamples", "ps6000aTriggerWithinPreTriggerSamples", c_uint32, [c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetTriggerChannelProperties
(
int16_t handle,
PICO_TRIGGER_CHANNEL_PROPERTIES *channelProperties,
int16_t nChannelProperties,
int16_t auxOutputEnable,
uint32_t autoTriggerMicroSeconds
); """
ps6000ax.make_symbol("_SetTriggerChannelProperties", "ps6000aSetTriggerChannelProperties", c_uint32, [c_int16, c_void_p, c_int16, c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetTriggerChannelConditions
(
int16_t handle,
PICO_CONDITION *conditions,
int16_t nConditions,
PICO_ACTION action
); """
ps6000ax.make_symbol("_SetTriggerChannelConditions", "ps6000aSetTriggerChannelConditions", c_uint32, [c_int16, c_void_p, c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetTriggerChannelDirections
(
int16_t handle,
PICO_DIRECTION *directions,
int16_t nDirections
); """
ps6000ax.make_symbol("_SetTriggerChannelDirections", "ps6000aSetTriggerChannelDirections", c_uint32, [c_int16, c_void_p, c_int16], doc)
doc = """ PICO_STATUS ps6000aSetTriggerDelay
(
int16_t handle,
uint64_t delay
); """
ps6000ax.make_symbol("_SetTriggerDelay", "ps6000aSetTriggerDelay", c_uint32, [c_int16, c_uint64], doc)
doc = """ PICO_STATUS ps6000aSetPulseWidthQualifierProperties
(
int16_t handle,
uint32_t lower,
uint32_t upper,
PICO_PULSE_WIDTH_TYPE type
); """
ps6000ax.make_symbol("_SetPulseWidthQualifierProperties", "ps6000aSetPulseWidthQualifierProperties", c_uint32, [c_int16, c_uint32, c_uint32, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetPulseWidthQualifierConditions
(
int16_t handle,
PICO_CONDITION *conditions,
int16_t nConditions,
PICO_ACTION action
); """
ps6000ax.make_symbol("_SetPulseWidthQualifierConditions", "ps6000aSetPulseWidthQualifierConditions", c_uint32, [c_int16, c_void_p, c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetPulseWidthQualifierDirections
(
int16_t handle,
PICO_DIRECTION *directions,
int16_t nDirections
); """
ps6000ax.make_symbol("_SetPulseWidthQualifierDirections", "ps6000aSetPulseWidthQualifierDirections", c_uint32, [c_int16, c_void_p, c_int16], doc)
doc = """ PICO_STATUS ps6000aSetTriggerDigitalPortProperties
(
int16_t handle,
PICO_CHANNEL port,
PICO_DIGITAL_CHANNEL_DIRECTIONS *directions,
int16_t nDirections
); """
ps6000ax.make_symbol("_SetTriggerDigitalPortProperties", "ps6000aSetTriggerDigitalPortProperties", c_uint32, [c_int16, c_uint32, c_void_p, c_int16], doc)
doc = """ PICO_STATUS ps6000aSetPulseWidthDigitalPortProperties
(
int16_t handle,
PICO_CHANNEL port,
PICO_DIGITAL_CHANNEL_DIRECTIONS *directions,
int16_t nDirections
); """
ps6000ax.make_symbol("_SetPulseWidthDigitalPortProperties", "ps6000aSetPulseWidthDigitalPortProperties", c_uint32, [c_int16, c_uint32, c_void_p, c_int16], doc)
doc = """ PICO_STATUS ps6000aGetTriggerTimeOffset
(
int16_t handle,
int64_t *time,
PICO_TIME_UNITS *timeUnits,
uint64_t segmentIndex
); """
ps6000ax.make_symbol("_GetTriggerTimeOffset", "ps6000aGetTriggerTimeOffset", c_uint32, [c_int16, c_void_p, c_void_p, c_uint64], doc)
doc = """ PICO_STATUS ps6000aGetValuesTriggerTimeOffsetBulk
(
int16_t handle,
int64_t *time,
PICO_TIME_UNITS *timeUnits,
uint64_t fromSegementIndex,
uint64_t toSegmentIndex
); """
ps6000ax.make_symbol("_GetValuesTriggerTimeOffsetBulk", "ps6000aGetValuesTriggerTimeOffsetBulk", c_uint32, [c_int16, c_void_p, c_void_p, c_uint64, c_uint64], doc)
doc = """ PICO_STATUS ps6000aSetDataBuffer
(
int16_t handle,
PICO_CHANNEL channel,
PICO_POINTER buffer,
int32_t nSamples,
PICO_DATA_TYPE dataType,
uint64_t waveform,
PICO_RATIO_MODE downSampleRatioMode,
PICO_ACTION action
); """
ps6000ax.make_symbol("_SetDataBuffer", "ps6000aSetDataBuffer", c_uint32, [c_int16, c_uint32, c_void_p, c_int32, c_uint32, c_uint64, c_uint32, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetDataBuffers
(
int16_t handle,
PICO_CHANNEL channel,
PICO_POINTER bufferMax,
PICO_POINTER bufferMin,
int32_t nSamples,
PICO_DATA_TYPE dataType,
uint64_t waveform,
PICO_RATIO_MODE downSampleRatioMode,
PICO_ACTION action
); """
ps6000ax.make_symbol("_SetDataBuffers", "ps6000aSetDataBuffers", c_uint32, [c_int16, c_uint32, c_void_p, c_void_p, c_int32, c_uint32, c_uint64, c_uint32, c_uint32], doc)
doc = """ PICO_STATUS ps6000aRunBlock
(
int16_t handle,
uint64_t noOfPreTriggerSamples,
uint64_t noOfPostTriggerSamples,
uint32_t timebase,
double *timeIndisposedMs,
uint64_t segmentIndex,
ps6000aBlockReady lpReady,
PICO_POINTER pParameter
); """
ps6000ax.make_symbol("_RunBlock", "ps6000aRunBlock", c_uint32, [c_int16, c_uint64, c_uint64, c_uint32, c_void_p, c_uint64, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aIsReady
(
int16_t handle,
int16_t *ready
); """
ps6000ax.make_symbol("_IsReady", "ps6000aIsReady", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps6000aRunStreaming
(
int16_t handle,
double *sampleInterval,
PICO_TIME_UNITS sampleIntervalTimeUnits,
uint64_t maxPreTriggerSamples,
uint64_t maxPostTriggerSamples,
int16_t autoStop,
uint64_t downSampleRatio,
PICO_RATIO_MODE downSampelRatioMode
): """
ps6000ax.make_symbol("_RunStreaming", "ps6000aRunStreaming", c_uint32, [c_int16, c_void_p, c_uint32, c_uint64, c_uint64, c_int16, c_uint64, c_uint32], doc)
doc = """ PICO_STATUS ps6000aGetStreamingLatestValues
(
int16_t handle,
PICO_STREAMING_DATA_INFO *streamingDataInfo,
uint64_t nStreamingDataInfos,
PICO_STREAMING_DATA_TRIGGER_INFO *triggerInfo
); """
ps6000ax.make_symbol("_GetStreamingLatestValues", "ps6000aGetStreamingLatestValues", c_uint32, [c_int16, c_void_p, c_uint64, c_void_p], doc)
doc = """ PICO_STATUS ps6000aNoOfStreamingValues
(
int16_t handle,
uint64_t *noOfValues
); """
ps6000ax.make_symbol("_NoOfStreamingValues", "ps6000aNoOfStreamingValues", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps6000aGetValues
(
int16_t handle,
uint64_t startIndex,
uint64_t *noOfSamples,
uint64_t downSampleRatio,
PICO_RATIO_MODE downSampleRatioMode,
uint64_t segmentIndex,
int16_t *overflow
); """
ps6000ax.make_symbol("_GetValues", "ps6000aGetValues", c_uint32, [c_int16, c_uint64, c_void_p, c_uint64, c_uint32, c_uint64, c_void_p], doc)
doc = """ PICO_STATUS ps6000aGetValuesBulk
(
int16_t handle,
uint64_t startIndex,
uint64_t *noOfSamples,
uint64_t fromSegmentIndex,
uint64_t toSegmentIndex,
uint64_t downSampleRatio,
PICO_RATIO_MODE downSampleRatioMode,
int16_t *overflow
); """
ps6000ax.make_symbol("_GetValuesBulk", "ps6000aGetValuesBulk", c_uint32, [c_int16, c_uint64, c_void_p, c_uint64, c_uint64, c_uint64, c_uint32, c_void_p], doc)
doc = """ PICO_STATUS ps6000aGetValuesAsync
(
int16_t handle,
uint64_t startIndex,
uint64_t noOfSamples,
uint64_t downSampleRatio,
PICO_RATIO_MODE downSampleRatioMode,
uint64_t segmentIndex,
PICO_POINTER lpDataReady,
PICO_POINTER pParameter
); """
ps6000ax.make_symbol("_GetValuesAsync", "ps6000aGetValuesAsync", c_uint32, [c_int16, c_uint64, c_uint64, c_uint64, c_uint32, c_uint64, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aGetValuesBulkAsync
(
int16_t handle,
uint64_t startIndex,
uint64_t noOfSamples,
uint64_t fromSegmentIndex,
uint64_t toSegmentIndex,
uint64_t downSampleRatio,
PICO_RATIO_MODE downSampleRatioMode,
PICO_POINTER lpDataReady,
PICO_POINTER pParameter
); """
ps6000ax.make_symbol("_GetValuesBulkAsync", "ps6000aGetValuesBulkAsync", c_uint32, [c_int16, c_uint64, c_uint64, c_uint64, c_uint64, c_uint64, c_uint32, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aGetValuesOverlapped
(
int16_t handle,
uint64_t startIndex,
uint64_t *noOfSamples,
uint64_t downSampleRatio,
PICO_RATIO_MODE downSampleRatioMode,
uint64_t fromSegementIndex,
uint64_t toSegmentIndex,
int16_t *overflow
); """
ps6000ax.make_symbol("_GetValuesOverlapped", "ps6000aGetValuesOverlapped", c_uint32, [c_int16, c_uint64, c_void_p, c_uint64, c_uint32, c_uint64, c_uint64, c_void_p], doc)
doc = """ PICO_STATUS ps6000aStopUsingGetValuesOverlapped
(
int16_t handle
); """
ps6000ax.make_symbol("_StopUsingGetValuesOverlapped", "ps6000aStopUsingGetValuesOverlapped", c_uint32, [c_int16], doc)
doc = """ PICO_STATUS ps6000aGetNoOfCaptures
(
int16_t handle,
uint64_t *nCaptures
); """
ps6000ax.make_symbol("_GetNoOfCaptures", "ps6000aGetNoOfCaptures", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps6000aGetNoOfProcessedCaptures
(
int16_t handle,
uint64_t *nProcessedCaptures
); """
ps6000ax.make_symbol("_GetNoOfProcessedCaptures", "ps6000aGetNoOfProcessedCaptures", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps6000aStop
(
int16_t handle,
); """
ps6000ax.make_symbol("_Stop", "ps6000aStop", c_uint32, [c_int16], doc)
doc = """ PICO_STATUS ps6000aSetNoOfCaptures
(
int16_t handle,
uint64_t nCaptures
); """
ps6000ax.make_symbol("_SetNoOfCaptures", "ps6000aSetNoOfCaptures", c_uint32, [c_int16, c_uint64], doc)
doc = """ PICO_STATUS ps6000aGetTriggerInfo
(
int16_t handle,
PICO_TRIGGER_INFO *triggerInfo,
uint64_t firstSegmentIndex,
uint64_t segmentCount
); """
ps6000ax.make_symbol("_getTriggerInfo", "ps6000aGetTriggerInfo", c_uint32, [c_int16, c_void_p, c_uint64, c_uint64], doc)
doc = """ PICO_STATUS ps6000aEnumerateUnits
(
int16_t *count,
int8_t *serials,
int16_t *serialLth
); """
ps6000ax.make_symbol("_EnumerateUnits", "ps6000aEnumerateUnits", c_uint32, [c_void_p, c_char_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aPingUnit
(
int16_t handle
); """
ps6000ax.make_symbol("_PingUnit", "ps6000aPingUnit", c_uint32, [c_int16], doc)
doc = """ PICO_STATUS ps6000aGetAnalogueOffsetLimits
(
int16_t handle,
PICO_CONNECT_PROBE_RANGE range,
PICO_COUPLING coupling,
double *maximumVoltage,
double *minimumVoltage
); """
ps6000ax.make_symbol("_GetAnalogueOffsetLimits", "ps6000aGetAnalogueOffsetLimits", c_uint32, [c_int16, c_uint32, c_uint32, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aGetMinimumTimebaseStateless
(
int16_t handle,
PICO_CHANNEL_FLAGS enabledChannelFlags,
uint32_t *timebase,
double *timeInterval,
PICO_DEVICE_RESOLUTION resolution
); """
ps6000ax.make_symbol("_GetMinimumTimebaseStateless", "ps6000aGetMinimumTimebaseStateless", c_uint32, [c_int16, c_uint32, c_void_p, c_void_p, c_uint32], doc)
doc = """ PICO_STATUS ps6000aNearestSampleIntervalStateless
(
int16_t handle,
PICO_CHANNEL_FLAGS enabledChannelFlags,
double timeIntervalRequested,
PICO_DEVICE_RESOLUTION resolution,
uint32_t *timebase,
double *timeIntervalAvailable
); """
ps6000ax.make_symbol("_NearestSampleIntervalStateless", "ps6000aNearestSampleIntervalStateless", c_uint32, [c_int16, c_uint32, c_double, c_uint32, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aChannelCombinationsStateless
(
int16_t handle,
PICO_CHANNEL_FLAGS *channelFlagsCombinations,
uint32_t *nChannelCombinations,
PICO_DEVICE_RESOLUTION resolution,
uint32_t timebase
); """
ps6000ax.make_symbol("_ChannelCombinationsStateless", "ps6000aChannelCombinationsStateless", c_uint32, [c_int16, c_void_p, c_void_p, c_uint32, c_uint32], doc)
doc = """ PICO_STATUS ps6000aSetDeviceResolution
(
int16_t handle,
PICO_DEVICE_RESOLUTION resolution
); """
ps6000ax.make_symbol("_SetDeviceResolution", "ps6000aSetDeviceResolution", c_uint32, [c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps6000aGetDeviceResolution
(
int16_t handle,
PICO_DEVICE_RESOLUTION *resolution
); """
ps6000ax.make_symbol("_GetDeviceResolution", "ps6000aGetDeviceResolution", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps6000aQueryOutputEdgeDetect
(
int16_t handle,
int16_t *state
); """
ps6000ax.make_symbol("_QueryOutputEdgeDetect", "ps6000aQueryOutputEdgeDetect", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps6000aSetOutputEdgeDetect
(
int16_t handle,
int16_t state
); """
ps6000ax.make_symbol("_SetOutputEdgeDetect", "ps6000aSetOutputEdgeDetect", c_uint32, [c_int16, c_int16], doc)
doc = """ PICO_STATUS ps6000aGetScalingValues
(
int16_t handle,
PICO_SCALING_FACTORS_VALUES *scalingValues,
int16_t nChannels
); """
ps6000ax.make_symbol("_GetScalingValues", "ps6000aGetScalingValues", c_uint32, [c_int16, c_void_p, c_int16], doc)
doc = """ PICO_STATUS ps6000aGetAdcLimits
(
int16_t handle,
PICO_DEVICE_RESOLUTION resolution,
int16_t *minValue,
int16_t *maxValue
); """
ps6000ax.make_symbol("_GetAdcLimits", "ps6000aGetAdcLimits", c_uint32, [c_int16, c_uint32, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aCheckForUpdate
(
int16_t handle,
PICO_VERSION *current,
PICO_VERSION *update,
uint16_t *updateRequired
); """
ps6000ax.make_symbol("_CheckForUpdate", "ps6000aCheckForUpdate", c_uint32, [c_int16, c_void_p, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps6000aStartFirmwareUpdate
(
int16_t handle,
PicoUpdateFirmwareProgress progress
); """
ps6000ax.make_symbol("_StartFirmwareUpdate", "ps6000aStartFirmwareUpdate", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps6000aSetProbeInteractionCallback
(
int16_t handle,
PicoProbeInteractions callback
); """
ps6000ax.make_symbol("_SetProbeInteractionCallback", "ps6000aSetProbeInteractionCallback", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps6000aSetExternalReferenceInteractionCallback
(
int16_t handle,
PicoExternalReferenceInteractions callback
); """
ps6000ax.make_symbol("_SetExternalReferenceInteractionCallback", "ps6000aSetExternalReferenceInteractionCallback", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps6000aSetAWGOverrangeInteractionCallback
(
int16_t handle,
PicoAWGOverrangeInteractions callback
); """
ps6000ax.make_symbol("_SetAWGOVerrangeInteractionCallback", "ps6000aSetAWGOverrangeInteractionCallback", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps6000aSetTemperatureSensorInteractioNCallback
(
int16_t handle,
PicoTemperatureSensorInteractions callback
); """
ps6000ax.make_symbol("_SetTemperatureSensroInteractionCallback", "ps6000aSetTemperatureSensorInteractionCallback", c_uint32, [c_int16, c_void_p], doc)
return ps6000ax