Create an Exe of a VI that controls another VI 
Author Message
 Create an Exe of a VI that controls another VI

Terry,
include the controlled VI as "Dynamic VI" when you build the
application. Dynamic VIs are included in the internal LLB of the
executable and can be opened by the Top Level VI. I see that you open
the FP of the VI then you need to change the settings of the VI to
save the front panel in the VI. By default the FP of dynamic VI is not
saved; this causes run-time errors when attempting to open FP.
If you do not want to include the VI in the application file you must
provide code to compute the path to the called VI instead of stripping
the caller VI path, which points to a VI inside the executable.


Tue, 20 Jul 2004 03:48:01 GMT  
 Create an Exe of a VI that controls another VI
Terry,

There are two issues here.

First of all, when you use "Get this VIs Path" in development, you get
a different answer than you do in runtime.  This is because the VI no
longer has a path.

Secondly, when you build the application, VIs called by VI server do
not become a part of the application.  They remain as VIs, but are
included, if you choose, in a directory that you specify, or are not
included at all.

My company uses a utility (that I created) that solves this issue.
However; you have to be careful about implementation.  The utility is
quite simple:  It stores the location of the function itself when it
is a VI, and the location of the dll when it is deployed.  You can
very easily change this function to search for an exe.

As this code belongs to my company, I cannot post it.  However, I can
help you create one if you like.  Again, it is quite simple.

Here are the instructions for you to create your own.  I have written
it in pseudocode.

"Get This VIs Path"
Strip Path
Convert Path to String
Search String for "[.]exe" or "[.]dll" if it is a dll
if Offset Past Match of Search String <=0, output stripped path
else, strip path again and output

You have to remember that for development, you have to place the
'slave' VI in the same directory as the utility that gets the path.
This is VERY important:  YOU MUST BUILD A VI THAT GETS THE PATH.  In
otherwords, the code above must be a seperate VI, that you drop in to
replace "Get This VIs Path".  You then have to remember that the path
is the same as the location of the utility that you built.  When you
build the application, the slave VI has to be in the same directory as
the .exe for this to work properly.

The ONLY other way around this is to hard code the file path.

I hope this helps



Tue, 20 Jul 2004 03:58:06 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using control reference with a Sub-vi over a TCP VI Server connection

2. Using control reference with a Sub-vi over a TCP VI Server connection

3. How do I use server to control for sub-vi from a main vi

4. Create a vi.exe file

5. create installer from exe file not a vi or llb

6. Can a VI create front panel controls?

7. How to replace or create a file using the open/create/replace.vi

8. Vi Name string for NI print panel vi - how to get dynamically for vi the print panel vi is in.

9. Unlock VI, File>>VI Properties dosn't work

10. How to stick the called vi on the same place of front panel of main VI

11. How to pause a VI with an other VI

12. Run independently a vi from another vi ????

 

 
Powered by phpBB® Forum Software