02-17-2011 09:09 AM
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.
02-17-2011 10:12 AM
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.
02-17-2011 10:24 AM
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
02-17-2011 10:27 AM
...Also, I put an indicator and it does return the same filename and path..
02-17-2011 10:37 AM
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?
02-17-2011 12:28 PM
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.
02-17-2011 03:06 PM
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?
02-18-2011 08:23 AM
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.
02-18-2011 08:31 AM - edited 02-18-2011 08:32 AM
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.
02-18-2011 08:53 AM
Thanks Ravens Fan...
I'll make the additions to my vi. and see what's the difference..