LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx period measurement- buffer is cut when frequency is too high

Hello,
I'm using the DAQmx period measurement in order to measure a low frequency pulses. Even though the average frequency is low I still sometime get two pulses that arrive within a short time . When that happens I get  an error message and the buffer is cut. I'm wondering if there is any way to ignore one of the pulses (in the case that the pulse arrives at a time that is too short for the program to read) and for the measurement to keep running until the buffer is full??
 
Thank you ,
Shafran
0 Kudos
Message 1 of 14
(3,929 Views)
I think I have run into this problem before, but I need more information. Without that, make sure you meet the Nyquist criterion and make sure that you take enough samples to capture the period of the pulse. Barring a noisy environment that should be sufficient.
-Rick
0 Kudos
Message 2 of 14
(3,911 Views)
Shafran,

The counters on your board are designed to recognize rising and falling edges so there isn't much that can be done to ignore pulses.  Depending on your hardware though, there may be a solution.  If you are using a PCI-66xx board then we could use the digital filter features to ignore brief or noisy pulses. 

Besides that, I'm curious as to the frequency of the signal you are measuring and what error code you are receiving in your program.

Thanks

Jeff Tipps
Applications Engineer
National Instruments
0 Kudos
Message 3 of 14
(3,903 Views)

Hi All-

Just to add to Jeff's post, the digital filters are also available with all M Series boards.  The settings available for minimum allowable pulse width are available in the M Series User Manual, shown here:

Hopefully this helps-

Message Edited by Tom W [DE] on 07-18-2006 03:28 PM

Tom W
National Instruments
0 Kudos
Message 4 of 14
(3,897 Views)
You might have an easier time fixing this problem in hardware than trying to do it within Labview.   A  good analog positive edge detector can be built with a resistor, a capacitor and a switching diode.  If you know the approximate frequency of the arriving pulses, you can pick an RC time constant just a little longer than the pulse width.  It should settle things down a lot.
 
eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 5 of 14
(3,891 Views)

Hi all, thanks for your help.

I'll give more details:

1. I'm using PCI-6602

2. The error code number I'm getting is:  200141       Possible reason(s):

                                                                                     Data was overwritten before it could be read by the system.

3. I'm measuring photon emission from biological samples where each photon is converted to a pulse of a 35.2 ns width. I can control the concentration of the sample and therefore the average frequency of the pulses. I have started with an average intensity of 100 kHz and I went down to 10kHz. My final goal is to run the period measurement program in loops where I decide the buffer size so each loop will take approximately 10 seconds. The problem is that even if one out of all the buffers is cut all my calculations after that are wrong. A filter sounds like the perfect solution for my problem (I need to find out more about that option).

4. I have checked the limitations of the program and I know that it can't measure pulses that arrive at a higher frequency than a few MHz, therefore I assume that even at an average frequency of 10kHz I still get some pulses that arrive within a frequency of a few MHz.

Thanks again for all your help. I hope I didn't bore you with to many details...

Shafran    

0 Kudos
Message 6 of 14
(3,883 Views)

Hi all,

I now realize that a filter will not help since all the pulses have the same width. I wonder if there is any way for the program to keep running even if some of the data was overwritten? My problem is that it stops measuring once that happens. The data that is overwritten is not significant for my experiment.

I'm sorry if I misled you about the problem, this area is new for me...

Thank you,

Shafran

0 Kudos
Message 7 of 14
(3,870 Views)
Shafran,

If all your pulses have the same duration then you are right that the digital filters will not help us.  I would not recommend that we manipulate your code to ignore buffer overflow errors.  Try moving to the 2-Ctr High Frequency or 2-Ctr Large Range mode and see if that can handle the premature pulses.  You could always ignore data in software that you don't want.  Good luck!

Jeff
0 Kudos
Message 8 of 14
(3,862 Views)
Hi Jeff,
 
I need a very specific application and the 2-Ctr High Frequency or 2-Ctr Large Range mode are not adequate. I understand the consequences of manipulating the code to ignore buffer overflow but I can't find any other option. I also can't ignore all the buffers that got cut in the middle.
How can I change the code to ignore buffer overflow?
If it doesn't work I can always change it back to the way it was.
 
Thank you for all your help,
Shafran
0 Kudos
Message 9 of 14
(3,842 Views)
Shafran,

Again I don't recommend this and it might cause more problems than it solves but here it is.  I can't predict how this is going to affect things so if it doesn't work I won't be able to support it.


0 Kudos
Message 10 of 14
(3,829 Views)