The server supports running as a Windows service.
Service operation is completely user configurable from the
Tools|Options menu and can be changed at any time allowing
you to move from normal stand-alone program operation to
NT service mode. Running as an NT service is crucial for
many applications where the server provides data to OPC clients
via DCOM. For these applications a loss of DCOM connection
cannot be tolerated. Normally an OPC server that only supports
stand alone program operation is forced to shut down when
its host machine experiences a user log in or log out. While
running as a service, the server can continue to supply OPC
data across user log in sessions and can be configured to
interact with the desktop allowing you to make changes to
your server project. It can also be configured to have a
visible presence while running, which allows you to make
changes to your project while running.
To run the server as a service, select (on the Service tab) the Tools|Options menu.

The "Automatically start as a Windows NT service" option
allows you to configure the server for operation as a Windows
service. By default this
option
is disabled (unchecked). When you enable the service option
you will be presented with a message dialog warning you that
this change will take effect on the next server run. If you
want the server to immediately become a service you must
exit the application. Once you have exited the server you
can either restart it from the Windows NT Service Manager
found on the "Control Panel" or allow your OPC
client to invoke the server when it connects.
Note: The Service option
of the server can only be accessed when you are logged into
Windows as an administrator. If you are currently logged
in as a normal user the run as service option will be disabled
(grayed out).
Once you have configured the service option, you may also need to modify the NT service options to setup the server for your specific application. Here is the NT Service Manager's properties dialog for the server showing its default conditions:


By default the server is configured for automatic startup and interaction with the desktop. Interaction with the desktop means that you will still see the server on your task bar and that you will be able to make changes to your server project even though it is running as a service. However, you will not be able to shut the server down from any of the normal menu exits or close functions. Allowing the server to interact with the desktop has no effect on its ability to supply OPC data across user logins. Once you have your server project completely configured you may want to consider disabling the server's interaction with the desktop. This will prevent users from seeing the server on their task bar and further reduce unauthorized access to the server. To prevent the server from interacting with the desktop simply uncheck the "Allow Service to Interact with Desktop" check box. Once you disable desktop interaction you will need to restart the server to remove it from your system taskbar.
Note: We strongly recommend that while you are running the server in a demo or evaluation mode that you continue to allow the server to "Interact with Desktop". This will allow you to see any error messages that the server may generate such as "Demo period has expired". If this occurs simply stop the service using the Service manager as shown below.
Once the server is configured to run as a service you can use the NT Service manager to manually start and stop the server. The Service Manager menu allows you to select your server by name and either start or stop the service as shown here:

Returning the Server to Normal Program Mode
To return the server to normal stand alone program operation you must first be able to interact with your server project. This requires that the server be able to interact with the 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. Once the server has stopped, restart it using the Start button as shown above. You should now be able see the server on your system taskbar. Once the server can be seen on the desktop you can make changes to your server project. To return to normal program mode uncheck the "Automatically start as a Windows NT service" checkbox on the Service option dialog of the server. Next, 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.
If the server is configured to run as a service and you attempt to run it from your desktop icon or the start menu you will be presented with the following message box:

If you receive this message and truly require the server to run as a normal program review the steps in "Returning the Server to Normal Program Mode" above.
Possible issues when running as a service
Under most circumstances you should be able to seamlessly switch between Service mode and Stand Alone mode. There is the possibility of a DCOM (Distributed Component Object Model) security issue that may prevent your OPC client from being able to connect to the server when it is running as a service.
If you experience an issue connecting your OPC client to the server when it is running as service, we suggest that you first take the server out of service mode and confirm your OPC connection in Stand Alone mode. Once you have confirmed your OPC client connection under normal circumstances it's time to look at your DCOM settings.
KEPServerEX
Features Page »»
|