Hardware: PCI-6220 Software: C++ 6.0 Driver: NI-DAQmx 7.3
This is a typical function call to get an encoder reading that is sampled on a 60Hz clock: lStatus = DAQmxReadCounterF64(m_hEncHandle, 1, 0.25, dEncData, BUFFER_SIZE, &lEncPtsRead, NULL);
No problem getting the data. But while it is waiting for the 60Hz clock I get almost 100% processor utilization. My expectation of how this should work - my thread calls this function and it blocks releasing the processor to perform other functions until a sample clock event or .25 seconds expires (error condition). Any idea why the processor is being hogged at this point and is this the way it should act?
What you are seeing is a known feature of NI-DAQmx. DAQmx uses all available processor power to ensure that you get the BEST data acquisition performance. However, the DAQmx driver was written so that if ANY other application requests to use the processor, DAQmx will release it to the other program. This way DAQmx uses all of the processor unless something else needs it.