mcasta Posted April 18, 2006 Report Share Posted April 18, 2006 Hi, I am working on a project for my university. My application has a couple configuration files that are constantly being changed. My file I/O seems to work perfectly until I build the application. It seems that after I build the application, it will not create any files and shows an error. It also appears to not read or even modify files. I have never used the application builder before. I have also attempted creating the build from a setup file to no avail. Do I need to change anything that has to do with permissions? Mike Quote Link to comment
Kurt Friday Posted April 18, 2006 Report Share Posted April 18, 2006 Hi Mike I think you are trying to access a file relative to your main vi using the file constant "Current Vi's Path" and then striping it back one level to get the directory that your main vi resides and then building your file path from there. This is a problem when you build your application as the path that is returned by Current Vi's Path will be for example. C:\MyApp\MyApplication.exe\Main.vi What you need to do is detect your application kind ie Runtime or Development and handle the path stripping appropriately. You will find more information on it here and here I hope this helps Quote Link to comment
torekp Posted March 10, 2007 Report Share Posted March 10, 2007 QUOTE(SciWare @ Apr 18 2006, 02:02 AM) What you need to do is detect your application kind ie Runtime or Development and handle the path stripping appropriately. You will find more information on it here and I hope this helps Thanks, that's better than what I was doing (I had been stripping in case of .exe, but I hadn't thought of .LLB). On a related note, does anybody here use the EXIT.vi found here to close executables' windows on exit? I don't use it as written (I wrote a partial-copy instead) because it assumes that only the top-level VI should be causing an exit of the executable - I guess that might be good form, but I'd rather be flexible. Quote Link to comment
Ton Plomp Posted March 10, 2007 Report Share Posted March 10, 2007 We have a VI that has the option to shutdown the PC as well, an ignore option, cancel shutdown on error and stuff... Ton Quote Link to comment
Yair Posted March 11, 2007 Report Share Posted March 11, 2007 QUOTE(torekp @ Mar 9 2007, 03:40 PM) On a related note, does anybody here use the EXIT.vi found http://forums.ni.com/ni/board/message?board.id=170&message.id=155845&requireLogin=False' target="_blank">here to close executables' windows on exit? I use it. Often, applications need to properly clean up after themselves (close communication references, etc.) and you can do that either by having a manager which will handle this and do garbage collection (usually too complicated and unnecessary) or handle it in the place which will handle the proper shutdown of the application, which would usually be the top-level VI. You should note the explanation (which is probably the main use case) - this was done because full programs are occasionally called as subVIs and if they would be allowed to do this, the application would be terminated when the user ended the subVI call. Since this is not your case, it is probably less relevant for you. As Ton mentioned, you can simply use the VI with an extra input to decide what you want to do. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.