LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file not created but still gives an error

I receive an "Error 1" message using "new file""

I am trying to read a new filename path from a txt file. This new filename path I use to create a new file to store data in. See attached test VI. The first time everything works fantastic but the second time the while loop executes it should create a new filename from the new file path that I give in the text file.
The error message I get is error -1 message, which occurs when the filename already exist, but it does not. First of all I have checked the directories fro double files and the second path is read in perfectly (which show while in debug mode).
I have a suspicion it has something to do with the refNum output of the "new file", but I am not sure
and I do not know how to work around that either.

Does anybody have any ideas

Kind regards,"
Download All
0 Kudos
Message 1 of 2
(2,398 Views)
Hello,

The problem comes from a formula you use to tell how many caracters you have to read in the text file. This number has to be constant (25 here). See in the image attached !

Be carefull if you want to overwrite those files later. Errors occur if files already exists using your method. You'll have to use the "file/dir info"...

Hope this helps !
Julien
0 Kudos
Message 2 of 2
(2,398 Views)