How to interface DC encoders motor

Hi guys! I am working on a laser CNC for hobby modelling and prototyping. I have some problem to understand how to interface:
MAXON MOTORS 222524 with encoders HEDS5540
I think this should be the datasheet of my encoders
http://students.uta.edu/vn/vnh8619/05_243_e.pdf
and this is a photo of the motor:

Can someone give me some advice on this??
I think i have to connect 3 input wires in digital pins, ground and 5v, but i have no idea to read the motor position...

Om my god i think i also need a h bridge :-[

help me pleaseee

This is a rotary encoder. As the motor turns it produces pulses. To find the relative position of the motor count the pulses. It is just the same as the rotary knobs used in:-
http://www.arduino.cc/playground/Main/RotaryEncoders