I'm after a little help.

I want to be able to connect either a rotary encoder or a linear encoder to a PC. I want to use the signal and convert it on the PC to a mm size. I little like DRO but I want to intergrate into a small bit of self programmed software. My preference is to mount the module on a DIN rail but I can sort all that out. First problem is finding a module that can convert the encoder signal to the PC.

Any help would be good,
Cheers
Ant