Jump to content
  • 0

using AnalogIn for data acquisition


ssm

Question

Dear Help,

I have AD2, using WaveGen and Scope, programmed using the SDK libraries under Ubuntu.

I am reading data using the following code:

for(int iTrigger = 0; iTrigger < EXP->NoAcquisitions; iTrigger++){

                printf("Iteration Number = %d \n",iTrigger);

                // begin acquisition

                FDwfAnalogInConfigure(hdwf, false, true);

                FDwfAnalogOutConfigure(hdwf, 0, true);

                while(true){

                    FDwfAnalogInStatus(hdwf, true, &sts);

                        if(sts == DwfStateDone) {

                            break;

                        }

                }

                FDwfAnalogInConfigure(hdwf, false, false);

                FDwfAnalogOutConfigure(hdwf, 0, false);

                // acquisition done, samples should be taken from the buffer

                // get the samples for two channels

                FDwfAnalogInStatusData(hdwf, 0, EXP->ScopeC0Samples, AD2ScopeBufferSize);

                FDwfAnalogInStatusData(hdwf, 1, EXP->ScopeC1Samples, AD2ScopeBufferSize);

                // doing some work on the collected data

            }

Now the size of the scope buffer is configured to be 8192, but I only need to read 605 samples, reading all 8192 samples is taking time, is there a way to stop at the specific number of samples and read them?

thank you,

ssm

            

 

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