Heidenhain used to use a 12v lamp running on 5v in read heads and encoders – they were just a dim glow, but lasted thousands of hours (20,000 hours was quoted IIRC). When a lamp failed, the read head or encoder was replaced. IIRC the lamp positon was adjusted at the factory to position it correctly behing the read head grating to optimise the signal output. As far as I can remember it was only the very high line count rotary encoders intended for direct mounting on rotary tables that had the lamp changed when they failed, but it required the encoder to be sent back to Heidenhain for repair – as these encoders cost many thousands of pounds, a repair of several hundred was cost effective. Scales were able to be repaired relatively cheaply by the end user by replacing the read head.
Have you tried cleaning the the scale grating if you only have a localised problem ? I have done this on contaminated scales that read intermittently by removing the head assembly & the sealing lips, then carefully cleaning the grating with tissues and IPA. Go easy. don't apply a lot of pressure or use sharp tools and beware the sharp edges of the glass ! With the sealing lips out you can examine the glass grating for contamination & obvious damage – the grating should look like a contiuous grey band down the length of the glass strip. Any scratches or discontinuities here would scrap the scale.
Your scale must be old to have a lamp, as Heidenhain went to Leds many years ago – maybe IR Leds, as I don't recall seeing the dim glow when looking down the length of a scale with an end cap removed on later scales. Be aware that Heidenhain counters were usually sine wave input, not square wave. Early units were 11 micro amp output, current items are 1v peak-to-peak . Various signal converters are available – I have used 5v TTL square wave to 1v peak-to-peak converters on retrofits.
Given Heidenhain repair & new part prices, it would probably be cheaper to replace the entire setup with a new Chinese counter & scales and sell on the working parts of the Heidenhain setup to recoup some of the cost. Not knocking Heidenhain in any way here – they are a very professional producer of high quality industrial equipment and their service is second to non, but their pricing reflects that and isn't exactly "home workshop friendly".
You could give them a ring on 01444 247711 and ask the Service Department for advice – they don't bite.
Nigel B