ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI server in executable

Solved!
Go to solution
Can VI server in an executable form be used to control a remote VI which is also in executable format. I could do this with LabVIEW development software at both ends but not after built into executables.
Thank you for your help.
Aman
0 Kudos
Message 1 of 12
(8,010 Views)
This is possible. When you build the executables you'll see ini files with them. The ini Files contain the VI server configuration, if you create an exe it'll use the VI server settings of the project by default.
To allow access from any machine to any VI in the exe on port 3364, use the following lines in the ini file:
server.tcp.enabled=True
server.tcp.access="+*"
server.tcp.port=3364
server.tcp.acl="290000000A000000010000001D00000003000000010000002A10000000030000000000010000000000"
server.vi.access=""
server.vi.callsEnabled=True
server.vi.propertiesEnabled=True
You'll have to open an application reference (using the port specified) first, then you can use VI server as you do in LabVIEW.

Hope this helps,
Daniel

Message 2 of 12
(8,009 Views)
Thank you for your promot response. Regarding the lines do I replace the contents of my old ini files with these ones. Do I have to replace in both Client and Server?
 
I was going through this knowledgebase "Accessing VIs Inside of a LabVIEW Executable or DLL in LabVIEW 8.2 and Later" . I use LabVIEW 8.5 so I thought this is the explanation why my VI Server in the executables are not working.

However there is this line in the same knowledge base that says

"Also, this change still permits you to open application references to an EXE, and subsequent VIs referenced by name, through VI Server when it is enabled for the EXE." .

 However I couldnot make it out what does it mean by "enabled for the EXE". Does it refer to the same procedure that I normally do like writing a * for 'allow access' in Exported VIs.

Aman

0 Kudos
Message 3 of 12
(8,000 Views)
Enable it in the exe is what I described in my post.

The last paragraph of the KB article says:
Enable TCP/IP support for VI Server for the application. Open an Application reference to that port on your local machine (from the LabVIEW functions palette: "Programming»Application Control»Open Application Reference", then use "Open VI Reference" and call the VI as you did in the past. While it isn't much more work for the caller, you do have to actively manage your ports and keep up with the right settings in the ini files for the EXEs.
To specify access and port use the lines of my last post in the ini file. If these lines don't exist you can just add them, but probably you want to use a different port, restrict access (access control list = acl) to certain machines (e.g. localhost) or limit access to certain VIs.

Besides setting these parameters in the ini file you can also use application properties. See screenshot.



Daniel




Message Edited by dan_u on 05-06-2008 10:39 AM
Message 4 of 12
(7,997 Views)
I tried with your suggestion but it still doesnot seem to work. I have included my sample VI and the executable files. I appended the codes that you supplied at the end of ini files at the end of both. 
The zip folder has two folders
call_exe_folder folder which has the executables to call the exe_vi.vi in exe_vi.exe  and exe_vi folder
0 Kudos
Message 5 of 12
(7,972 Views)
I tried with your suggestion but it still doesnot seem to work. I have included my sample VI and the executable files. I appended the codes that you supplied at the end of ini files at the end of both. 
The zip folder has two folders
call_exe_folder folder which has the executables to call the exe_vi.vi in exe_vi.exe  and
exe_vi folder
0 Kudos
Message 6 of 12
(7,971 Views)
 


Message Edited by aman_bajra on 05-06-2008 10:27 AM
0 Kudos
Message 7 of 12
(7,970 Views)

 



Message Edited by aman_bajra on 05-06-2008 10:26 AM
0 Kudos
Message 8 of 12
(7,970 Views)
I tried with your suggestion but it still doesnot seem to work. I have included my sample VI and the executable files. I appended the codes that you supplied at the end of ini files in both. 
The zip folder has two folders
call_exe_folder folder which has the executables to call the exe_vi.vi in exe_vi.exe  by Open Application Reference and
exe_vi folder which has the exe_vi.exe.
The project files and VIs are also included in the zip.
 
Thanks
Aman




Message Edited by aman_bajra on 05-06-2008 10:31 AM
0 Kudos
Message 9 of 12
(7,970 Views)
Two things:
1) You enabled VI server for both exes on the same port (both try to listen on port 3364). Enable VI server only in the exe you want to control (i.e. exe_vi.exe) or use different ports.
2) In the ini file you specify VI server port 3364, but in call_exe.vi you open an application reference to port 3363 (which is most likely your LabVIEW VI server port). Change the port to 3364.

Daniel

0 Kudos
Message 10 of 12
(7,961 Views)