LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program only writes one line into the csv file?

Solved!
Go to solution

For some reason the program only writes one line despite the code executing multiple times?

0 Kudos
Message 1 of 4
(2,941 Views)
Solution
Accepted by topic author crash_override

Yes.  Because you keep reopening the file within the loop which will cause it to reset the file pointer to the beginning.  It may also cause a memory leak of open file references you never close.

 

Put the File Open before the while loop.  Add File Close after the while loop.

 

Also, clean up your block diagram using the Block Diagram Cleanup button on the toolbar.

Message 2 of 4
(2,929 Views)

I did not know about that cleanup function. That is amazing, thank you very much.

0 Kudos
Message 3 of 4
(2,843 Views)
Solution
Accepted by topic author crash_override
Message 4 of 4
(2,825 Views)