I'm using a PicoScope 5442D with picoSDK and python, and I've been trying to use the AWG but haven't managed to make it work so far, as it only generates noise.
In the code below, I try to generate a sinusoidal signal starting off the examples provided. To check the generated signal, I've reused the code from the example "ps5000BlockExample"
Code: Select all
# create a custom waveform
awgBuffer = np.sin(np.linspace(0,2*math.pi,1024))
awgbufferPointer = awgBuffer.ctypes.data_as(ctypes.POINTER(ctypes.c_int16))
# 10KHz
deltaPhase = ctypes.c_int32(0)
ps.ps5000aSigGenFrequencyToPhase(chandle,10000,0,1024,ctypes.byref(deltaPhase))
status["setSigGenArbitrary"] = ps.ps5000aSetSigGenArbitrary(chandle, 0, 2000000, deltaPhase.value, deltaPhase.value, 0, 0, awgbufferPointer, 1024, 0, 0, 0, 0, 0, 0, 0, 0)
assert_pico_ok(status["setSigGenArbitrary"])
Code: Select all
wavetype = ctypes.c_int32(0)
sweepType = ctypes.c_int32(0)
triggertype = ctypes.c_int32(0)
triggerSource = ctypes.c_int32(0)
status["setSigGenBuiltInV2"] = ps.ps5000aSetSigGenBuiltInV2(chandle, 0, 2000000, wavetype, 10000, 10000, 0, 1, sweepType, 0, 0, 0, triggertype, triggerSource, 0)
assert_pico_ok(status["setSigGenBuiltInV2"])