11-19-2009 11:08 AM
The NI Service Locator resolves IP port requests that are made using a Service Name for such functions as TCPIP Open and
VI Server connection to remote targets. I would like a PC application to be able to register its own IP Service Name. This seems
to work using the app class property srvc.ServiceName. I can set this property in my code and sure enough I can test to see that
the NI Service Locator has it registered. The Problem is that this does not seem to work if I build my code into an exe. The property
node seems to execute without error but the Service Name does not get registered. Is there another way to do this in an exe?
11-19-2009 01:13 PM - edited 11-19-2009 01:15 PM
According to the TCP/IP function documentation, if you pass a service name to the Create Listener function the function will open an arbitratry port and register this under the service name with the service locater service. In the same manner passing a service name to the Open Connection function will query the service locater on the addressed machine for the port to use and use that port number to open the actual connection.
Alternatively there used to be undocumented VIs in resources\system\ServiceLocaterInterface.llb in LabVIEW 7.x that allowed to do the registering and query with the NI Service Locater service.It's protocol is (used to be) a fairly simple HTTP based protocol.
11-19-2009 01:14 PM - edited 11-19-2009 01:16 PM
11-20-2009 08:58 AM
Hi Rolf,
Thanks for your reply, I did try the Create Listener vi and it does work as you said. I can also use it in a exe. However my goal is to be able to set the
vi server service name for each of several exe's running on the same PC. I have tried to get an application ref and then use the srvr.ServiceName Property
but I can only get this to work in development mode. I think I am not getting the proper application ref for each exe. I am using the vi class property ownerapp
as a starting point but it does not appear to do the trick.
11-25-2009 09:49 AM
Ok, I think I finally have a handle on this....
The problem is that there appears to be a bug in LV2009 with the App Class properties Srvr.Port and Srvr.ServiceName
In development you can R/W these parameters and they work fine. In a built exe both Port and ServiceName will always revert
back to the default for the development VI Server, for example Srvr.Port will revert to 3363 no matter what you attempt to set it to.