05-27-2011 09:48 AM
I have a largish project in LV 2010 in XP and W7. It's all in a project, as I build the main VI into an .exe. There are numerous other top-level VI's that are called dynamically. I use source code distributions to build them with their diagrams removed. The .exe then calls them from a directory similar to "C:\DMT\My Project\Utilities". (I never did find a good utility for discovering user directories across XP, W7, etc., so we ended up right in C: for config files and support files, stuff that often used to get put in with the .exe in XP and earlier OS's.)
Besides the top-level VI's, I also have a set of VI's that can be called dynamically to do custom calculations. The interface to each VI is simple and defined, so users with LV can create their own calculations, put their VI (and sub-vis) in "C:\DMT\My Project\Calculations", and my program can make a call to it.
My problem is in how the project handles these VIs. I need to include them in the project, since I need source code distribution builds to assemble a directory of the VI and all its dependencies. So the actual source is in one place (under SVN), then I build them to another location, which I then deploy to "C:\DMT\My Project\Calculations". The problem is, if I run the main program from within the project (rather than as an .exe), it links up to these calculations in "C:\DMT\My Project\Calculations" and then the project has conflicts. The Calculation VI's in the project are now trying to point to "C:\DMT\My Project\Calculations" (which isn't in SVN) instead of to the true source code. Every time I run the program from the project, I have to remember to go and manually fix the project.
Sorry if that's a bit complex to describe. But does anyone have suggestions on an alternate architecture that would eliminate this issue?
Thanks,
DaveT
Solved! Go to Solution.
05-27-2011 09:59 AM
A simple solution would be to detect if you're running the exe or the vi (app.kind property).
When running in development version call the dynamic VIs from the svn directory (usually a relative directory to the main VI), when running the exe call the VIs from the distribution directory.
05-27-2011 10:01 AM
Thanks! I'll try that. (Wondering why I didn't think of that...)
05-27-2011 04:04 PM
That worked. Thanks again for the idea.
DaveT
05-27-2011 04:55 PM
Great! Thanks for reporting back.