Jump to content
  • 0

Waveform SDK, output two signals of known length with known delay


lucblender

Question

I'm developing using the waveform SDK in python with the analog discovery 2.

My goal is to create two "burst" of sinus on the two channels output with a known delay between them. I cannot use a python sleep for this delay since it is quite small and just the call to the waveform SDK would talk more time than this delay.

Here is my function that should start those signals:

def start_outputs(channel=0):
    f_out = 1e3
    t_out = 1/f_out
    dwf.FDwfAnalogOutWaitSet(scope._hdwf, c_int(0), c_double(0.000))
    dwf.FDwfAnalogOutRunSet (scope._hdwf, c_int(0), c_double(t_out*5))
    dwf.FDwfAnalogOutWaitSet(scope._hdwf, c_int(1), c_double(t_out*1))
    dwf.FDwfAnalogOutRunSet (scope._hdwf, c_int(1), c_double(t_out*5))
    dwf.FDwfAnalogOutConfigure(scope._hdwf, c_int(channel), c_int(1))

If I set the channel to -1, both signals of 1kHz should start, one delayed by one period from the other and should both last 5 period.

Sadly this doesn't work, if I put the channel to 0, the channel 0 will start correctly with correct wait and set time, same for channel 1. But when I use channel -1 to run both signal, they both have the same configuration and are not delayed one to the other. What am I doing wrong?

Edited by lucblender
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...