Hardware: PCI-6220
Driver: NI-DAQmx 7.3
Software: VC++ 6.0
I am using ctr0 for quadrature encoder measurements with the sample clock defined as PFI4, and ctr1 for low frequency measurements using PFI4 as the gate input (NOTE: both refer to PFI4). A square wave representing the 60 Hz line is fed into PFI4 and my expectations are that both counters will simultaneously get a reading at the line frequency. From that I can calculate velocity.
My problem is that when contactors open/close there is noise on PFI4 that I can't seem to get rid of using shielded cabling and analog filters. The result is hundreds of readings (both encoder and frequency) in a single line cycle when this happens.
From the help I have tried to implement a digital filter on the input using the following commands:
DAQmxSetDIDigFltrEnable(m_hEncHandle, "/Dev1/PFI4", TRUE);
DAQmxSetDIDigFltrMinPulseWidth(m_hEncHandle, "/Dev1/PFI4", .002);
I can't be sure this is correct, but it does not seem to be working even with times as high as .004 which is half the length of the expected on or off time. I do not have problems with the encoder counts themselves, only the sample clock.
Ed