LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build path for some reason giving "not a path"

Solved!
Go to solution

So I have a path that leads to a directory that's already created, and a string constant, and combine them with the build path function VI to return a full path, to pass to some write to file function. This is working fine, as seen in the upper half of the block diagram of this picture (with test.txt):

 

testtxtworking.PNG

 

But I want to make each file be named after the date and time, as you can see I've done in the bottom half of the above black diagram. You can see that the filename it has produced looks fairly straightforward to me.

 

Now, I try connecting the output of the bottom part to the top part, in lieu of test.txt:

 

datetxtnotworking.PNG

 

And now instead of writing to file, it pops up with a dialog window asking for me to name the file to use. I looked at the documentation for function that I'm passing my file path to (Write to spreadsheet file VI), and it says:

 

file path is the path name of the file. If file path is empty (default) or is <Not A Path>, the VI displays a dialog box from which you can select a file. Error 43 occurs if you cancel the dialog box. 

 Alright, so that's probably what's happening here, I'm guessing. But why is the Build a path function returning Not A Path?

 

If you go to the manual for Build a Path, it says:

 

name or relative path is the new path component appended to base path. If name or relative path is an empty string or an invalid path, this function sets appended path to <Not A Path>. If base path is an empty path then name or relative path must be an absolute path. This function then sets appended path to the absolute path in name or relative path. 

 Yet, it doesn't say what an invalid path is. I can't imagine why it doesn't, as that seems like really useful information for a manual to have, but alright. Googling "labview build a path invalid path" returns first the manual page I just referenced, and then this page, but all it seems to say about invalid paths is that they can't have slashes, which my example doesn't.

 

I apologize if I'm missing something obvious, but is it anywhere or are you just supposed to guess? I suppose it's possible that it's more general Labview knowledge that I'll get with more experience, but it still seems like it wouldn't hurt to just have it on the page. I tried a few obvious things like removing whitespace from my date, but no luck.

 

Thank you!

 

 

0 Kudos
Message 1 of 7
(6,305 Views)
Solution
Accepted by optoelectro

A filename cannot contain a colon ":".

 

For example, use windows explorer and try to edit a filename by inserting a ":", here's what you would see.

 

 

Message 2 of 7
(6,302 Views)

Do not use comma, colon and semicolon in a path name.

 

Ben64

0 Kudos
Message 3 of 7
(6,301 Views)

Probably a Windows limitation. Drop the colon.

EDIT: Guess I'm really slow in posting.

0 Kudos
Message 4 of 7
(6,296 Views)

Thanks, I guess I shouldn't blame Labview because it's really a Windows limitation.

0 Kudos
Message 5 of 7
(6,287 Views)

@ben64 wrote:

Do not use comma, colon and semicolon in a path name.


comma and semicolon are fine.

 

THere are some OS specifics, of course. Here is more information

0 Kudos
Message 6 of 7
(6,284 Views)

Thanks for the info.

 

Ben64

0 Kudos
Message 7 of 7
(6,281 Views)