Right now you are trying to capture a digital signal right?
First, connect the output of the comparator to a oscilloscope which can capture single pulse, thus test your comparator.
If the output is correct, connect it to NIDIO, also probe the voltage there, if the output is not correct, then the channel of that DIO might break down.
If the output is correct, it will be the problem of your software, or unluckily the NI card.