LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with the internal clock

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?


Regards

Pellaeon
0 Kudos
Message 1 of 5
(2,775 Views)
*push*
0 Kudos
Message 2 of 5
(2,714 Views)
You would have a better chance of getting an answer if you posted to the multifunction DAQ instead of the LabVIEW one.
0 Kudos
Message 3 of 5
(2,710 Views)
Hi Pallaeon,

I modified the example "ContAcq-IntClk" to aquire NSamples and got no values doubled (See screenshot "NSamples"). The thing to consider is that you have to choose a buffer size multiple to the  requested callback size.  See the following post to that topic:

http://forums.ni.com/ni/board/message?board.id=250&message.id=29175&requireLogin=False

To aquire NSamples should be possible with your setting when you just create the task, set the buffer size and read once the Samples out of buffer. You don't need further callback functions for that.

I double-checked the possibillity to acquire 4 samples with the sampling rate "1" in MAX Testpanel, I didn't get any values double (Screenshot Testpanel).

Hope that helps for further working with your Hardware successfully,

regards,

Nikolai
0 Kudos
Message 4 of 5
(2,677 Views)
Sorry,

here my results...

Nikolai
Download All
0 Kudos
Message 5 of 5
(2,674 Views)