I am working on a C# NIDAQmx application for a hardware configuration that uses a PCIe-6321 to interface with downstream hardware. There is a DI signal from a manual switch on the downstream hardware that I must monitor for the start/stop signal for my application's data acquisition operations.
I was having inconsistent results using the ConfigureChangeDetection NIDAQmx functionality. So I used the ReadDigChan_ChangeDetection sample and using Debug.WriteLine statements have verified that when the switch on the hardware is toggled, multiple ChangeDetected events are thrown before the signal settles into the actual High or Low state.
Since I am not a hardware guru, I consulted another engineer, and was told that this is common with switches, and the signal and/or change detection needs to be "debounced".
Can this be done purely through additional configuration of the NIDAQmx DI task? I saw properties for digital filtering, but don't understand their use. I looked at the ReadDigChan_ChangeDetection_DigFilter sample, but it seems to imply that some other DI needs to be connected on the card to be used as the filter, which I don't have. Only one DI is coming from the downstream hardware.
Any help and/or advice will be greatly appreciated.