09-05-2015 10:12 PM
When working with projects, there is always a need to either write or read files to disk and at times the folder nesting could be rather deep.
I am attaching a VI which i normally use for this and I also have shown two options - onw with BuildPath function and the other with Concatenate String function. Of course the earlier is the preffered one for many reasons.
The help i need is : Can this whole thing be made more simpler ? It looks rather too much code - even though it works OK.
09-05-2015 11:40 PM
Relevant options:
09-07-2015 07:54 AM - edited 09-07-2015 07:55 AM
All of your paths really should be relative to the project/executable. Then you can just use the Application Directory function to get its path, eliminating a large portion of this code (through the case structure). Then use just 1 Build Path to make your final path and then a Path To String to make your option 2 path. This eliminates another set of constants and the Concatinate String.
So I reduced your VI to this
09-07-2015 08:55 AM
I somehow forgot to mention this, even though I did mention that the bottom input takes relative paths, probably because I was focused on the separate elements:
This is more platform independent than Tim's version.
09-07-2015 10:42 AM
Great. The solution looks quite simple and neat.
I built a small project to check out the concepts and once you unzip the attachment, you will see a simple project. This works fine in design mode but has a problem in EXE mode when I use the Application Directory.
I have commented the MAIN vi with all required instructions and issue noted. So is what wrong ?
09-07-2015 11:22 AM - edited 09-07-2015 11:24 AM
Of particular interest is this document and the highlighted portion ....
09-07-2015 02:31 PM
The section you highlighted is only relevant if you build EXEs in 8.x mode, because the folder structure in EXEs is different now. I don't have time to expand now, but look up the topic of VI paths in executable and when LV includes VIs in EXEs (only if you have a static link to them or if you explicitly include them in the build).
09-07-2015 05:32 PM
Raghunathan wrote:
I built a small project to check out the concepts and once you unzip the attachment, you will see a simple project. This works fine in design mode but has a problem in EXE mode when I use the Application Directory.
The VI you gave us in your original post would have the same issue due to the extra Strip Path. So we were left to assume you were looking for files outside of your executable. But since you are looking for VIs inside of your executable, things change.
You are doing the right thing in getting the top level VI and using that for the default folder. As long as you are not using the LabVIEW 8.x executable format, the relative paths for your subVIs stay the same. The 8.x executable actually has a flat directory structure, so weird things can happen.
09-08-2015 07:04 AM
HI,
Refer my suggestion.
Use a Action engine / function global variable.
Plz find attached.
Regards,
Bijay
CLD