12-08-2010 05:42 AM
Hello
I want to write data into a texte file. Don't ask me why, I have to use the vi "Write to text file" and not "Write to a Measurement file". Everybody do that in my office.
The point is that when I use this vi, the file is always overwritten though I want to append data into the same file. See attachement for a view of my program. Obviouly, I try to find some option in the property but none.. I sent out the vi outside the lopp but it doesn't work
Weirdly, it works fine with Labview 2009 but not Labview 2010
Anybody have an idea ?
Thanks for all
Solved! Go to Solution.
12-08-2010 05:47 AM - edited 12-08-2010 05:49 AM
This is straight from the help file for Write text file....
"To append to an existing file, set the file position to the end of the file by using the Set File Positoin function"
To look into the code working in one version of LabVIEW and not another, it would help if you posted your vi, not just a jpg.
Ian
12-08-2010 06:41 AM
_Ian_ wrote :
This is straight from the help file for Write text file....
"To append to an existing file, set the file position to the end of the file by using the Set File Positoin function"
Well I don't see that in the help file. I must say anyway that I using the French edition of Labview and it possible it's missing some things. can you tell me more because I dont catch what you meant.
My VI is attached
Thanks for all
12-08-2010 07:09 AM
See the attached - open the file, move to the end, write the text, close the file.
You can also write to the start of the file or to positions in the middle.
Ian
12-08-2010 07:10 AM
I think you need to use a refnum. I used "detailed help" from the icon on your VI and this is what it said ablout "FILE" This is in LV 10.0
file can be a refnum or absolute file path. If you wire a path to the file input, the function opens or creates the file before writing to it and replaces any previous file contents. If you wire a file refnum to the file input, writing begins at the current file position. To append to an existing file, set the file position to the end of the file by using the Set File Position function. The default is to display a file dialog box and prompt you to select a file.
Alan
12-08-2010 09:51 AM
12-08-2010 10:12 AM
I know you closed this topic I just wanted to clear up the "Fire Fox" issue. And at the same time maybe give you another way to look at the problem. The link was actually part of LabVIEW help. If you open the "show context help" window and curser over the "write to text file" ICON in your VI , then click the "show detailed help" in the window, you will see what I posted and you can then click on that link. (it's not a web link).
Any way glad your issue is solved.
Alan
12-09-2010 02:10 AM