I agree with Labviewguru. Isolation is the best way to track down the error. First, I would try to find out why ai single scan gives an error. Is your card working properly? Do you have enough memory free? I would also check to see if ai single scan works in other programs. Next, I would strip down my code until the error goes away. When this happens, you can be reasonably sure that the last things deleted were causing the problem.
If none of this helps, consider sending an email with your program to LabVIEW email support at www.ni.com/ask
Jeremy Braden
National Instruments