LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-488: Nonexistent GPIB interface, Text file opening

Solved!
Go to solution

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.

0 Kudos
Message 1 of 16
(4,853 Views)

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.

0 Kudos
Message 2 of 16
(4,833 Views)

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

0 Kudos
Message 3 of 16
(4,824 Views)

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.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 16
(4,819 Views)

@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.

 


"Should be" isn't "Is" -Jay
Message 5 of 16
(4,810 Views)

@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.  

========================
=== Engineer Ambiguously ===
========================
Message 6 of 16
(4,794 Views)

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.

0 Kudos
Message 7 of 16
(4,777 Views)

The code is not attached.

 

And you didn't tell us what error number you got.

0 Kudos
Message 8 of 16
(4,774 Views)

Error 7 Occured open file +.vi

0 Kudos
Message 9 of 16
(4,770 Views)

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:

Spoiler
You are building a path to a file called "Model_490"  but your actual file is called "Model_490.txt"  Don't forget file extensions!  Concatenate a .txt to the string that comes out of the Index Array

 

Message 10 of 16
(4,764 Views)