LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Executable Can't Create Files

Solved!
Go to solution

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.

 

 

Message Edited by rex1030 on 10-01-2009 04:08 PM
---------------------------------
[will work for kudos]
0 Kudos
Message 1 of 8
(4,296 Views)
Have you verified that your paths are correct in the built application? Paths can be different between code run in the development enviroment and a built application. The FTP VIs don't always return errors that they have encountered internally. I have found a few cases where an error is not returned. In addition some of the FTP subVIs return two errors, one specific to the FTP actions and one general LabVIEW error. Have you checked both errors?


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 8
(4,287 Views)

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. )

Message Edited by rex1030 on 10-01-2009 04:27 PM
---------------------------------
[will work for kudos]
0 Kudos
Message 3 of 8
(4,282 Views)

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

v7.1
Message 4 of 8
(4,271 Views)

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.

---------------------------------
[will work for kudos]
0 Kudos
Message 5 of 8
(4,261 Views)
I'm still having the same problem and I haven't  been able to find a solution. Is there some sort of an application builder setting that would affect this? Do I need to install the CVI drivers in the installer?
---------------------------------
[will work for kudos]
0 Kudos
Message 6 of 8
(4,217 Views)
Solution
Accepted by rex1030

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 8
(4,203 Views)

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.

---------------------------------
[will work for kudos]
0 Kudos
Message 8 of 8
(4,174 Views)