Hi Rchrd,
If you're using a loop to poll your digital line, it's possible that you're not actually polling every 5 ms, since this is software timed. The speed is software/computer dependent, hence can depend on factors such as processor activity. Software timed I/O is normally used for low-speed applicatiosn that do not need hardware timed precision. You can do some troubleshooting by checking to see if there's a certain condition under which the state change is missed, and making sure you don't have other applications runing.
Hope this helps.
Thanks,
Lesley Y.