Here's the code back. For demonstration purposes, I removed the DAQ VIs and put a signal generation function in the place of the Analog Input. I also added a stripchart so you can see the "data".
Due to the output of the sine function, I made the limit .5 instead of 5.
You'll notice that every time it goes from less than .5 to greater than .5 the count increments by one.
Mike...