ssm Posted December 31, 2021 Share Posted December 31, 2021 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 More sharing options...
0 attila Posted January 3, 2022 Share Posted January 3, 2022 Hi @ssm Use FDwfAnalogInBufferSizeSet(hdwf, 605) Link to comment Share on other sites More sharing options...
0 ssm Posted January 4, 2022 Author Share Posted January 4, 2022 thanks a million, ssm attila 1 Link to comment Share on other sites More sharing options...
Question
ssm
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 accountSign in
Already have an account? Sign in here.
Sign In Now