I think you are meaning an optical switch but just in case I thought I better mention an encoder is no use to you with the parallel port as it is too slow to see the Index pulse from an encoder. If you have a SmoothStepper then an encoder is fine as long as it has the Index pulse, in the future the SmoothStepper will be capabale of syncing with a full encoder.
Having said that I think you are meaning and optical switch similar to Optek OPB916B, if that is the case then all you need to do is connect it to a spare input pin on your port and then tell Mach which pin it is you have chosen for the Index. Its as easy as that
![Smiley :)](https://www.machsupport.com/forum/Smileys/default/smiley.gif)
Well you will also need to take a 5v and 0v feed from your breakout and you will need a 220ohm resistor as well.
Hood