Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the number of samples to process per second?

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.

 

 

0 Kudos
Message 1 of 2
(2,250 Views)

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.

0 Kudos
Message 2 of 2
(2,214 Views)