01-14-2015 09:00 AM
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
Solved! Go to Solution.
01-14-2015 09:09 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
01-14-2015 09:11 AM
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
01-14-2015 09:39 AM
Tried that and can't find anything blinking. 😞
01-14-2015 09:44 AM
So, do you have 120 different FILE OPEN operations, or one VI called from 120 places, or what?
Did you try the probe?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
01-14-2015 09:48 AM
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.
01-14-2015 10:11 AM
Can I highlight execution and just ride it until it stops?
01-14-2015 10:12 AM
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.
01-14-2015 10:27 AM
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?
01-14-2015 05:54 PM
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?