...on the other hand, I got the _possible_ solution, since it does exist a function which let the DAQ acquire while at a certain point calls another function - which might be written by our own to post process the acquired datas...
I write what I supposed in the following to have a feedback and see if I am right or not....
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main()
{
...
while(1)
{
if(_kbhit()){break;} // to stop the task when I want and go on...
...
DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,1000,0,EveryNCallback,NULL);
}
...
}
...
int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
{
int32 error=0;
char errBuff[2048]={'\0'};
static int totalRead=0;
int32 read=0;
float64 data[1000];
/*********************************************/
// DAQmx Read Code
/*********************************************/
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,1000,10.0,DAQmx_Val_GroupByScanNumber,data,1000,&read,NULL));
if( read>0 ) {
printf("Acquired %d samples. Total %d\r",read,totalRead+=read);
fflush(stdout);
}
////////////////////////////////////******************************************//////////////////////////////////////////////////
// HERE I THINK I SHOULD DO MY ELABORATIONS WITH THE ACQUIRED DATAS
////////////////////////////////////******************************************//////////////////////////////////////////////////
Error:
if( DAQmxFailed(error) ) {
DAQmxGetExtendedErrorInfo(errBuff,2048);
/*********************************************/
// DAQmx Stop Code
/*********************************************/
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
printf("DAQmx Error: %s\n",errBuff);
}
return 0;
}
...
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
However, I have tried with the example "ContAcq-IntClk.c" , but it doesn't work because the compiler seems not to find these two functions - both of which should be declared in "NIDAQmx.h" and defined in "NIDAQmx.lib", isn't it?
1>------ Build started: Project: VC_ContAcqSamps_IntClk, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>c:\documents and settings\admin\desktop\ppp\main.cpp(65) : error C3861: 'DAQmxRegisterEveryNSamplesEvent': identifier not found
1>c:\documents and settings\admin\desktop\ppp\main.cpp(66) : error C3861: 'DAQmxRegisterDoneEvent': identifier not found
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 9.00.21022
1>Copyright (C) Microsoft Corporation. All rights reserved.
What do I do, now? I have totally lost the way...
Just to summerize whereas I didn't fit my problem:
I have 2 channels to acquire and make something with these signals ( like 2 filters, give them to a Neuro-Fuzzy kernel, take the output and send it to serial data), contineusly. I am using NI USB 6251 - which should mean to use only "NIDAQmx.h", am I right? .
THanks in advance to anybody will help me.