10-01-2009 03:06 PM - edited 10-01-2009 03:08 PM
I created a VI that creates files while its running. It downloads files via FTP and also creates a config file if it doesnt already exist.
When I ran the VI without building it into an application everything worked fine. Now that I have built it into an application it can't create any files at all for any reason.
The odd thing is it doesn't throw any errors. The FTP part of my application recieves a list of files in a directory then runs through a for-loop using the "get file" vi from the FTP library of the internet tookit. The for loop just zips through the list of files without downloading them, but is acting like it did download them. Its supposed to wait until it downloads it or times out. Like I said though, nothing in the VI can create any files. I try to create a config file but it doesn't get created.
I am even handling the case where when I use the "current VI's path.vi" from a stand alone application it will send a path like c:/directory/myprogram.exe/currentvi.vi. I parse it down to the actual executable's directory without a hitch.
I am running XP, not vista, so its not like I need to run as administrator or something. I'm stumped. I hope I have adequately described the behavior of this problem for you guys.
Solved! Go to Solution.
10-01-2009 03:19 PM
10-01-2009 03:25 PM - edited 10-01-2009 03:27 PM
Well the user selects the directory to save the files at runtime and the FTP get file function reads this from the control, not the config file, so it's not like it's hard coded. The settings from the config file are supposed to be loaded at application startup but if there is no config file nothing is loaded to the path control and the user is prompted to select a folder.
Additionally I have verified that the config file path the program is generateing is a valid path using an indicator i will later delete.
(Running LabVIEW 2009 with application builder by the way. )
10-01-2009 03:51 PM
One place where I have had trouble with file paths being correct in the .vi, but incorrect in its .exe version, (if this indeed is your problem) is in places that I used the "current vi's path" function. You will see in the attached image, this function in a .vi returns the path and the .vi name. The function in the application returns the path, the .exe name, and then the .vi name.
Initially, I wasn't expecting this. Now, I create a ring text at the beginning of the program where I select "vi" or "exe". In all the locations that I use the "current vi's path" function, a local varibale reads whether I have "vi" or "exe" selected, and either strips the path once for vi, and twice for exe, to ensure that I always have the path I want. Just before I create the application, I change the ring text from "vi" to "exe".
Greg
10-01-2009 04:02 PM
gstanczak, I am definately handling the strange paths. I even created a special subvi called "Applications Directory" that returns the real directory where my app is running. Totally tested and confirmed.
Besides, if this was the case, then it would be able to create files that the user selects a save location for.
I appreciate your help guys. Keep em coming.
10-05-2009 08:52 AM
10-05-2009 10:37 AM
Hi Rex,
before installing any (unneeded) drivers:
Did you check all error wires? Especially in the file creation section of your program? Any messages from that?
Can you show your code (atleast a stripped-down version)? Can you replicate the problem with an example vi?
10-05-2009 02:07 PM
Solved.
It was a path problem. Somehow the subvi I had made to get the local file path was wrong so it was giving invalid file paths. That error wire was being passed into the FTP function and since an error was thrown, it wasn't executing it. Thanks for your help guys.