Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx with C++ | Hardware buffer size Interrupt choices

Hi,
I've got quite far with my application with the help from these forums and the help documents, but I now have a reliability question regarding the hardware buffer.
I'm using a NI-4462 with NI DAQ 8.7.1, programming in c++ with Qt 4.3.4.

From an application perspective, the larger the buffer I have, the less CPU time it takes, since all the operations that happen inbetween buffer reads (plotting, signal analysis etc.) are pretty quick with 1 large chunk of data.  With many chunks of data the performance takes a hit. So:

Firstly, how can I find out the largest buffer size I can use? (By this I mean what value can I set the Interrupt timing to?)

And secondly, is there any limitation on to what value I can make the interrupt size?  Since I cannot provide certain values.  For example, 50000 Works, 40000 doesnt. 20000 Works, 21000 doesnt.  Does it have to be some derivative of the sampling rate?  By the way, when I say it doesnt work, it seems to write the settings to the DAQ Ok (via DAQmxCfgSampClkTiming) but it doesnt work properly when I start the task.

Cheers,

Phil Winder
www.philwinder.com
0 Kudos
Message 1 of 5
(3,571 Views)
Hi Phil,

It looks like this thread is a similar query:

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

Are the questions you have posted in this thread now answered by the correspondence in the other thread linked above?

Regards,

Dan - NIUK
0 Kudos
Message 2 of 5
(3,519 Views)
Well firstly thankyou for taking the time to reply, but as you have probably noticed, that other message was started by myself and is on a completely different subject.  So no, it has not been answered.  I still have a problem where I cannot select certain sizes of interrupt calls.  But, it could be related to the problems I was having in the other post.  I havent had time to check. 
Still, the interrupt should still have worked for strange values, eg. 21674.  But now I have the error checking working better after a silly c error, so I will look into it further.

Thanks,
Phil Winder
www.philwinder.com
0 Kudos
Message 3 of 5
(3,508 Views)
By "interrupt calls", do you mean the "every N samples acquired into buffer" event?  If so, then the buffer size must be a multiple of the event interval.  That means if your buffer size was 100,000, then an event interval of 40,000 wouldn't work.
0 Kudos
Message 4 of 5
(3,495 Views)
Exactly what I wanted to know.  Thanks.

Phil
0 Kudos
Message 5 of 5
(3,489 Views)