Showing results for 
Search instead for 
Did you mean: 

How can i get the true path of the dynamic VI after build application?

When I built application(APP.exe),   was included as dynamic VI. is the top-level VI of APP.exe.
In the diagram of, I used the "copy file" to copy  The source path of "copy file" is   
Current VI's Path  +  Strip Path + Build Path (name string is "") ;And the target path of "copy file" is 
Current VI's Path  + Strip Path +Strip Path + Build Path(name string is "").
And then I use vi serves to make run. In development environment, it works ok.  
But after i built application,  I always get the "error 7, Copy in"  when I try to copy the Why?   
0 Kudos
Message 1 of 6

You really shouldn't start a new thread for this. It would just cause some people to answer here and some there when there's no reason for it. Post any further replies in the other thread.

If you look at Help>>Explain Error, you will see that error 7 is "File not found". If you place indicators to see what the file paths are for the copy operation you should probably understand what the problem is. Again, why not use VI templates?

Try to take over the world!
Message 2 of 6
I sorry for that.
I already completed  the program using the copy function. and it runs ok in development environment but not in application.
I will try to use template.  But now I had the problem of using dynamic VI in build application, it will be used even though I
change  to use template.
I don't understand why the file actual exist but the error 7 still appear?
I had placed  the indicator  after  Current VI's Path  +  Strip Path + Build Path (name string is "") , and is display "../APP.exe/".  I thinked the path is right, but why i still get the error 7. 
0 Kudos
Message 3 of 6
I think that Copy File needs a "true" file as input. The dynamic vi is not a file from the point of view of the operating system.
Try opening a reference to your vi, wire the reference to an Invoke Node and use the VI Server method Save Instrument.
I've not tested this, but I think it should work.
LV 7.1, 2011, 2017, 2019, 2021
Message 4 of 6

@pincpanter wrote:
I think that Copy File needs a "true" file as input. The dynamic vi is not a file from the point of view of the operating system.

That's a very good point and appears to be the right explanation. The proposed solution would not work, however, since the RTE does not have the ability to save VIs. What will needed to be done instead is make sure that the VI is not included in the build and placing it outside of the exe. That way, the OS will see it as a real file and will be able to copy it. Obviously, the better solution would simply be working with a VIT which will let LV handle the copying. All you need to do is dynamically call and run the VIT.
A couple of other points -
You can get the calling VI's reference by using the Call Chain primitive from the Application Control palette and if you place the VI in the folder of the executable you will have to perform additional strips in an executable. You can recognize this situation by using the Application>>Kind property.

Try to take over the world!
0 Kudos
Message 5 of 6

I checked  the help document of "Save Instrument Method".  I found the  characteristics of it as following.

Available in Run-Time Engine   No

The save instrument method can't work.



0 Kudos
Message 6 of 6