What causes CTRIO to sometimes get double counts or be sensitive to noise?
If the CTRIO is counting double you can bet that it is literally seeing two edges. If the input signal is differential this could happen. You should not allow an input to CTRIO to traverse both sides of ground (M). Signal quality should be checked using an oscilloscope. This would reveal whether it is due to a differentiation, or noise.