Quote Originally Posted by antsals View Post
I want to be able to connect either a rotary encoder or a linear encoder to a PC.
Which one - linear or rotary? Different animals and different problems. The output from a rotary encoder will give you an angular not a linear measurement - the angular measurement being a proportion of a revolution.

If the encoder is attached to a leadscrew, it's easy as one revolution moves one leadscrew pitch. Any other way, you need to convert linear motion into rotary (e.g. rack and pinion).

Quote Originally Posted by antsals View Post
I want to use the signal and convert it on the PC to a mm size.
How do you intend to get the signal into the PC? Serial port, parallel port, USB, ESP? What operating system? Can you do the programming at the PC end?

Most rotary encoders give a quadrature signal. The higher end linear encoders have a similar signal. This signal is easy to decode using a microcontroller (e.g. AVR, PIC, Arduino) to count pulses (either very fast by polling or interrupt-driven). The controller can then send to the PC using a standard communications protocol.

Cheaper linear encoders (i.e. Chinese scales) have a different protocol, but it has been documented in many places. Search for YADRO or Schumatech.