I have a PCI 6602 board that I have set up with the following code:
GPCTR_Control (2, ND_COUNTER_0, ND_RESET);
GPCTR_Set_Application (2, ND_COUNTER_0, ND_POSITION_MSR);
GPCTR_Change_Parameter (2, ND_COUNTER_0, ND_INITIAL_COUNT, 0);
GPCTR_Control (2, ND_COUNTER_0, ND_PROGRAM);
I use the following line to read the counter periodically.
GPCTR_Watch (2, ND_COUNTER_0, ND_COUNT, &depth1_raw);
The encoder I use is a BEI that has both 20 and 1200 PPF outputs. When I connect the 20 PPR outputs to the PCI-6602 it counts up and down perfectly. However, when I connect the 1200 PPR outputs it counts up perfectly, but then doubles the cont when it counts down. (Counts down twice as fast as it counts up)..
I checked the signal phase with a scope and it looks as good as the 10PPR signal. Even when I turn the encoder very slowly, it does the same thing.
The encoder signals are labeled as follows.
Pin1 = A 20 PPR
Pin2 = B 20 PPR
Pin3 = Z 1200 PPR
Pin4 = Z+90 1200 PPR
Pin5 = PWR GND
Pin6 = +5V
Pin7 = Chassis Gnd.
Thought I would include this for reference.