LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
peter

Building Executable - Vi Server Calls

Status: Declined

Problem:

 

When you want to have the organization of your files within the project file different from the folder hierarchy on disk you are not able to connect to a vi dynamically through vi server because you simply do not know the path which the builder has created within the executable.

 

To rebuild and maintain the folder structure of the disk in the project file is time consuming and error prone.

 

Solution:

 

A small tool which extracts the actual paths within the executable so you can copy the correct path to your vi-server call would do the job.

5 Comments
tst
Knight of NI Knight of NI
Knight of NI

The hierarchy of the project has nothing at all to do with where VIs will be in the EXE or where LV loads them from. The only thing that affects that is the actual path and the relative path between the calling VI and the called VI. Personally, I just use a static VI reference (from the application control palette), which forces LV to load the VI and place it in the EXE and find its correct path, like so:

 

 

If you only have a single copy of the VI in memory, you don't even need the Open VI Ref function. Just use the static ref.


___________________
Try to take over the world!
peter
Member

Thanks for the quick reply.

 

The static ref looks like a good concept that I will give a try.

 

One thing is wondering me: If the hierarchy of the project has nothing to do with the path within the exe why I had to change the project (compare project1 and project2)?

 

This does not work

Project1.png

 

when you change it like that it works. (I tried many different combinations for the path in my calling vi, none worked)

 

 

Project2.PNG

 

 

 

 

 

tst
Knight of NI Knight of NI
Knight of NI

>...If the hierarchy of the project has nothing to do with the path within the exe why I had to change the project...?

 

 

No idea. My first guess would be that the build spec wasn't set up to include the VI when it wasn't in the folder (that might have something to do with the project organization. You select VIs for dynamic inclusion based on their location in the project and I have no idea what happens if you move a VI after you selected it), but my experience with this is very limited. Like I said, if I include files inside the EXE, I set their relations statically so that I don't have to add them dynamically.


___________________
Try to take over the world!
AristosQueue (NI)
NI Employee (retired)

The organization on disk is what is used inside the EXE, not the organization in the project. This is done specifically so that relative paths continue to work. If you are loading using absolute paths, it might be that you're loading the VI that isn't inside your EXE at all. Try building your EXE and have it display the path of the VI that you're asking to load... it should be a path within the EXE file.

MaryH
Member
Status changed to: Declined