Please allow me to correct you about motor port wiring. In fact the motors are not operated by Tacho0 and Tacho1 pins, but by rather by MA0 and MA1.
PIN1 MA0, PWM output signal to motor or actuator
PIN2 MA1, PWM output signal to motor or actuator
PIN3 GND, Power ground for rotary encoder
PIN4 PWR, 4.3 volts to rotary encoder supply
PIN5 TAC0, Tacho 0 signal output back to NXT
PIN6 TAC1, Tacho 1 signal output back to NXT
How it works:
NXT sends time proportioned pulses to MA0 and MA1 to energize the motor to turn one way or the other.
When the motor turns by it self, or when it is wound by hand, the encoder turns and the wheel with slits (like those found in old ball drives computer mouse, see link here after) brakes 2 lights paths, each wired to TAC0 and TAC1.
This produces 2 pulse trains that are 90 degrees off phase. When TAC0 leads TAC1, you get to increase the tacho count. When TAC1 leads TAC0, you get to decrease the tacho count.
Hope this helps!