07-02-2008 09:42 AM
07-02-2008 09:48 AM
07-02-2008 09:56 AM
Here is the vi.
Thanks
Hummer
07-02-2008 10:10 AM - edited 07-02-2008 10:10 AM

07-02-2008 10:42 AM
Got it...
I fixed the error connection....moved the buttons...(doooooppp!) and ran it again...with the same error.
When you ran the vi, did it ask you for a file spec and when it wrote to the file did it write correctly...
I meant to open a new file (not appending to an old file)
Write text to the file using the write button.
Type some more text and then write again...(the write says it will add to the end of the file if the reference number is used...so that is what I ment by appending.)
Then press the close button.
We have just installed the new version on the computer so it may be a permissions thing here...
I'll check that and let you know.
Thanks for your help.
07-02-2008 10:51 AM - edited 07-02-2008 10:53 AM
The problem is your open/create/replace file VI. It needs some of its constants wired in. The default is Open, if you select a non-existent file, it creates error 7
"Error 7 occurred at Open/Create/Replace File in just%20a%20test[1].vi
Possible reason(s):
LabVIEW: File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS, and / on Linux. Verify that the path is correct using the command prompt or file explorer.
========================="
This error needs to be handled. And the double error tunnel is messing that up.
Add a constant and choose, open or create, or replace or create.

07-02-2008 10:53 AM - edited 07-02-2008 10:56 AM
Writes a string of characters or an array of strings as lines to a file. If a path is wired to the file (use dialog) input, the function opens or creates the file before writing to it and replaces any previous file contents. If a file refnum is wired to the file (use dialog) 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. Use the Set File Position function if you need to perform random access.Note that it says that if you use a file refnum it will write at the current file position. When you open the file the file position is at the beginning. Thus, the first write will be at the beginning of the file. Subsequent writes will continue where the last write ended.
07-02-2008 10:54 AM
Perfect...
Ravensfan is exactly right. I changed the open to open or create (like I have remembered to do before on other occations...but not this one...) and all works fine.
Thanks ... this makes my afternoon look very promising.
Humming along once again.
07-02-2008 12:27 PM
Here is the final version with all corrections made.
It includes writing the text that is typed ... appending a crlf to go to a new line in the text file
It then clears the text file.
AND it closes correctly.
A simple example that I appreciate very much having all the help with.
Really Hummin' now.