01-03-2008 07:51 PM
01-06-2008 01:44 AM
01-07-2008 09:07 AM
01-07-2008 11:56 AM
Which is exactly why it jumps through "less" hoops - write once, test once and then you're done - you can use this with any VI you will ever have, on any platform, as long as NI doesn't change anything really basic, and if they do, you can probably incorporate the fix in a single place.
@djs_at_eaton wrote:
tst's method doesn't require a VI to be in the "root" folder of the program.
06-18-2008 10:53 AM
06-18-2008 11:41 AM
sture wrote:
...if it is a built application all the vi are "saved" directly under the .exe or am I wrong ?
07-28-2008 06:30 AM
07-28-2008 06:36 AM
07-28-2008 07:54 AM
07-28-2008 08:37 AM
The Current VI's Path primitive will work correctly in an executable, but it might not always work the way you expect in all places.
Currently, if the VI is built into the executable, its path is <path to EXE>\VIname.vi.
If you call it dynamically and don't add it to the build, it will be whereever you call it from.
If it's part of a class, it will be in another folder.
When you run it in LabVIEW itself, it might be in a different folder than the top level VI.
The reason I used the call chain in my example is that it always returns the path to the top level VI and so allows you to place all the code in a subVI (although this actually will not work if the VI is called dynamically).