LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to write to a file that uses the current date as a portion of the path

I would like to write to a data file that changes the path when the date changes. I am using the build path VI with the get date/time VI with the "/"'s removed from the string. I've tried using .txt in the pattern input and adding it in with the concatenate string VI. Either way I receive Error 7 File not found. Ifanyone has any thoughts on hoew to accomplish this I'd appreciate it. Thanks
0 Kudos
Message 1 of 4
(2,874 Views)
I suppose you are using open/create/replace vi, so you need two thing, set function to create or replace (create if you wire a new path, replace if it's still the same) and don't wire pattern (only valuable for dialog) but have the extension in the build `path vi.
Hope this helps
0 Kudos
Message 2 of 4
(2,874 Views)
There was an extensive thread on this not so long ago. You might want to do a search to see the discussion of all the issues and I believe there was some example code. Regarding your immediate problem, at the end of the 24 hour period, you have to close the existing file and then open a new file before you can start writing to it. Make sure that the refnum to the write function is updated to reflect the new file.
0 Kudos
Message 3 of 4
(2,874 Views)
You have to check if the VI that create the file is setted to "create" or to "append" caracters on the file. I receive this error message when i am trying to use the "Write caracters to file.vi" and it was setted to append. You should use an converter to change the name of the file from String to Path. And you have to use a loop structure to check the date and append caracters on the file everytime is needed.

Regards,
Carlos
0 Kudos
Message 4 of 4
(2,874 Views)