This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Enable Digital Filtering on an NI Multifunction DAQ Device

Updated Nov 2, 2022

Environment

Software

  • LabVIEW

Driver

  • NI-DAQmx

Programming Language

  • C
  • Python

Some NI Multifunction DAQ device can apply a digital filter to input signals. You can use the digital filter option available on the input lines to eliminate glitches in input data.

To enable this option and to set its parameters, you need to use a set of DAQmx channel properties
The article will cover how to access the properties in LabVIEW, C and Python®. 

Note: Digital filtering options may not be available on your NI Multifunction DAQ device. Please consult the manual for your device to see if it supports digital filtering.  

To access these properties in LabVIEW:

  1. Place a DAQmx Channel Property Node on your block diagram, located at Functions >> All Functions >> NI Measurements >> DAQmx - Data Acquisition.
  2. Expand the property node to contain 4 properties.
  3. For the first property, select Digital Input >> Digital Filter >> Enable. Wire a false to this input, which will disable the filter on all lines by default (allowing you to enable the filter only on specific lines).
  4. Select Digital Input >> Digital Filter >> Minimum Pulse Width for the second property. This is where you set the filter pulse width.
  5. For the third property, select Active Channels This will allow you to choose specific channels on which you would like to enable the filtering.
  6. Click on the fourth property box and select Digital Input >> Digital Filter >> Enable. This will enable the filter on the lines that are selected in Active Channels.

To access these properties in C:

In the C DAQmx API reference, there are two properties for digital filtering:
  • Enable
    • DAQmxSetDIDigFltrEnable(TaskHandle taskHandle, const char channel[], bool32 *data)
  • Minimum Pulse Width
    • DAQmxSetDIDigFltrMinPulseWidth(TaskHandle taskHandle, const char channel[], float64 data)


To access these properties in Python:

For using the Python API please refer to the example below:

Task = nidaqmx.Task() # Create a Task reference
config = Task.di_channels.add_di_chan('Dev1/port0/line0:7') # Add a DI channel
config.di_dig_fltr_enable = True # Enable the digital filter
config.di_dig_fltr_min_pulse_width = minimum_pw_value # Set the min pulse width value


Python® is a registered trademark of the PSF.