LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write characters to file gives a file not found error

It appears that it generates the error at the open file sub vi, but I have no problem with write to spreadsheet file which uses the same sub vi.
Jim

LV 2020
0 Kudos
Message 1 of 3
(2,529 Views)
Sorry to answer with some questions..

Which version of LV are you using?

Does the file that you attempt to write to, exist? Do you specify a filename in your vi?

Otherwise,(in LV7) you will be prompted for a file. If it does not exist, the subvi will create it. If it exists, it will ask if you want to overwrite it.

Experiment with the "Write Character to File" vi by simply connecting a string to it... and run it.

BTW, your file must be closed when you attempt to write to it, otherwise the error is actually from Windows.

If you want to append to an existing file (add to it without deleting the original contents), then wire a TRUE to "Append to file". Of course, your file path should be filled in with an appropriate path & filename. In t
his case, you will not be prompted for a filename. However, you can experiment without providing (wiring) a path & filename, let LV prompt you.

Try this as a starting point. You should not get an error. If you still do, can you write what the error message is?

-enjoy-

JLV
Message 2 of 3
(2,529 Views)
JLV,

thanks for your interest. I found the problem while looking for the answers to your questions. We had a contractor in a couple of months ago who modified this program, and he apparently left a space at the end of a string constant that was the base path for building a filename. What a pain. Thanks again.

Jim
Jim

LV 2020
0 Kudos
Message 3 of 3
(2,529 Views)