On UNIX platforms, awareness of buffering has been built into the pistart script delivered with the PI API. As of version 184.108.40.206 of the PI API on UNIX, the script runs 'bufutil -i' which determines if buffering is set on in the piclient.ini. Previous to version 220.127.116.11 of the PI API, the script ran a separate program, isbuf, to determine if the piclient.ini file contains instructions to turn buffering on. If buffering is set true, pistart will run bufutil with a -u argument to clean up any outstanding resources and then start the buffering process, bufserv.
On Windows platforms, bufserv is intended to run as a Windows service (PI-Buffer Server). Like other Windows services, you can configure PI-Buffer Server to automatically start upon reboot dependent upon the successful startup of TCP/IP. By default, the service is configured to run under the Local System account. If you require a different configuration, contact OSIsoft Technical Support for assistance.
The bufserv program may be started or stopped using the pistart.bat or pistop.bat files provided with this distribution. To complete the configuration for using the pistart.bat and pistop.bat scripts, the scripts must be configured as in the examples provided for your particular client program. Alternatively, the Control Panel> Services utility may be used to start and stop bufserv manually. To use the Control Panel> Services utility, highlight PI-Buffer Server and click Start or Stop.
StopPriority is a feature supported in version 18.104.22.168 of the PI API and later. The installation kit for Windows installs the bufserv service with a StopPriority of 0; this insures that when Windows is shut down, services which depend on bufserv will be shut down first. If bufserv is not installed with a StopPriority, some data loss may occur. The most common occurrence is that "Intf Shut" will not be written to the Interface points when Windows is shut down.
If for any reason the bufserv service needs to be uninstalled and reinstalled, the following command lines should be used:
bufserv –install –depend tcpip -stoppriority 0 [-auto]
The StopPriority flag is stored in the Windows registry: