In many applications it can be useful to run ICONICS or other 3rd party servers as Windows NT services to provide data in unattended environment (no need to log a user to the server machine). This application note is intended to give a short guide how to setup the most common UA servers that are currently available. For details about OPC UA Sample Server you can also refer to the OPC UA Sample Server topic.
There are two possible ways to configure this server to run as an NT service.
Install ICONICS OPC UA server
Open the server configurator from Start menu (Start -> Programs -> ICONICS -> OPC UA Server by Kepware OPC UA Server by Kepware). By default installation it is running as a server application (not an NT service)
Click on “Tools” from the menu above and select “Options”
Switch to “Service” tab and check the “Automatically start as a Windows NT service” checkbox.
Figure 1 - Configuring ICONICS OPC UA Server
After confirming this change restart the server by expanding “File” menu and select “Exit”. Then the server should appear among the services as “ICONICS OPC UA Server by Kepware Service”. As the service is configured to auto start it will start automatically every time the machine reboots even before a user logs in.
In the service properties it can be also configured the specific user under which the service will be running.
Figure 2 - Microsoft Services Manager
Install the ICONICS OPC UA server by Kepware
Go to C:\Program Files (x86)\ICONICS\OPC UA Server by Kepware\
Open “ServerMain.ini” file, find line “Start As NT Service=0” and change the value to 1
Save the file and restart the server … it will then run as a service
In this server type, this action can only be done by editing the “ServerMain.ini” service state back to “0” value. It’s because the server tray icon will not appear when the server is running and client connected therefore there is no way to interact with the desktop and open the server configurator while running the server as a service.
Figure 3 - Using INI File
Similar steps as in the previous case need to be performed to start the Kepware KEPServerEx server as NT service. Please see the sections “Using GUI” and “Using INI file” above.
This action can be done in two possible ways:
Editing the “ServerMain.ini” service state back to 0 value like by the “ICONICS OPC UA Server by Kepware“
For the other way to return the server to normal stand alone program operation you must:
a. Be able to interact with your server project (desktop). If you do not have the server configured to interact with the desktop, use the NT Services Manager to enable desktop interaction then stop the server service (this is only possible if the server runs under the local system account).
Figure 4 - Running Kepware Server as a Service
b. Stop and restart the server using the Start button in Service Manager - you should then be able see the server on your system taskbar.
Now the changes to your server project can be made using right-click on the tray bar Server icon and select “Restore”
Figure 5 - Running Kepware Server
NOTE: You will not be able to interact with the configurator once you set it to run as a service. To interact with the configurator, you will need to set it to run as an application using the ini file.
To return to normal program mode uncheck the "Automatically start as a Windows NT service" checkbox on the Service option dialog of the server.
Stop the server using the Stop button of the Service manager. Now you should be able to run the server from your normal desktop icon or start menu selection.
This server is installed directly with possibility to run as Windows NT service, however it’s by default switched to be started manually. The service name is “MatrikonOpcUaWrapper” and it can be simply switched between Manual to Automatic start.
Click on the Windows Start button and select Control Panel -> Administrative Tools -> Services.
The Services window appears
From the Services window, choose “MatrikonOPC UA Wrapper for COM OPC Servers”
Start the service.
Like in the Matrikon server case this server is installed directly with possibility to run as Windows NT service and it’s by default switched to be started manually.
The service name is “UA Sample Server” and it can be simply switched between Manual to Automatic start using the Service Manager.