Jump to content
  • 0

Script fuction in Waveform: directly get the ADC reading


AaronQ

Question

I'm using the Diligent Analog discovery 2, and I'd like to program it such that it will take the ADC channel 1 reading and drive my motor with PWM signal generated from the function generator. However, using Scope1.single(); is extreamly time consuming. I just need 1 output reading from the ADC, instead, it gives me 8000 points. Is there any way that I can directly get a single ADC reading?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Hi @AaronQ

With WF SDK the FDwfAnalogInStatus(hdwf, 0, 0) FDwfAnalogInStatusSample(hdwf, N, &V) return only one sample per channel.

This is not available with WF app but for low latency make sure to:
- set Trigger None
- high sample Rate (low time base)
- use only the Scope.wait() in the loop, this will perform a capture
- have the Scope interface in background to avoid CPU time on drawing
+ you could use average measurement to reduce noise in reading

image.png.c4ecfc18d82376776e696cf404827bbc.png

image.png.368ac005d3cb80e03834259ade8e0a16.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...