NI Home > Community > NI Discussion Forums

Counter/Timer

Reply
Member
DAQduck
Posts: 4
0 Kudos

6602 buffer overflow in counting mode

Hi all,

 

I've got a problem with my 6602 timer/counter card. I am using one counter (1) to generate a fixed frequency, and another one (2) to record the time (relative to the start of the clock) for every event on a particle detector. Counter 2 is in "CI Cnt Edges" Mode, timing is set to "Sampla CLock" and "continuous samples". Data transfer is explicitly sert to DMA. The problem is that I cannot allocate sufficient buffer memory for more than 30 Million clock cycles. Means, when I set the clock to run at 10 MHz, I can acquire data for a maximum of 3 seconds. 30 seconds at 1 MHz, 60 s at 500 kHz and so on.

 

Why does this happen? I'd naively think that i shouldn't need more buffer than what's necessary for the total number of detector events accumulated during the open time (which typically amounts for an average 50 counts per second, but may peak at 1 every 10 µs over the duration of a millisecond). Even if i were actually recording every single clock count, there should be a way to increaqse the buffer size. But neither setting large values on the "Sampla clock" VI or even using "DAQmx Configure Input Buffer" has worked so far. What can I do to buffer more data than just 120 MiB (30,000,000x4 bytes)?

 

Thanks for any advice you may have

DAQduck

Member
CDreher99
Posts: 49
0 Kudos

Re: 6602 buffer overflow in counting mode

Hi DAQduck,

 

The maximum sustainable transfer rate a TIO device can achieve for a
buffered acquisition depends on the following factors:
• Amount of available bus bandwidth
• Processor speed and operating system
• Application software

 

You have to unload the Buffer in less time, please give me an explicit example how you do this.

 

Regards

Christian

Member
DAQduck
Posts: 4
0 Kudos

Re: 6602 buffer overflow in counting mode

Hi Christian,

 

thanks for taking the time to look at my problem.

 

Here is how I configure my data acquisition:

DAQ configure

Don't bother about the "sync to injection" VI, it does nothing at the time. The "6602 counter assign" VI only outputs channels and PFIs so that all my applications run with a consistent configuration. The task and error inputs are initially empty.

 

After configuration, I repeatedly execute the following code snippet in a while loop, where the taks and erros are remembered between iterations:

readout.png

The upper task/error pair is the clock, the lower pair for the counter. The wires at the bottom are from a notifier. Only the shown segment of the stacked loop accesses the tasks at all.

 

To give you an idea of the application situation: I am filling an ion trap with ions every few seconds (takes about 100µs). From the start of the filling process, I want to register the arrival times of every particle lost from the trap and arriving on a detector, relative to the start of the injection process.

 

Hope you can figure something out.

 

Cheers

DAQduck

Member
DAQduck
Posts: 4
0 Kudos

Re: 6602 buffer overflow in counting mode

I should perhaps add that the VI is running on a quad-core machine with 2 GB, 6602 card is a PCIe one. A few more VIs are running at the same time but are idle while waiting for front panel input. The problem is independent of the number of counts received, but depends only on the ratio between sample clock and open time, i.e. the VI fails with more than 30 million ticks of the sample clock, no matter at what frequency.

 

DAQduck

Member
CDreher99
Posts: 49
0 Kudos

Re: 6602 buffer overflow in counting mode

Hi DAQduck,

why is your DAQmx Read not in a While Loop, you have create a continuous measurement. On Traditional DAQ you have to allocate the Buffer size, but in DAQmx is this feature normally required not more. Please try to read the buffer filling level with the shown property nodes, I hope it is useful for monitoring.

 

Understanding and Avoiding Overwrite and Overflow Errors with NI-DAQmx

http://digital.ni.com/public.nsf/allkb/A224DA0551EEA073862574F60060AB6F?OpenDocument

 

Sincerely

Christian

 

Buffer