Thanks a lot for the reply, FiloP.
The problem is that I've just read the documentation, and unfortunately I'm not enough expert in C (but I had use it!), and I fear I'm making a very stupid fault or maybe I'm mistaken completely!
In the end I will have to visualize the signals with matlab (or matcad, or with a VC program), so I decided to write the samples in a binary file.
The result was good when I read from 1 to 3 channels, but it's wired using the complete system, and now I'm in a hurry to acquire this signals...
It's a problem of parameters or I used a wrong method?
Here what I wrote of importance:
-----------------------------------------
CString campioniS;
CFile salva;
salva.Open("DatiSalvati.bin",CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
int32 error = 0;
TaskHandle taskHandle = 0;
char errBuff[2048]={'\0'};
int32 i,j;
time_t startTime;
bool32 done=0;
char chan[] = "Dev1/ai0, Dev1/ai1, Dev1/ai2, Dev1/ai3, Dev1/ai4, Dev1/ai5";
float64 min = -10.0;
float64 max = 10.0;
char clockSource[] = "OnboardClock";
uInt64 samplesPerChan = 1000;
float64 sampleRate = 5000.0;
#define bufferSize (uInt32)1000
float64 data[bufferSize*6];
int32 pointsToRead = bufferSize;
int32 pointsRead;
float64 timeout = 10.0;
int32 totalRead = 0;
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_RSE ,min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,clockSource,sampleRate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,samplesPerChan));
DAQmxErrChk (DAQmxCfgInputBuffer(taskHandle,100000));
DAQmxErrChk (DAQmxStartTask(taskHandle));
startTime = time(NULL);
while( time(NULL)<startTime+10)
{
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByScanNumber,data,bufferSize*6,&pointsRead,NULL));
totalRead += pointsRead;
campioniS.Format("%d", totalRead);
m_label.SetWindowText(campioniS);
salva.Write(data,16000);
}
salva.Close();
-----------------------------------------
Thanks for every kind of support!
Alessandro