LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Operation of count buffered edges.vi

actually, i had posted a similiar question some time ago, but now i had the same problem again. initally, i thought that by setting the "Buffer Size" and the "Number To Count" to the same can solve my problem. yet i'm facing the problem of my buffered data being overwritten. for example, if both are set to 1000, i can see that the buffered data being captured continuously, but eventually the final result left in the buffered data array can be just 1 or any no. of data but not 1000. It seems like an overflow of the counter or some overwriting of data but this don't always happen and sometimes the program can run smoothly with the desired result. Another suspicion is that the problem may be linked to the duration and types of signal to
be acquired.

i'm using the count buffered edges.vi to run my 6025E board.

1) Are my suspicions correct? What are the possible cause of the problem?

2) How to solve this problem? What are the precautions to take note of when using this VI?
0 Kudos
Message 1 of 2
(2,538 Views)
Lyn,

There is a great Knowledge Base article on buffers and counter operations that will specifically help with the "Count Buffered Edges.VI" example you are working with.

How are Buffers Read in Finite vs. Continuous Buffer Mode for Counter Operations?
http://digital.ni.com/public.nsf/websearch/D2C16FADED423B5486256B7B006DE3BE?OpenDocument

Your suspicions are mostly correct. I assume you are seeing an error such as -10846. This is the buffer overflow error and exists because your VI could not read from the buffer fast enough to keep up with the data that was being written to it. There are a couple of things you can do. You can increase the size of the buffer. However, this just prolongs the fact that you will eventually overflow the buffer. Now
instead of happening in a few seconds it may happen in a few minutes. You can also increase the amount of data you read from the buffer at any given time. You do not want to have the read amount and the buffer size the same amount as you indicated. The read amount should be a fraction of the buffer size. Try 1/4. The elimination of this error depends on your computer and the signal you are acquiring. If your computer is running a lot of other applications it may be some time before it gets a chance to read data out of the buffer. Additionally, if you are expecting 20 million edges a second and you have a 1000 point buffer you will have a problem. Right? So, you just have to do some experimenting. There is no strict answer to this question. There are a number of variables which you can change to get rid of the error.

Regards,
Justin Britten

Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,538 Views)