Hi, All,
I have an application to count the digitial pulse number. I want to know the time of the coming pulses which start from 1 and increased 4 later, like 1, 5, 9, 13..... The time interval between each pulse is not a fixed value. So I tried to use DAQmxRegisterEveryNSamplesEvent and DAQmxCreateCICountEdgesChan functions. But afterI called the DAQmxStartTask function, it always failed. The board I used is the NI-PCIe-6320. Here is part of my code.
DAQmxErrChk (DAQmxCreateTask("",&m_taskhandle));
DAQmxErrChk (DAQmxCreateCICountEdgesChan(m_taskhandle,"Dev1/ctr0","",DAQmx_Val_Rising, 0, DAQmx_Val_CountUp));
DAQmxErrChk(DAQmxRegisterEveryNSamplesEvent(m_taskhandle, DAQmx_Val_Acquired_Into_Buffer, 4, 0, EveryNSamplesCallback, this) );
DAQmxErrChk (DAQmxStartTask(m_taskhandle));
I don't know the reason. Can Anyone give me some help. Thanks.
Yang