• No results found

Configure Buffering

In document PI Server System Management Guide (Page 126-128)

Chapter 12. Finding and Fixing Problems: the pidiag Utility

5.3 Basic Interface Node Configuration

5.3.9 Configure Buffering

Once you have demonstrated that you can collect data with your interface, it is time to configure buffering. Some interfaces do not require buffering or work better without

buffering. You must consult the interface-specific documentation to determine this. On VMS, there is no need to configure buffering because it comes as part of PINet. The information below applies only to UNIX and Windows Interface Nodes. For more details see the PI API

Installation Instructions. On Windows, the PI API Installation Instructions is installed by

the PI-SDK setup kit in the pihome\bin directory. The file name is API_install.doc. If buffering is enabled on UNIX and Windows, the pihome\dat\piclient.ini file will contain the following two lines.

[APIBUFFER] BUFFERING=1

5.3 - Basic Interface Node Configuration

The file can be edited with a text editor. Setting buffering=0 turns buffering off. Any changes that are made to the pihome\dat\piclient.ini will only take effect when bufserv is restarted.

The default and maximum size limit of buffer files is 2,000,000 KB (~2GB). If there is not 2GB of disk space available, then the buffer will grow as large as possible before failing. The maximum size limit can be set to a value less than 2,000,000 KB with the maxfilesize parameter in the piclient.ini file. For a full list of configuration options, refer to the PI API

Installation Instructions.

The following applies to buffering for PI API version 1.6 and greater on Windows and UNIX.

‰ In PI API version 1.6 and greater, data that is sent via the PI API can be buffered to multiple PI server Nodes. The PI Server Nodes for which buffering is enabled is configured in the pihome\dat\piclient.ini file in the [BUFFEREDSERVERLIST] section. In addition to the parent process, one buffer server process will be spawned for each buffered server specified in the list. See PI API Installation Instructions for more details.

‰ The connection name for the interface (usually specified in the /host parameter) must exactly match the buffer server name configured in the pihome\dat\piclient.ini file. For example, in order for buffering to work for a UniInt-based interface, the

IPAddress or HostName specified by the /host command line parameter would need to be identical to a PI Server listed in one of the entries specified in the

[BUFFEREDSERVERLIST] section in the pihome\dat\piclient.ini file. The IPAddress and HostName are not interchangeable in this case, if the IPAddress is used in the interface and the HostName in the pihome\dat\piclient.ini file, then interface connection via the IPAddress would be unbuffered.

‰ Bufserv now supports event distribution to multiple PI servers. This is sometimes referred to as n-way buffering or buffering to replicated servers. Event distribution to multiple PI servers consists of the taking data sent to one buffered server distributing of the same event to multiple buffer servers. The list of PI servers to receive

distributed events is configured in the [REPLICATEDSERVERLIST] section in the

piclient.ini file. The distributed event is not manipulated in any way, which means

that the event does not have the point ID or the timestamp altered. Therefore, the replicated PI servers must all have synchronized point databases. PI servers in the [REPLICATEDSERVERLIST] section must also be in the

[BUFFEREDSERVERLIST] section.

The following applies to versions of the PI API prior to version 1.6.

‰ Prior to PI API version 1.6, buffering could only be enabled for the default PI Server node. The default PI-Server node is specified in the pihome\dat\pilogin.ini on Windows and in the pihome\dat\piclient.ini node on UNIX.

‰ The connection name for the interface (usually specified in the /host parameter) must exactly match the name of the default PI-Server node. configured in the

pihome\dat\piclient.ini file.

‰ Buffering should be installed as an automatic service. This can be accomplished though the Tools > API Buffering… menu in the PI Interface Configuration Utility.

‰ You can enable and disable buffering from the PI-Interface Configuration Utility from the Tools > API Buffering... menu. The PI-Interface Configuration Utility makes all of the necessary changes to the piclient.ini file.

‰ The interface service must be configured to depend on bufserv to ensure that buffering starts first. Otherwise the interface might establish an unbuffered connection to PI before bufserv starts.

Monitoring Buffering

To ensure that buffering is functioning properly, check the interface log each day. You can also use the buffering utility, bufutil.exe, to check the buffering service. For example, bufutil.exe can be used to list the number of events that are currently in the buffer. When connected to the PI server, the number of unprocessed events should generally be zero, but may show a finite number since events are streaming through the buffers.

For version 1.6 and greater of the PI API, when bufutil.exe is started, the currently selected buffered server is listed. There is a menu option to change the selected server.

In document PI Server System Management Guide (Page 126-128)