02-13-2014 12:19 PM
I have am trying to take data and append it to a file using a for loop. If you look at the picture you would intuitively think that it would write11 lines onto the file, but it alternates between 9 and 10 lines with no apparent pattern or cause. Can anyobody explain this to me please?
02-13-2014 12:34 PM
What debugging have you tried? I would set a breakpoint after each write is complete, and then open the file after each run. Then you will know what new data was written after each of the 11 write functions execute.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-13-2014 12:39 PM - edited 02-13-2014 12:40 PM
02-13-2014 12:42 PM
You don't need to set the file position. It automatically updates the file position with each write so that you will just keep appending. The other issue is that when you don't use the File Reference Output of the Write to File, the function will close the file for you. So it is likely that LabVIEW tells Windows to close the file, but that takes time. And in that time, you just happen to be able to get more writes in. I would recommend passing the file reference out of the FOR loop (use a shift register along with the reference coming in) and explicitly using Close File after the FOR loop.
02-13-2014 12:44 PM
What's the idea behind setting the file position?
Please attach the VI instead of a picture.