k0ewl Posted September 14, 2005 Report Share Posted September 14, 2005 Hi there, I'm all new to the labView programming "language" and i have a problem. For my internship I'm creating a program and I'm having a problem creating files and folders. When I run the program from the labView programming enviroment it creates the files and folders perfectly. I compiled the program with the Application Builder and i ran it again. Then it says that it cant find the specified file and/or folder. It does that because it cant create it, but i dont know why. Is someone familiar with this problem and can you please help me? Quote Link to comment
Jeffrey Habets Posted September 14, 2005 Report Share Posted September 14, 2005 When I run the program from the labView programming enviroment it creates the files and folders perfectly.I compiled the program with the Application Builder and i ran it again. Then it says that it cant find the specified file and/or folder. It does that because it cant create it, but i dont know why. You are probably using the Current VI's Path constant to build a path to the file or folder you want to create. This constant's value is actually not so constant in that it is different in a build executable. Say your VI is normally located in c:\app\main.vi and you build an exe in c:\app\build\main.exe. In the first case, the constant's value will be c:\app\main.vi in the second case it will be c:\app\build\main.exe\main.vi So in the case of an executable you'll need to strip of one more path element to find the application directory. If you have the OpenG libs installed, you can use the Current VI's Parent Directory VI instead of the Current VI's Path constant. It will figure out if it's running from an exe or dev.environment automatically for you. Or you can do it yourself by looking at the Application.Kind property. Quote Link to comment
m3nth Posted September 14, 2005 Author Report Share Posted September 14, 2005 With the above advice in mind, if you just do things the way you normally do them, but use an llb to contain all your files and the top-level VI it will work right also (since an .exe is just a renamed .llb with the PE header and all that). 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.