Hy !
I'm using NI DAQ mx Driver with a pci-6509 board.
I'm able to read or write on port lines ( using change detection ), but when i do this, I use 100% of my CPU ressources !!!
This is my C++ code :
DAQmxCreateTask("",&taskHandle);
DAQmxCreateDIChan(taskHandle,"Dev1/port0/line0","",DAQmx_Val_ChanForAllLines);
DAQmxCfgChangeDetectionTiming(taskHandle,"Dev1/port0/line0","Dev1/port0/line0",DAQmx_Val_FiniteSamps,1);
DAQmxStartTask(taskHandle);
for (;;)
{
data[0] = 0;
DAQmxWaitUntilTaskDone (taskHandle, -1);
ii = DAQmxReadDigitalLines (taskHandle,1,DAQmx_Val_WaitInfinitely,DAQmx_Val_GroupByChannel,data,sizeof(data),&numRead,&bytesPerSamp,NULL);
etat = data[0];
DAQmxStopTask(taskHandle);
}
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
Is this the correct way for perform change detection, and why I use 100% of CPU time when I read line state ??
Any help would greatly be appreciated.
Thank you for your reply !
Val