Optical encoder 6 wires wiring?

I mean anode to 5vdc and resistor, and cathode to the gnd?