VTScada as a Windows® Service
You can install VTScada to run as a Windows® service. After installation, you can stop and then re-start VTScada as either a service or as an interactive program.
User interface items may differ in appearance when rendered within a Windows service. In particular, Windows control buttons will differ in appearance when viewed on a mobile client.
Certain third-party applications may have limited interaction with the service.
Microsoft does not permit Windows services to access SAPI (the built in Windows text-to-speech engine). This means that if you are using the VTScada Alarm Notification System and you configure your application to run as a Windows service, then outgoing alarm calls via voice modem are silent. VOIP and Twilio calls may work, but Microsoft is inconsistent with which versions of Windows will allow services to access SAPI. We cannot guarantee operation of VOIP when running VTScada as a service.
When running VTScada as a Windows service, DO NOT select Excel as an output destination or option from a Report Tag. As noted in the MSDN forums, office applications assume they are being run under an interactive desktop. If Excel attempts to open a modal A modal dialog is always displayed on top of the calling window and prevents further interaction with that window. dialog from a non-interactive service, the result is an invisible dialog that cannot be dismissed, stopping the thread.
Besides the technical problems, you must also consider licensing issues. Microsoft's licensing guidelines prevent Office applications from being used on a server to service client requests, unless those clients themselves have licensed copies of Office. Using server-side Automation to provide Office functionality to unlicensed workstations is not covered by Microsoft's End User License Agreement (EULA).
If you have been running VTScada as an interactive program, it is necessary to install the service objects before you can run the program as a service. You can do this using command line switches, or you may choose to repeat the full installation, selecting the service option.
Use caution if switching VTScada between running as a service and running as an interactive program. Problems will occur if your user account does not have the same permissions as the one under which VTScada runs as a service. If only one account has access to the Data folder or sets elevated permissions on the files it creates, these problems may be severe.
Rather than switch modes, you are advised to configure the VTScada Application Manager script application so that it can be accessed using the VIC or the VTScada Anywhere Client (Access the VAM from a Thin Client).
To do this, your license must allow at least one VTScada Thin Client connection. The VAM can be run from only one Thin Client at a time.
After installation, the service will automatically start when Windows® starts. Note that a delayed start is configured by default. It may be stopped and started through the Windows® Service Control Manager or using the command line, which is the recommended option.
vts.exe /s=start
vts.exe /s=stop
VTScada security permissions are not required to stop the service.
The Windows account used to issue service commands (e.g. starting and stopping the VTScada service) must have administrative privileges (and, if using the command line, the console must be run with administrator privileges).
The account under which VTScada runs when running as a service or interactively must have read / write access to the VTScada installation folder, sub-folders and to any other folders external to the installation folder that might be used for data storage.
If running as a service under a regular user account, then to access Workstation Status Driver values e.g. CPU, the account must be a member of the local "Performance Monitor Users" group.
The application that will be available through your VTScada service must exist on the server, and be configured to auto-start. Because VTScada cannot run as a service and as an interactive program at the same time on the same workstation, the following procedure is suggested.
- Install VTScada and run as an interactive program.
- Create or install the application.
- Configure the VTScada Thin Client Server, to allow VTScada Thin Client connections.
- Configure the application to auto-start.
- Configure the VAM as described in Access the VAM from a Thin Client.
- Stop the interactive VTScada session.
- Run VTScada as a service, re-installing to add the service components if this was not done earlier.
The command-line syntax is recommended. - Start the VTScada service.
When VTScada is running as a service, all operational access to your application is through other workstations where VTScada is installed and running as an interactive program, or through VTScada Thin Client connections. Ensure that your VTScada license permits the maximum number of simultaneous Thin Client connections that you expect. System messages that would otherwise have been shown on the interactive console are directed to a VIC connection. Error messages are directed to the Windows® event log.
You can use a VIC connection to perform tag configuration.
To perform development work, do any of:
- Install VTScada on a second server and configure your server list. Use Get From Server to install the application on the second workstation. Configuration changes will be deployed from one to the other.
- Connect Using the VTSX Program (or if available, Internet Explorer). This provides access to the Tag Browser, Application Configuration and (if licensed) the Idea Studio.
- Connect Using the Anywhere Client, which provides access to both the Tag Browser and the Application Configuration dialog but not the Idea Studio.
- ChangeSets, created on a non-networked workstation, can be copied to the server, then applied using the VIC. The identical application must be installed on the second workstation.
- Stop the service and re-start as an interactive session. Ensure that you are logged into Windows using an account that has permissions that match those being used by the service, so that file changes can be saved. Perform the development work. Re-start VTScada as a service.
Plan for Troubleshooting
If you plan to allow programmers and developers to use an Internet connection to access diagnostic applications such as the Source Debugger or TraceViewer, then you must secure those applications and add them to one or more Internet Realm.
People sometimes ask how they can tell whether VTScada is running as a service. To answer that question, use the Windows Task Manager. (keyboard combination: Ctrl-Alt-Del). Assuming that VTScada is in fact running, then if it shows in the list of applications, it is not running as a service. If it shows under the list of background processes (or on the Services tab of the Task Manager) then it is running as a service.
If VTS doesn't show in any list, it is not running on this workstation. The Task Manager won't tell you what is running on remote servers. In this case, if you can see your application, you must be using a Thin Client, and from here you have no way to know whether the server is running in desktop or service mode.