Hi All- 
This might be a good application for using a change detection signal event.  What type of hardware are you using?  If you are using a plugin M Series or an industrial DIO board that supports change detection you can use the example I posted here.  The only other requirements are that you use LabVIEW 8.0 (or later) and NI-DAQmx 8.0 (or later) 
Hopefully this helps-