How do I get a position from an encoder?
How do I get the distance multiplier?


You measure or calculate how far your device will go for e.g. one full rotation, e.g. in cm. Then you take that length and divide it by the number of pulses per revolution the encoder delivers and you got your distance multiplier in cm/pulse.


  How do I get initial position?


The encoder itself can only tell you the rotation angle relative to the "index" position. If the motor can do more than a single rotation in either direction there is no way the encoder alone could tell you the absolute position after power on.

A common solution is to have a limit switch, either mechanical, inductive, or optical (IR), at one end of the rail. Upon power up, the controller drives the motor toward the end of the rail with the limit switch until the switch detects arrival at the end. This is then the "0" position and any movement/rotation of the motor is measured via the encoder relative to that fixed position.