LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically load a vi (source code) from an exe

Thanks for the info.

Unfortunetly both options you suggested are not ideal.
i) To specify a search path is a good idea but the user must have labview installed on the computer for the vi.lib directory to exist. I'm trying to create a run-time only version.
ii) I am trying to make the tests as easy to build as possible as there will be many users creating tests that are new to Labview so I want to provide an easy experience. I don't want to have to include the required vi.lib files in a library because the automated process for creating a development library will pull code out of my test shell program as well.

Is there any way to include the vi.lib directory in the exe (I know this will make the exe huge but I think that is the least severe of the other options)? Can I specify a relative path in the exe.ini file? I'd like to specify the path of the vi.lib directory relative to the exe file.

Thanks,
James
0 Kudos
Message 11 of 14
(1,168 Views)
Hi James,

There's not an easy way to encapsulate vi.lib into the executable (unless you want to include each vi manually from the source files tab). Secondly, I'm not really sure what you mean by "automated process for creating a development library will pull code out of my test shell program as well."

I recently made a KB on this, which isn't live just yet, but is attached below. I would suggest following one of the 4 methods described in the KB. I know that this isn't exactly what you want, but it really is the best way. I would suggest Method 2, as it does not require much more thought than a simple File->save.

Does this help?
Travis H.
LabVIEW R&D
National Instruments
0 Kudos
Message 12 of 14
(1,150 Views)

Just a comment for those adding a "viSearchPath" to an executable ini file:

If you have a VI which you are calling from an executable, which has sub-vi's in another directory, specifying the sub-vi's directory in the exe ini file works most of the time BUT NOT ALL. I had a situation where I had a directory for the VI I was dynamically calling, and a directory for some of it's sub-vi's.  I specified the sub-vi's directory as a search path which should work fine, but does not in all cases.  It can break if the sub-vi has a sub-vi that is back in the directory of the top level VI.  This confused me for a while but found a solution.  Just add the following as additional search paths: "<topvi>:\*;<foundvi>:\". I wanted to share this is it is probably good practice to include these search paths in an exe ini file.

 

e.g.

viSearchPath="<topvi>:\*;<foundvi>:\;C:\Test Program\*"

0 Kudos
Message 13 of 14
(1,026 Views)

It's not working on my system: the application builder just builds the application with the copy of the referenced VI, and does not perfor the call dynamically.

Am I missing something?

Is there a tutorial on dynamic VI calls? I'm not able to find a "getting started" guide on this subject...

Thanks

0 Kudos
Message 14 of 14
(734 Views)