LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File path error1

I'm getting file path error when I run my VI.  It seems that there are control characters in my filepath that are causing the error. However, I'm not sure how to fix this error. I've attached a screenshot of the error message and my VI.

I'm using the VI as a subvi in another application.

 

Thanks

Download All
0 Kudos
Message 1 of 6
(2,696 Views)

The code doesn't look like it's supposed to generate such an error, because you're starting with a valid file name. The only reason I can see for such an error is if you cancel the file selection, in which case you get Not a Path.

 

Assuming that's not the issue, can you show us the actual path?


___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(2,688 Views)

Here is the actual path below:

 

C:\Users\myname\Desktop\NHR\Burn SW\DC PM\PM VI

 

In the actual application where I used the VI as a subvi, I copied and pasted the path into a constant. I get the error message when I run the application VI. Please see attached screen shot.

 

Thanks

0 Kudos
Message 3 of 6
(2,685 Views)

I see I was missing something before. The image you posted in the first post says that the error occured when closing the file. Error 1 in general means invalid input, which in the case of the Close File function can only refer to the file reference being invalid. The most likely reason for the file reference being invalid is either that you closed it or that you never opened it.

 

You need to look at your program to see which close file primitive throws the error (I see only one, but there may be more) and where its getting the reference from. Then you need to see if that reference is valid.


___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(2,675 Views)

I think the error may be due to certain control characters present in the file path which causes an error in labview. If you look at the error message screenshot I attached, it seems to refer to certain control characters. There is a knowledge base that recommends removing these characters but it didn't work when I tried it.  see link below. Can you look at it and see if you have any suggestions on how to do it?

 

http://digital.ni.com/public.nsf/allkb/BB06ABD0261A9F2B86256F190049A620

 

Thanks

0 Kudos
Message 5 of 6
(2,655 Views)

The error message also says that the command requires GPIB controller blah blah blah, but I assume it's clear to you that that's not the issue. The error you got is error 1, which the description says quite clearly is invalid input. If you look at the message you will also see that the error was at the CLOSE file function. The only relevant input you give to the close function is the reference, so that's what you need to look at.

 

Do you know how to debug in LV? You need to place probes on the relevant wires and then run the code. Do that for the input to the close function. My guess is that you will find out that the reference was already closed somewhere.


___________________
Try to take over the world!
0 Kudos
Message 6 of 6
(2,651 Views)