Sir i m using PCI6025E to get voice from 8 channels continousely using half buffer ready the code is as follow:
iStatus = Timeout_Config(iDevice, lTimeout);
iRetVal = NIDAQErrorHandler(iStatus, "Timeout_Config",iIgnoreWarning);
iStatus = DAQ_Rate(dSampRate, iUnits, &iSampTB, &uSampInt);
iRetVal = NIDAQErrorHandler(iStatus, "DAQ_Rate",iIgnoreWarning);
if(!debug)
printf("\nActual bitrate : dwamptate = %f ismtb = %d usamint = %d", dSampRate, iSampTB, uSampInt);
iStatus = DAQ_DB_Config(iDevice, iDBmodeON);
iRetVal = NIDAQErrorHandler(iStatus, "DAQ_DB_Config",iIgnoreWarning);
iStatus = SCAN_Setup (iDevice, iChan, ichanVector, igainVector);
iRetVal = NIDAQErrorHandler(iStatus, "SCAN_Setup", iIgnoreWarning);
iStatus = SCAN_Start (iDevice, piBuffer, ulCount,iSampTB, uSampInt , iscanTimebase, iscanInterval);
iRetVal = NIDAQErrorHandler(iStatus, "SCAN_Start", iIgnoreWarning);
int first=second=1;
while(first)
{
//Here create file to record voice
while(second)
{
if((iStatus = DAQ_DB_HalfReady(iDevice, &iHalfReady, &iDAQstopped)) != 0)
{
//Error
}
if (iHalfReady == 1)
{
if((iStatus = DAQ_DB_Transfer(iDevice, piHalfBuffer, &ulPtsTfr, &iDAQstopped))!= 0) {
{
//Error
}
//here store the voice in the file close file break second loop
}
}
}//end second loop
Desription :
piHalfBuffer store one minute data second loop and the second loop is running continously but this is hotlooping taking cpu resources very much
but i want such mechanism that tell me after one minUte is acquird and i can get it from double buffer and can transfer to half buffer as i m checking continously
the halfready flag so i can finish the second loop.Please tell such code that only invoke callback or give indication after the one minute data is acquired in the buffer i hope u have understand my question
actaullly i m making recorder that got data from 8 channels and i want more efficiency less cpu overhead.
THANKS AJMAL(ajmal_qau@yahoo.com)
Lead Data Scientist