Buffering 50 How Buffering Works A complete technical description of PIBufss and Bufserv is beyond the scope of this document. However, the following paragraphs provide some insights on how buffering works. When an interface node has buffering enabled, the buffering application (PIBufss or Bufserv) connects to the PI Server. It also creates shared memory storage. When an interface program makes a PI API function call that writes data to the PI Server (for example, pisn_sendexceptionqx()
), the PI API checks whether buffering is enabled. If it is, these data writing functions do not send the interface data to the PI Server. Instead, they write the data to the shared memory storage that the buffering application created. The buffering application (either Bufserv or PIBufss) in turn reads
the data in shared memory, and if a connection to the PI Server exists, sends the data to the PI Server or if there is no
connection to the PI Server, continues to store the data in shared memory (if shared memory storage is available) or writes the data to disk (if shared memory storage is full. When the buffering application reestablishes connection to the PI Server, it writes to the PI Server the interface data contained in both shared memory storage and disk. Before sending data to the PI Server, PIBufss performs further tasks such as data validation and data compression, but the description of these tasks is beyond the scope of this document) When PIBufss
writes interface data to disk, it writes to multiple files. The names of these buffering files are
PIBUFQ_*.DAT
When Bufserv writes interface data to disk, it writes to a single file. The
name of its buffering file is APIBUF.DAT
As a previous paragraph indicates, PIBufss and Bufserv create shared memory storage at startup. These memory buffers must be large enough to accommodate the data that an interface collects during a single scan. Otherwise, the interface may fail to write all its collected
data to the memory buffers, resulting in data loss. The buffering configuration section of this chapter provides guidelines for sizing these memory buffers. When buffering is enabled, it affects the entire interface node. That is, you do not have a scenario whereby the buffering application buffers data for one interface running on an interface node but not for another interface running on the same interface node.
Share with your friends: