Dear all,
I am trying to count digital pulses generated by a volumetric gas counter using a counter input of my PCIe-6323 card. Unfortunately, there are multiple noise sources in the environment and I have issues with voltage spikes that are interpreted as digital pulses by the counter input. I already improved my setup by using shielded cable and in minimizing its length. However, the measurement quality is still suboptimal and I would like to implement a digital filter with a minimal pulse width threshold setting.
For diverse reasons, I use VB.Net instead of Labview to develop this application. I used the example "CountDigEvents" (see attachment) provided by NI with the card software as a basis, then I modified it to read the count every minute. Finally I tried to enable the digital filter :
counter_task0 = New Task()
counter_task0.CIChannels.CreateCountEdgesChannel("Dev2/ctr0", "Count Edges", CICountEdgesActiveEdge.Rising, 0, CICountEdgesCountDirection.Up)
counter_task0.Timing.DigitalFilterEnable = True
Unfortunately, I receive the following error : "The specified property is not supported by the device or is not applicable to the task."
I dont understand why I get this error since the PFIs of the card are supposed to have filtering feature :
Digital line filter settings | 160 ns, 10.24 μs, 5.12 ms, disable |
Could somebody advise me on the best approach to achieve my objective ? Actually, I wonder if digital filtering is possible with single point edge counting and if I would not try another method (For example : https://forums.ni.com/t5/Example-Code/Enabling-Digital-Filtering-Using-Dummy-Counter/ta-p/3526254). In this case, I would appreciate if someone could help me with some VB.NET code example (not Labview). Indeed, I couldn't find anything useful in the examples provided by NI.
Thank you in advance and all the best 🙂
Sébastien