Jump to content
  • 0

Digilent Analog Discovery 2: AnalogIn continous sampling


Pazzo

Question

Hi,

I'm trying to acquire at 1MSample/s using  WaveForms SDK (DWF Version: 3.10.9) I think that I should use acqmodeRecord mode with infinitum length so I use:

FDwfAnalogInRecordLengthSet(hdwf, 0.0);

But then in the while loop I'm a little puzzled due to the call

if(!FDwfAnalogInStatus(hdwf, true, &sts))....

Shouldn't be done only once to reach Running state? According to section "5  Analog In (Oscilloscope)" in SDK documentation the AD2 should remain in Running state...

So I change the example to do only once but I have always the same samples...any clue? Should I use other acquisition mode like ScanScreen? like reported in

 

Thank you for your help

pz

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

1 hour ago, Pazzo said:

Hi,

I'm trying to acquire at 1MSample/s using  WaveForms SDK (DWF Version: 3.10.9) I think that I should use acqmodeRecord mode with infinitum length so I use:

FDwfAnalogInRecordLengthSet(hdwf, 0.0);

But then in the while loop I'm a little puzzled due to the call

if(!FDwfAnalogInStatus(hdwf, true, &sts))....

Shouldn't be done only once to reach Running state? According to section "5  Analog In (Oscilloscope)" in SDK documentation the AD2 should remain in Running state...

So I change the example to do only once but I have always the same samples...any clue? Should I use other acquisition mode like ScanScreen? like reported in

 

Thank you for your help

pz

 

Sorry, for the noise. I found the answer in this note of FDwfAnalogInStatus(HDWF hdwf, BOOL fReadData, DwfState *psts) documentation

Note: To ensure consistency between device status and measured data, the following AnalogInStatus*functions
do not communicate with the device. These functions only return information and data from the last
FDwfAnalogInStatus call.

So it's needed to get all the information from device...
As result I test my acquisition example on a i7 using a direct usb3 connection and I can reach only 700KSample/s ..
Could anyone share an example of C code to get samples at 1MSample/s? Does anyone try to use rt patches?

Thanks!

pz

 

Link to comment
Share on other sites

Hi @Pazzo,

I have moved your thread to the Scopes & Instruments section of the forum (rather than the WaveFormsLive which is designated for OpenScope MZ and OpenLogger), where the engineer much more familiar with WaveForms SDK will be able to see and respond to your question.

Thanks,
JColvin

Link to comment
Share on other sites

Hi @Pazzo

In case the data processing or saving in your loop function takes too much time it could lead to buffer overflow (samples lost/corrupt).
You could try opening the device with 2nd configuration to have more device buffer.
# 2nd configuration for Analog Disocovery with 16k analog-in buffer
#dwf.FDwfDeviceConfigOpen(c_int(-1), c_int(1), byref(hdwf)) 

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...