LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File permission error in LabVIEW, but what file?

I am in the process of smoothing out the wrinkles in a large LabVIEW program that I've converted from LV 7.0 to LV 2011SP1.  I've also moved from WinXP to Windows 7.  I get why there are file permission errors and I understand what the issues are in regard to moving from XP to 7.  What I would really like, is for the error message to tell me WHAT file is having the issue.  There are entirely too many file accesses in this program, I am not the originator, and it's been painful.  A more explicit error message, a log file, or some other cool trick to find what file is having the issue would be super.  While I'm asking for stuff, a call stack or at least the name of the VI this code calls would be wonderful, as nothing at all calls New File directly.

 

Certified LabVIEW Developer
NI-VLM Administrator
0 Kudos
Message 1 of 9
(3,095 Views)

Have you tried the Desktop Execution Trace Toolkit?

=====================
LabVIEW 2012


0 Kudos
Message 2 of 9
(3,076 Views)

I use a subVI to log errors to a file.  I treat it like an action engine.  At the beginning of the program, I initialize it with the path to where I want the log file to be.  Then I populate this subVI throughout my program in all the various loops I have running.  I use the Other Info input to put something descriptive, like "DAQ Loop"  "UI Loop"  "Master State Machine Loop".

 

This could be adapted to take information like the file path and convert it to a string to save as well.

0 Kudos
Message 3 of 9
(3,073 Views)

You can always build a VI that adds extra data to the error if there is one. Then feed the filename you are working with into the extra data.

 

You can use Call Chain.vi from the Application Control palette to give you the chain of VIs the got you where you are in the code. It "returns the chain of callers from the current VI to the top-level VI." (From the context help for Call Chain.vi).

 

Rob

0 Kudos
Message 4 of 9
(3,070 Views)

How are you currently handling the error?  The file you tried to access should be part of the string in the error cluster.


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
0 Kudos
Message 5 of 9
(3,064 Views)

The thing is there are LOTS of these file accesses, the error handling is non-existent/very bad, and I have enough problems navigating the multiple block diagrams that are 3-4 screens high by about 8 screens wide.  I didn't create this, I'm fixing it up as time permits, I just want decent error messages because navigation is super painful.  It could take weeks just to add in the error messages and that's about the timeframe I have for all the bug fixes that need to happen.

 

I will check out the toolkit suggested. 

 

Certified LabVIEW Developer
NI-VLM Administrator
0 Kudos
Message 6 of 9
(3,035 Views)

Are the files all in one directory?

 

I know when I tried accessing files on an external hard drive from Windows 7 that was recently installed on one laptop, I ran into file permission problems.

 

http://www.blogsdna.com/2159/how-to-take-ownership-grant-permissions-to-access-files-folder-in-windo...

0 Kudos
Message 7 of 9
(3,027 Views)

Possibly, but part of the problem is that the app is trying to write files under the Program Files tree, which isn't permitted for most users.  I need to change that directory, which I have in a lot of places, but there are several files and it's been hard to track them down.  I'm needing a search string.

 

Certified LabVIEW Developer
NI-VLM Administrator
0 Kudos
Message 8 of 9
(3,023 Views)

In Win7 you're not allowed to save to c:\ or Program files by default, which is a common usage in old programs.

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 9
(3,015 Views)