Version 7.x drivers can run as a Windows service. Running your driver as a service lets users log on and off the operating system without shutting down the driver.
IMPORTANT: When iFIX is running in Service mode, the OPC Client must also run in Service mode. When iFIX is not running in service mode, the client must run in non-service mode. GE strongly recommends that both applications run in the same context.
NOTE: If the OPC Client driver is added to the SCU, and you do not stop it, it will be stopped automatically when iFIX is shut down.
By default, an I/O Server does NOT run as a Windows service. To set up the I/O Server to run as a service, you must register it as a service. During installation, the Setup wizard automatically registers the server as a regular server process. To register it to run as a service, you must run the server on the command line, specifying that you wish to register it as a service. When the server is running as a service, you may need to re-register it in certain situations, such as when you need to change the logon account.
Before you register the I/O Server to run as a service, follow these steps to ensure that it is not currently running:
- If the driver is currently running as a regular server, you must stop the process by shutting down all clients to the server, such as the PowerTool or iFIX.
- If the driver is currently running as a service, you must stop the process by shutting down all clients to the server, and you must also perform these tasks on your operating system:
- Windows XP, Windows 2000,and Windows 2003 – from Control Panel, select Administrative Tools, then select Services. A list of all services configured on the machine displays. Locate OPCDrv Server. If the status is Started, right click and Stop the server.
After you stop the server from running, select the Process tab from the Task Manager and verify that the OPCDRV.exe process is no longer listed.
Registering the I/O Server as a Service
To register the I/O Server as a service:
- From the Windows Start menu, select Run.
- Enter the following command and click OK:
OPCDrv REGSERVICE
The Logon Account for Running As A Service dialog box appears, and the registration process now allows the user to specify a logon account. This provides flexibility with the user’s choice of security settings. The dialog box allows the user to select one of these accounts when registering the OPC Client driver to run as a service:
NOTE: The local system account cannot be used to access remote OPC servers. If this OPC Client accesses remote OPCDrv servers, you must select another account using This Account.
- This Account – uses an account specified by the user to log on the I/O Server. This account is useful if you need to specify a domain account. The account used here must be an existing account with both Administrator and Logon as a Service privileges to run the server as a service. To determine if the account has Administrator privileges, refer to the manual provided with your operating system. For example, to determine Administrator privileges in Windows 2000, select Administrative Tools from Control panel, and then select Users and Passwords. Use the Local Security Policy Setting tool to grant the account Logon as a Service privilege.
- After you register the driver, start the Power Tool and make sure the Auto Start option is enabled. Refer to Start the I/O Driver from the Power Tool to learn how.
- Configure DCOM (Distributed Component Object Model). Refer to How do I set up security for using the I/O Server remotely? to learn more.
- If your Human-Machine Interface (HMI) software is FIX or iFIX, start FIX or iFIX. When either program runs, it will start the OPC server as a service.
If your HMI is a third-party package, then complete the following steps instead:
- From Control Panel, select Administrative Tools/Services, and then change the OPCDrv server startup from Manual to Automatic.
- Start your HMI software.
You can reset the server to be a regular server process again by re-registering it as:
OPCDrv REGSERVER
NOTE: Before you register the I/O Server to run as a regular server, you must ensure that it is not currently running.
When registering the server this way, it will run, perform the necessary registration work, and then exit. You can then start the server by using more conventional methods such as starting iFIX, the Power Tool, or any client program capable of communicating with the server.
NOTE: You cannot display the OPCDrv Server window using Alt + Shift + S when running as a service.
See Also