LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 7 occurred when trying to read a spreadsheet file in LabVIEW

Hi,

 

I got the message (in bold) below when I was trying to read a text file type. I also include a snippet of my block diagram.

 


Error 7 occurred at Open File+.vi:Open File

Possible reason(s):
 
LabVIEW:  File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS X, and / on Linux. Verify that the path is correct using the command prompt or file explorer.

 

 

I really appreciate if someone can help me. Thanks.

 


0 Kudos
Message 1 of 10
(5,298 Views)

Do the files exist?

 

Put an indicator or probe on your path wires going into the Spreasheet file functions to see what path they are getting.  It is probably just a filename that would show up.  Are those files in the location that LabVIEW would expect them to be, which is probably either the directory the .VI is in, or possible the current working directory?  You may need to specify more of the path to the files in order for the spreadsheet functions to find them.

0 Kudos
Message 2 of 10
(5,287 Views)

 

Dear Ravens Fan,

 

Thanks for your reply.

 

I'm not sure if I get what you mean..but the file does exist. I simply type the exact path and file names in the Filename to Read control (on the Front Panel, the terminal at the far left in pink in the block diagram), because if I leave it empty, another error message will show up:

 

LabVIEW:  The path is empty or relative. You must use an absolute path.

 

 

this is how I type the filename and its path

 

c:\LabVIEW_Data\router_test#

 

 

Thanks

 

 

0 Kudos
Message 3 of 10
(5,279 Views)

...Also, I put an indicator and it does return the same filename and path..

0 Kudos
Message 4 of 10
(5,277 Views)

Replace your string manipulation functions with a path control.  Enter your path in there and see if it works.

 

If it works, do a path to string on that and compare the resulting to string to the string that results from your current method of string manipulation. Perhaps there is an error in your string constant such as non-printable character that is not showing up.

 

Also, is it possible that you have the file opened up in another program such as Excel that is putting a lock on the file?

0 Kudos
Message 5 of 10
(5,271 Views)

 

Dear Ravens Fan,

 

When you said "replace string manipulation functions", are you referring to the Format Into String vi (found next to the filename at far left of the block diagram)?

 

I attached the full view of the block diagram so that you can see the complete program.

 

Thanks.

 

 

 

0 Kudos
Message 6 of 10
(5,260 Views)

Yes.  And/or the functions where you concatenate on a file extension and then convert to a path.

 

Does the error always occur with just one of the Read spreadsheet functions?  Or does more than one have a problem?

0 Kudos
Message 7 of 10
(5,249 Views)

Hi Ravens Fan,

 

Thanks again for your valuable input. I replaced the string manipulation functions with a path control. I think it works coz I can see the waveform data, rms values etc. And then you said if it works, do a Path to String on that...and I'm not exactly sure how to do that. I attached a snippet of the modified vi. you may refer the original vi snippet in my previous email.

 

I appreciate it if you could help me again.

 

Thanks.

0 Kudos
Message 8 of 10
(5,219 Views)

Like this.

 

Now that you know you can get things to work, you need to figure out what is different between the way you were doing it before and the way you are doing it now.

Turn on \codes display on the string indicators so that if there is some extra character in there you can't see, you'll see it.

 

Message 9 of 10
(5,213 Views)

Thanks Ravens Fan...

 

I'll make the additions to my vi. and see what's the difference..

0 Kudos
Message 10 of 10
(5,202 Views)