LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a user interface for an executable running as a Windows Service

Hi,

 

I'm planning out a program which will be running as a Windows Service, and I was wondering what is the best way to create a program which will act as a user interface for this service.


The program is going to be a TCP/IP repeater, which receives signals from our data acquisition system, bundles the relevant data into different telegrams, and sends them off to various data processing/logging programs.

 

We want the program to run at all times, even if a user logs off, so turning this repeater into a service seems like the best way to do this.

 

However, we'd also like a user interface so that we will to be able to see what the incoming and outgoing data is and have the ability to configure any TCP/IP settings, reset connections, and start/stop different telegrams.

 

What is the best way to create this UI?

 

A really simple picture of what I'd like to create is this:

Service UI.png

 

I'm just not sure what is the best way to communicate between these two executables. Any suggestions as to what method of communication is best?

0 Kudos
Message 1 of 2
(3,658 Views)

NickG88,

 

With this setup you will either want to use TCP server/client setup or network shared variables. 

 

Using the TCP server/client setup, you will have a passive server that will only reply to your UI when the UI asks for information.  There is an example of this VI build in LabVIEW for your convenience.  If you go to Help»Find Examples, this will bring up LabVIEW’s example finder.  From there, the example you are looking for has the following path “Communicating with External Applications\General\TCP Communicator - Passive.vi”.  Also, next to this there is an example of an active TCP communicator which your UI would be modeled after.

 

Network shared variables are an alternative to this where your server will be continuously be updating the network variables and your UI would grab them as needed.  The drawback with this is that if you are using more than 30 network variables, it will slow your system down.  Useful links pertaining to network shared variables are listed below:

 

http://www.ni.com/white-paper/4679/en/#toc3

http://digital.ni.com/public.nsf/allkb/04D9A85B6967EE87862571140065EEC6

 

PTerro

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,619 Views)