LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

vi server and runtime engine

My VI uses the VI server to open and run VI in the background while maintain control in the main VI, and now I want to create an executable file of this VI. I am running into problem because when you use VI server to open VI's, you have to put in a path name. But now that this VI is executable on another machine, this machine doesn't have the original VI. So now it cannot open the VI. Is there a way to get around this somehow?
0 Kudos
Message 1 of 5
(3,153 Views)
Is your problem one or more of these:

1. Sub-vi is not physically on the destination computer.
To force the App Builder to include the file, use Add Dynamic VI... under
the Source Files tab. Or you could force inclusion by placing the sub-vi in
a non-executing section of your main vi. Dynamic vi's use to be placed in a
Data sub-directory. I don't know if they still are in LV7. Including the
sub-vi in the main vi means the sub-vi will be in the compilation llb of the
..exe. You could also, of course, just copy the vi to the destination
computer to make sure it makes the trip.

2. Front panel is not available to open when the vi is called.
Edit the build settings under the VI Settings tab of the App Builder. Make
sure Remove Panel is No for your dynamic sub-vi
's. LV run-time doesn't like
to open front panels unless they have been registered for inclusion in the
..exe.

3. Path to the VI server is wrong.
If you are creating the path based up the path of the main vi, it is
different in an .exe. Instead of something like c:\my project\my main.vi
it's something like c:\my project\my main.exe\my main.vi. So you have to
use strip path twice for .exe's. You can tell if LV is running in a
development system or in a run-time system by checking the App.Kind property
node.

"analog" wrote in message
news:5065000000080000008EB20000-1068850981000@exchange.ni.com...
> My VI uses the VI server to open and run VI in the background while
> maintain control in the main VI, and now I want to create an
> executable file of this VI. I am running into problem because when
> you use VI server to open VI's, you have to put in a path name. But
> now that this VI is executable on another machine, this machine
> doesn't have the original VI. So n
ow it cannot open the VI. Is there
> a way to get around this somehow?
Message 2 of 5
(3,153 Views)
So if I want to run my sub-VI using the VI server in my application, do I have to do both #1 and #3 in your answer. Because the original vi's are not stored in the computer that I am using to run the application, if we use the path, doesn't the server get confused because that original VI is stored on another computer's C drive.
Can you explain #3 a little bit more. Also, if my sub-VI's path is C:\subVI A.vi, how would I name that path in an exe?
0 Kudos
Message 3 of 5
(3,153 Views)
Hi,

Please read the following KB that talks in more detail about #3.
Current VI's Path Function

Also, look at the attachment in the KB above to see exactly what it is talking about.

And yes, you have to add the VIs you are calling dynamically when you create the exe.

Good luck.

Feroz
0 Kudos
Message 4 of 5
(3,153 Views)
This link might answer some of your questions:
http://zone.ni.com/devzone/conceptd.nsf/webmain/0D3D57B8D8BCD01D86256A7A006979EC?OpenDocument

Some of this doesn't apply to your case. Skip down to step 3 for an
explanation of the difference between paths in a development environment and
in a run-time system. Steps 6 and 7 discuss dynamic vi's.

You do want the App Builder to be aware of the sub-vi's by including them as
dynamic vi's. They should then be included in the build files. After
running the App Builder, check to see if the dynamic vi's are in the support
file directory. If they are, then to derive their path, take the main vi
path, strip it twice, add the support file directory name, and add the
dynamic vi name. If the dynamic vi's are not
in the support directory, they
should have been included in the .exe file (unless you use an llb for other
files during the build). In this case, take the main vi path, strip it once
(I think), and add the dynamic vi name. If neither of these work, manually
copy the dynamic vi's to the support file directory of the destination
computer and use the first method to strip and build the path. If you want
to troubleshoot this, make the dynamic vi path an input so you can see what
works.

Also, if you need to open the front panel of the sub-vi's, set the build
options so that the front panel is not removed.

"analog" wrote in message
news:50650000000500000029420100-1068850981000@exchange.ni.com...
> So if I want to run my sub-VI using the VI server in my application,
> do I have to do both #1 and #3 in your answer. Because the original
> vi's are not stored in the computer that I am using to run the
> application, if we use the path, doesn't the server get confused
> because
that original VI is stored on another computer's C drive.
> Can you explain #3 a little bit more. Also, if my sub-VI's path is
> C:\subVI A.vi, how would I name that path in an exe?
0 Kudos
Message 5 of 5
(3,153 Views)