USING ps3000aSetSigGenArbitrary

Having problems ? let us know the details here
Post Reply
dh33rajv
User
User
Posts: 2
Joined: Tue Mar 22, 2022 9:42 pm

USING ps3000aSetSigGenArbitrary

Post by dh33rajv »

Hi All,

I am trying to generate an arbitrary waveform using AWG inbuilt into PicoScope 3405DMSO, but have not been successful.

Code: Select all

f = open('sine.txt','r')
df=f.readlines()
wwave=np.zeros([len(df),1],dtype=np.int16)
for gg in range(0,len(df)):
    wwave[gg]=((df[gg].strip('\n')))
    
plt.plot(wwave, linewidth=2.0)

delt=ctypes.c_uint32()
sze=ctypes.c_uint32(1024)
fff=ctypes.c_double(1000)
ps.ps3000aSigGenFrequencyToPhase(chandle,fff,0,sze,ctypes.byref(delt))

offsetVoltage=ctypes.c_int32(0)
pkToPk=ctypes.c_uint32(2000000)
startDelPhase=delt

stopDelPhase=delt
DelPhaseIN=ctypes.c_uint32(0)
dwellcount=ctypes.c_uint32(0)
c_iint16=ctypes.POINTER(ctypes.c_int16)
arbtryWave=wwave.ctypes.data_as(c_iint16)
arbtryWave_size=ctypes.c_int32(1024)
sweepType=ctypes.c_int32(0)
oprts=0
indexMode=0 # 0 is PS3000A_SINGLE 1 is PS3000A_DUAL
shots=ctypes.c_uint32(1)
sweeps=ctypes.c_uint32(0)
triggertype=ctypes.c_int32(0) 
triggerSource=ctypes.c_int32(4) #PS3000A_SIGGEN_SOFT_TRIG #4
ExTrigThrs=ctypes.c_int16(0)

def set_gen():
    status["SetSigGenArbitrary"] = ps.ps3000aSetSigGenArbitrary(chandle, offsetVoltage, pkToPk, startDelPhase, stopDelPhase, DelPhaseIN, dwellcount, ctypes.byref(arbtryWave), arbtryWave_size, sweepType, oprts, indexMode, shots, sweeps, triggertype, triggerSource, ExTrigThrs)
    assert_pico_ok(status["SetSigGenArbitrary"])
    time.sleep(2)
Attachments
output
output
input
input

dh33rajv
User
User
Posts: 2
Joined: Tue Mar 22, 2022 9:42 pm

Re: USING ps3000aSetSigGenArbitrary

Post by dh33rajv »

I found the issue, I was using ctype.ref while passing the waveform as an argument to the function. I got rid of that and the AWG works fine.

Post Reply