I too, am using linear encoders with a counter card. When error such as yours occurs, your should list all possible causes. In using linear encoders, mechanical play should be checked first. linear encoders, require no mechanical play in all directions, including 90 deg. to the direction of measurement. Next, I would check that you are not measuring this 7mm distance at a rate that exceeds your card input frequency, and your application program. You should also, If you have not done this yet, add a timer to you program that polls your card at a rate similar to your maximum desired needs. Another possible cause could be line noise, in your connections. Make sure your cables are properly sheided, and grounded, and not located near strong electrical magnet fields. You can also change your encoding level to a lower level i.e. X4 to X2.
Good luck!