From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 7 - File path - How to tell which path?

Solved!
Go to solution

Hello,

 

I've got a VI with LOTS of path references for files.  Every time I execute, I immediately get an Error 7 for file path error.  Is there any way to ascertain which path is causing the problem?  Verbose error description option?

 

I've got around 120 paths, this will take forever if I have to go through each one.

 

Thank you

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 1 of 14
(3,518 Views)
Solution
Accepted by topic author Ralph@NES

The error cluster includes a SOURCE line, which will tell you the chain of VIs leading to the one that registered the error.  That might be your first clue.

 

If you're in a subVI that is reading a lot of files, then it's up to you to debug it:

--- In case of error, pop up a dialog in that VI, and in the dialog mention the path to the file.

 

or

 

--- Set a CONDITIONAL PROBE on the ERROR output of the OPEN FILE or READ FILE or CLOSE FILE and set it to stop if error.  When it stops, look at the path you're asking for.

 

 

or 

 

--- Modify the ERROR cluster to include the file path in the SOURCE field.  It will then show up when the dialog appears.

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 14
(3,514 Views)

My quick solution would be when the error pops up toggle to your block Diagram (ctrl+E) and then thumb through there until you see the one that is blinking

 

 

Always Looking to do more with less code,

 

Mark R 

0 Kudos
Message 3 of 14
(3,512 Views)

Tried that and can't find anything blinking.  😞

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 4 of 14
(3,493 Views)

So, do you have 120 different FILE OPEN operations, or one VI called from 120 places, or what?

 

Did you try the probe?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 14
(3,486 Views)

Error code 7 means that a file wasn't found.  I would turn on highlight execution and then start your program.  Watch for where the error pops up.

 

My quick testing shows that the file path is included in the error cluster as part of the source string.  Look at that before you go too far.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 14
(3,480 Views)

Can I highlight execution and just ride it until it stops?

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 7 of 14
(3,470 Views)

I posted that before refreshing the page.  That's what I'm trying to do now.

Problem is, this code was originally written by someone else and there's poor error handling.  I'll have to dig 3, 4 subvi's deep to locate it.  Hoping highlight exectution will show me where it's stopping at least.

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 8 of 14
(3,469 Views)

I've been on highlight execution for almost half an hour now and I've gotten maybe one iteration of each loop, no error has shown yet.  Will it pop up the typical error 7 - gpib interface box when in highlight execution mode?

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 9 of 14
(3,454 Views)

If I remember correctly, if you create a file and try to access it before it is physically written - even if you closed it in LabVIEW correctly before you tried to access it - it will throw an error 7 file not found.

 

Maybe you don't see it in highlight execution mode because the file has a chance to be physically written before it gets accessed?

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 10 of 14
(3,427 Views)