Jump to content
  • 0

Signal Cut in Custom Python App when Running Single Acquisition


Juan05

Question

Hello, I am developing a program using the Waveforms SDK in Python but I am encountering an issue with the single acquisition mode. The problem arises when choosing the buffer, as I need to add a gap, but the pulse width is variable, so I cannot select a gap that is consistently appropriate. My idea is to send multiple pulses, save the data, perform calculations, and then send another pulse. However, if the gap is too small, the signal gets cut off as shown below:

image.png.63f820e8d27ef408d2bf1813d8fafb5f.png

Where the signal I intended to send was:

image.png.6b7a0908f23e1f6884956c40b3bff37c.png

If the buffer gap is too large:

image.png.a4370a3aa033a1ecee9742a47702e2e2.png

There is too much space. As I need to send variable pulses, this can be problematic. Is there a way to synchronize the number of points sent with the number received, so as not to lengthen the signal?

Edited by Juan05
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @Juan05,

If I understand correctly, you'd like to base the size of a Scope acquisition buffer on the size of an AWG buffer that is created using a custom waveform.

Based on the SDK manual, the data passed to nodeDataSet is actually interpolated to fill the entire output buffer, rather than using a user-settable custom buffer size. This means that the wavegen frequency passed to nodeFrequencySet should effectively be in Hz and the signal period doesn't depend on the length of the list passed to the DataSet function. - If possible, you might want to use another scope to check that the pulse length is actually as long as intended.

 

So, the analog output buffer has a fixed time that it takes to play out the waveform, defined by the frequency setting. You could just tune the sample rate, number of samples, trigger level, trigger position of the analog input for this time interval.

I've attached a modified example (custom.py) that starts to do this. It generates a chain of ten pulses and uses a "tuned" triggered acquisition to capture only one of them.

Thanks,

Arthur

 

As an aside, I dropped your question into ChatGPT and asked it to explain what the code does, to see if I could get a better understanding quickly, the results are neat:

Quote

The code appears to generate a custom pulse waveform using a digital-to-analog converter (DAC) and capture the waveform using an analog-to-digital converter (ADC) in a loop. It then appends the captured data to Vin and Vout lists. The exp5_samplerate variable is the sample rate used by the DAC, and the AINfreq variable is the sampling frequency used by the ADC.

To avoid sending too many points in the waveform, the code calculates the duration of the waveform and the number of points needed based on the desired pulse width, rise time, and ADC sampling frequency. However, the code does not ensure that the number of points sent is synchronized with the number of points received. To do this, you may want to modify the code to adjust the number of points in the waveform to match the buffer size of the ADC.

 

Link to comment
Share on other sites

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...