08-28-2018 06:07 AM
Hello Community!
I could able to open a specific text file by selecting a path after i run the vi.
The same vi can not able to open pro-grammatically. Can someone out there help me with this.
I have declared this path as global variable.
Solved! Go to Solution.
08-28-2018 07:20 AM
Exactly what error message did you get? Error number?
The part about NI-488 is an alternative error and wouldn't apply in your case. It happens that some of the simple error numbers are shared by LabVIEW and other things like GPIB, so LabVIEW will give a message related to both of them and leaves it up to you decided which is more appropriate. I removed that second error from the subject title since it doesn't apply here.
Are you sure you have a path in the global variable? Are you sure the file is not open somewhere else?
Without any details on the error, or seeing any actual code, we can only guess at what the solution might be for you.
I see you are new to the forums. When posting a question, it is helpful to post as much detail as you can, and especially helpful to post a VI so we can see your code and can point out where the problem might be.
08-28-2018 08:02 AM
You clearly have an error in your LabVIEW code. Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters (such as yourself) fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it.
Please attach the VI (or compress the Project Folder and attach the entire Project's .zip file, telling us the VI that causes the error). Please do not attach only a picture of part of the Block Diagram -- it is not nearly as helpful (or readable!) as the actual .VI file.
Bob Schor
08-28-2018 09:16 AM
I used to get confused about these multiple error messages, too. If you look at the error details, there's almost always enough information there to help you decide which error condition applies. This error 7 is obviously the non-existent file error condition. The file you're looking for doesn't exist. It could be because you're looking in the wrong place, you made a mistake somewhere in the path (not uncommon for a first crack at finding a file by concatenating strings to make the filename), or there is a race condition where the file is created after you look for it. (It could also be that file file was just created but still open, so it is in the file cache, but not physically on the disk, yet. I know this threw an error 7 in early versions of LabVIEW; not sure if it still applies.)
08-28-2018 09:32 AM
@suma_n wrote:
Hello Community!
I could able to open a specific text file by selecting a path after i run the vi.
The same vi can not able to open pro-grammatically. Can someone out there help me with this.
I have declared this path as global variable.
Bob Wrote:
You clearly have an error in your LabVIEW code. Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters (such as yourself) fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it.
_________________________________________________________
Time and Time Again I offer examples to follow in mastering this valuable skill....................
The file is already open! you get the error because you cannot open an open file. Close the file then open it.
08-28-2018 01:19 PM
@JÞB wrote:You clearly have an error in your LabVIEW code. Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters (such as yourself) fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it.
That is awesome, I am going to make that my sig line, with appropriate credit of course.
08-28-2018 11:00 PM - edited 08-28-2018 11:01 PM
Attention All,
I am extremely sorry for not providing enough details.
Here i have attached the code. Please run the main vi, it will be directed to model selection screen from there path will be loaded to global variable. Data inside the path should be loaded to my Auto screen.
Hope this info sufficient to debug, do let me know if other info is required.
Thank you.
08-28-2018 11:10 PM - edited 08-28-2018 11:11 PM
The code is not attached.
And you didn't tell us what error number you got.
08-28-2018 11:16 PM
Error 7 Occured open file +.vi
08-28-2018 11:43 PM - edited 08-28-2018 11:55 PM
First let me make a couple comments about the code.
In variant select.vi, You should put the OK and Cancel buttons in their respective event structures. Get rid of the case structures outside the while loop that don't do anything. And there is no reason to use the Request Deallocation function, so get rid of that.
In Auto Load, do you really want a while loop to continually open the same file 10 times per second?
I don't see any issues with the use of the global variables, other than I don't know why you need them. Why not put the path as a connector on both subVI's?
Have you tried debugging tools such as probes and highlight execution to see what the is and that it is generated correctly in one subVI and goes through to the other?
The AT Strip&Build Path subVI was missing, so I can't tell what is going on in there.
Open File+ is built into the Read Delimited File subVI. Error 7 is "File not Found". Are you sure the file you are looking for actually exists?
After I cleaned up your code to eliminate missing subVI's, I discovered this: