Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with the internal clock

so this is my third try^^


Hello,

I need to read samples with approximately constante time difference.
I found the example ContAcq-IntClk.c and changed it a little bit and it seems that it work.

But when I use a DAQmx_Val_FiniteSamps with a given count of reads than the last two values will be read to the same time!

DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));

DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",1,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps ,4));
DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,1,0,EveryNCallback,NULL));

DAQmxErrChk (DAQmxRegisterDoneEvent(taskHandle,0,DoneCallback,NULL));

E.g. the third and fourth value are read to the same time when I print also the current time in the callback function.

Is this a bug?


Best Regards

Pellaeon
0 Kudos
Message 1 of 4
(3,162 Views)
Hi Pellaeon!

I can't find anything about a bug and also can't reproduce it. I think the DAQmx is tested enought by many of coustumers that there is no bug about the last measurement value.

For a finite sample measurement you can have a look at the example called
"Acq-IntClk". For the event handling you are using you can refer the knowlagebase.

best regards
Tobias Lange

0 Kudos
Message 2 of 4
(3,140 Views)
You didn't mention what device you are using, but I'm guessing it's a 16 bit PCI device.  When using DMA, the driver transfers 32 bits of data at a time to host memory in order to most efficiently use the bus.  This means for a single channel and an event interval of 1 sample, you will always receive 2 callbacks back to back since two samples of data are being transferred at a time.  If you change the number of samples to acquire to five or acquire from two channels, you will probably observe behavior that is more in line with what you are expecting.  This behavior is the same for continuous acquisitions, but it's probably easier to observe with finite acquisitions.
0 Kudos
Message 3 of 4
(3,112 Views)
Hello,

thanks for your answers. It's an USB 6008 card
At the moment  the card is in the company in use. So I can't do any tests.
I think next week I can do further tests. Then I will check your advices.
When there are still problems after the tests I will post the code with the values.


Best regards

Pellaeon
0 Kudos
Message 4 of 4
(3,099 Views)