I am trying to use GPCTR0 on a PCI-6024E. I have an encoder hooked up, with the Z index triggering the count, and the A channel as the source. I wish to count 10 pulses on the A channel and then output a pulse on GPCTROUT (I'm essentially re-locating the index for some other hardware). It seems to work fine most of the time, but sometimes the counter output inverts or just stops (stays high, sometimes stays low). It then re-triggers on the next Z pulse (re-triggerable single pulse generation).
For now, I am turning the encoder by hand to test my other hardware, so it is difficult to figure out when/why this happens. It is clear on the scope and when I restart my app, it works fine for a while, so it's not noise or
bad connections.
What can cause the counter to stop working or invert it's output? I'm looking for possibilities like: "getting a second gate pulse while it's already counting", or something similar that is to blame. Knowing this would really help me debug the problem.