Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

help

i m using PCI6025E daq to acquire data from 8 channels using daq_rate scan_setup and scan_start DAQ apis but i have to check half ready buffer all the time in continous looping i want to avoid this and to use callback or any mechanism that can tell me that half buffer is ready after time base of one minute that i have already set early in daq api because i m getting data on time base of one minute please help with VC++ code not with labwindows
thanks ajmal
Lead Data Scientist
0 Kudos
Message 1 of 3
(3,181 Views)
Hello ajmal,

Try using a timer control or while loop to call the DAQ_Monitor function. This function returns a set number of points each time it is called, without having to wait for a half buffer to be filled. Alternatively, you could use the DAQ_DB_Transfer function which waits until the half buffer is full, then returns the data.

I hope this helps. Please reply if you have any more questions.

Regards,

Sean C.
0 Kudos
Message 2 of 3
(3,166 Views)
Sir i m sorry to understand ur reply may my questin was abgious now i clarifying by code 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
Lead Data Scientist
0 Kudos
Message 3 of 3
(3,161 Views)