At the core of a draw wire encoder is a drum mounted on bearings, onto which a wire is wound. The winding takes place via a spring-loaded device. The number of revolutions is measured by means of an encoder. If the circumference of the drum is known, then the length can be calculated from it.
Download Basics - Encoder