LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

'read from text file' erases the file

labveiwproblem.png

I am trying to read text in from a text file.  This is the exact code I am using.  For some reason the output from 'read from text file' contains all the text that was originally in the file, but after the code executes the file is empty.  I have several other vi's which use the same code and the file is fine.  But whenever I run this code in this one specific vi the text file gets erased.

0 Kudos
Message 1 of 3
(2,019 Views)

Ok sorry everybody. I found the problem.  At the far end of my vi I rewrite the file using open -> write -> close  My error line was connected to the front of the write function but not the open function so that open was being executed at the beginning of the vi rather than the end where I intended.

0 Kudos
Message 2 of 3
(2,013 Views)

What is in the rest of that "specific vi"? I just tried the code you show, in v2011, and it works as expected, doesn't clear file.

 

What version are you running? Can you add an error out, or make sure error output is on in your LabVIEW configuration?

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 3
(2,011 Views)