Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering of Counter Inputs

Filtering Counter Inputs

 

I am attempting to count digital pulses using a NI cDAQ-9172 USB chassis and 9421 24V DI module.  I am having a problem getting erroneous (extra) counts.  I have implemented digital filtering at the slowest setting capable on the 9172 of .00256 seconds.  A screenshot of this configured input is shown below. 

 

 

Is the filter set up correctly?  Is there any way to lengthen the time base for the filter to eliminate the extra counts?  One solution I thought of, but is less desirable, is to use a DO module to output a slow square wave to act as the sample clock.  My measured signal has a pulse width of about .5 to 1 seconds.  Is there any detailed information on digital filtering, I have found some basic info scattered around the Knowledge Base (which is what I used to configure the channel as shown so far), but nothing detailed.  Thanks!

0 Kudos
Message 1 of 6
(4,568 Views)
 
 

Welcome to the discussion forums, besser!

Your configuration screenshot isn’t included. Will you try again? (Attach picture as .jpg and submit post, edit post within ~5 minutes, open the attached picture and copy its url, select the image icon and paste the url into the link field and resubmit.)

Are your input signals between 12-24 Volts? Is the NI 9421 in slot 5 or 6? The cDAQ-9172 User Guide and Specifications manual (page 12) indicates that to access counter/timer inputs, the module needs to be in slot 5 or 6 of the chassis.

I don’t know which KnowledgeBases (KBs) you’ve seen, but these are a few I’ve found to be related to your question:

How Do I Remove Glitches or Add a Debounce Filter to My Digital Signal?

 

Enabling the Digital Filters for Counter/Timer Devices in NI-DAQmx

 

 

If you want to do retriggerable pulse generation (as references in the first linked KB), there are shipping examples in LabVIEW under Help » Find Examples.

Let me know if I can be of further assistance. Have a great weekend!

 

Message Edited by Mark E on 10-26-2007 03:57 PM

Message Edited by Mark E on 10-26-2007 03:58 PM

Mark E.
Precision DC Product Support Engineer
National Instruments

0 Kudos
Message 2 of 6
(4,550 Views)

I will try attaching the image as you recommended.  Is there a way to extend the filter period past 2.56 ms, or is this the longest period I can use?

 

Message Edited by besser on 10-29-2007 12:14 PM

0 Kudos
Message 3 of 6
(4,526 Views)

Hi besser,

The cDAQ-9172 chassis (page 61) has four settings available for counter filtering: disabled, 125ns, 6.425us, or 2.56ms.

If you are experiencing multiple counts with 24V logic that is off below 5V, you probably need to clean up the signal to get reliable counting. Below are a couple of suggestions that may prove useful.

I would recommend retriggerable pulse generation if you had a counter output, as this is hardware-timed. However, if software-timed is OK, you can do a digital read and add a time delay so that the VI can only execute the read at the interval you specify.

You could also try adding an external filter that meets your time constant needs. If you have an analog input module, you could look at the signal to see your progress with different filtering.

Please repost if there is more I can do to help.

 
Mark E.
Precision DC Product Support Engineer
National Instruments

0 Kudos
Message 4 of 6
(4,496 Views)

I would prefer to not use software timing, as although my signal is slow and the loop I am executing should have no problem keeping count, it would seem this is more of a band-aid and will not be applicable in the future as my program grows or my signal speeds up. 

How would I implement the retriggerable pulse generation you mentioned?  I read the article about it, but am still not clear on the specifics.  Do I actually have to hook up a 24V output to my 24V input?  Or can I configure everything in the block diagram?  A sample diagram would be a great benefit. 

Thanks!

0 Kudos
Message 5 of 6
(4,491 Views)

Hi besser,

I apologize for not being clearer in my last post. I meant that I would’ve recommended doing retriggerable pulse generation IF you had a counter output. But, the NI 9421 only has access to the counter inputs and contains no circuitry for the counter outputs. That only leaves the two suggestions made previously:

1.       Use an external low-pass filter to clean up your signal.

2.       Use a software-timed wait to ignore debouncing for any user-specified time. There are uncertainties due to Windows, but if you have signals on the order of hundreds of milliseconds, it might be OK.

At this time, there is no module that can handle 24V logic and also contains counter outputs. If the input was a 5V signal, you could use the NI 9401 as it contains circuitry to the counter outputs. I hope this clarifies the available options you have to eliminate extra ticks.

Mark E.
Precision DC Product Support Engineer
National Instruments

0 Kudos
Message 6 of 6
(4,474 Views)