05-29-2019 12:24 AM - edited 05-29-2019 12:34 AM
I created the source as below...
DAQmxCreateTask("", &m_task[0]);
DAQmxCreateAIAccelChan(m_task[0], "cDAQ9189-1DD988AMod1/ai0:2, cDAQ9189-1DD988AMod2/ai0:2, cDAQ9189-1DD988AMod3/ai0:2, cDAQ9189-1DD988AMod4/ai0:2, cDAQ9189-1DD988AMod5/ai0:2", "", DAQmx_Val_PseudoDiff, 0.0, 200.0, DAQmx_Val_AccelUnit_g, 50, DAQmx_Val_mVoltsPerG, DAQmx_Val_Internal, 0.004, NULL); DAQmxCfgSampClkTiming(m_task[0], "", 100, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000); DAQmxRegisterEveryNSamplesEvent(m_task[0], DAQmx_Val_Acquired_Into_Buffer, 100, 0, EveryNCallback, this);
DAQmxStartTask(m_task[0]);
I thought there were 100 samples per second of the sample collected 100, callback sample 100, but there is not.
How do I need to implement it in code?
I want to receive only the specified number every second.
05-30-2019 02:03 AM
Hi,
I Think you are using the function incorrectly.
Look at the function which is DAQmxRegisterEveryNSamplesEvent().
you write 'EveryNCallback' in this function. but, I can find the command like this.
Refer to below link which explainsDAQmxRegisterEveryNSamplesEvent(): http://zone.ni.com/reference/en-XX/help/370471AM-01/daqmxcfunc/daqmxregistereverynsamplesevent/
And, Can you check the buffer when you receive data?
I wonder there are data in the buffer on measuring something.