LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Service Locator- How do you register a Service Name?

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?

0 Kudos
Message 1 of 5
(2,931 Views)

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.

Message Edited by rolfk on 11-19-2009 08:15 PM
Rolf Kalbermatter
My Blog
Message 2 of 5
(2,920 Views)
accidential double post
Message Edited by rolfk on 11-19-2009 08:16 PM
Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 5
(2,919 Views)

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.

0 Kudos
Message 4 of 5
(2,890 Views)

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. 

0 Kudos
Message 5 of 5
(2,857 Views)