Gaurav,
When your program works in highlight execution mode but not in normal operation, it is usually an indication that the timing is too fast in your program. Try adding a wait to your loop to slow down your VI a little and see if that helps. Aside from that, I would need to know more about your code to see what is going on.
Regards,
Brett Burger