# increment = 5 # dwellTime = 1 # sweepType = ctypes.c_int16(1) = PS6000_UP # operation = 0 # shots = 0 # sweeps = 0 # triggerType = ctypes.c_int16(0) = PS6000_SIGGEN_RISING # triggerSource = ctypes.c_int16(0) = PS6000_SIGGEN_NONE # extInThreshold = 1 wavetype = ctypes.c_int16(1) sweepType = ctypes.c_int32(2) triggertype = ctypes.c_int32(0) triggerSource = ctypes.c_int32(0) status["SetSigGenBuiltIn"] = ps.ps6000SetSigGenBuiltIn(chandle, 0, 2000000, wavetype, 10000, 100000, 5000, 1, sweepType, 0, 0, 0, triggertype, triggerSource, 1) assert_pico_ok(status["SetSigGenBuiltIn"]) # Pauses the script to show signal time.sleep(36) # Closes the unit # Handle = chandle status["close"] = ps.ps6000CloseUnit(chandle) assert_pico_ok(status["close"]) # Displays the status returns print(status)
import ctypes import numpy as np from picosdk.ps6000 import ps6000 as ps import matplotlib.pyplot as plt from picosdk.functions import adc2mV, assert_pico_ok # Create chandle and status ready for use chandle = ctypes.c_int16() status = {} # Open 6000 series PicoScope # Returns handle to chandle for use in future API functions status["openunit"] = ps.ps6000OpenUnit(ctypes.byref(chandle), None) assert_pico_ok(status["openunit"]) # Get Info from scope string = ctypes.c_int8() stringLength = ctypes.c_int16(1) requiredSize = ctypes.c_int16() info = ps.PICO_INFO["PICO_VARIANT_INFO"] status["getInfo"] = ps.ps6000GetUnitInfo(chandle, ctypes.byref(string), stringLength, ctypes.byref(requiredSize), info) assert_pico_ok(status["getInfo"]) # Close unitDisconnect the scope # handle = chandle ps.ps6000CloseUnit(chandle) # display status returns print(status)
def pico_close(handle): ret = ps.ps6000Stop(handle) assert_pico_ok(ret) ret = ps.ps6000CloseUnit(handle) assert_pico_ok(ret)