Reference: More pulse counting
More pulse counting capability
All current standard controllers now include a quadrature counting capability. This is what you need to count pulses from bidirectional incremental encoders, that is rotary encoders that have 2-channel output (normally labelled A and B). Documentation.