Hello,
If I understand you question correctly, you would like to be able to stop aquiring or generating data after if you essentially run out of good data. If this is the case, you can set a stop condition on your aquistion or generation by going up to your recording options in the generate or aquire steps. You can then set a conditions where if you data becomes bad or outside a certain threshold, you can then stop recording or generating those data points. I hope this answered your question.
Regards,
Brian P.
Applications Engineer
National Instruments