Looks like a rare time for Sequence structures in a continuous while loop (count up, count down, & repeat. 1/50 of a second is 20 msec, so I added that time delay for each count - its accuracy will be dependent on your computer clock, but should be within a usec. See if the attached helps, good luck with it, Doug