The BufStat utility is installed as part of the interface kit and is located in the PIHOME/interface/SIPowerTG directory.
This utility can be used to check the current connection status of a buffered PI server. It can also print the configuration of the bufserv parameters and the detailed status of the buffers. Typically, it will be used to allow the Siemens software to retrieve the PI server connection status so that it is able to notify operators when a PI server connection is lost.
The command syntax is
BufStat [options] PIserver
where PIServer is the name of the PI server to be checked. Valid options are
To print out the current status of the buffers, use the following
BufStat -stat XXXXX
BufServ Status Info
PI Server Status : Connected
BufServ Status : Single
Buffer 1 WriteLoc : 448
Buffer 1 Read Loc : 36
Buffer 1 Wrap Loc : 0
Buffer 1 Entries : 16
Buffer 1 Used : 412 ( 0.04%)
Buffer 2 WriteLoc : 36
Buffer 2 Read Loc : 36
Buffer 2 Wrap Loc : 0
Buffer 2 Entries : 0
Buffer 2 Used : 0 ( 0.00%)
File Entries : 0
File Size : 0 kBytes
To show the current connection status only, use the following
BufStat -con XXXXXX
To use the BufStat in a script to get the current connection status, use the return code from the utility. The following script runs the BufStat utility and then outputs the return code ($? is the return code variable)
For more information regarding Digital States, refer to the PI Server documentation.
Digital State Sets
PI digital states are discrete values represented by strings. These strings are organized in PI as digital state sets. Each digital state set is a user-defined list of strings, enumerated from 0 to n to represent different values of discrete data. For more information about PI digital tags and editing digital state sets, see the PI Servermanuals.
An interface point that contains discrete data can be stored in PI as a digital point. A digital point associates discrete data with a digital state set, as specified by the user.
Typically, these digital sets can be used for data like
UNDEFINED, OPEN, CLOSE, TRANSITION
Quality Digital State Set
The following digital sets define the states for different types of points supported by the interface. These digital sets can be created by importing the SIPowerTG_DigitalSets.csv file with the SMT Digital Set plug-in, or by creating the digital sets manually.
TG_DATA_QUALITY - Quality Priority Digital Set
Location2 = 0, InstrumentTag ends with .QUAL
The Data Quality points can be used to show the status of a Power TG point. It is based on the data qualities displayed on the operator displays and uses the data_qualities.ini file to calculate the quality state to send to the data quality PI points.
Note 1 : Care must be taken to ensure that the definition of the TG_DATA_QUALITY digital set matches the definition given in the data_qualities.ini file (and data_qualities.project.ini if it exists). If there is a mismatch then misleading information will be shown on the PI displays.
Note 2 : If the number of states in the digital set is not sufficient to store the priorities defined in the data_qualities.ini files then the points will be rejected by the interface.
To show the current alarm status of an analog point, the interface supports an alarm status point which will get the alarm status from the data quality of the event and write one of the following states
One of the interface-specific performance points shows the status of the last file processed. The File Status digital set is used to represent that status.
TG_FILE_STATUS - File Status Digital Set
Location2 = -1,
ExDesc = ”DATA_FILE_STATUS” or ExDesc = ”ALARM_FILE_STATUS”
File magic number is not valid
File processed without errors
Events were found that were found to be invalid
System Digital State Set
Similar to digital state sets is the system digital state set. This set is used for all points, regardless of type, to indicate the state of a point at a particular time. For example, if the interface receives bad data from the data source, it writes the system digital state Bad Input to PI instead of a value. The system digital state set has many unused states that can be used by the interface and other PI clients. Digital States 193-320 are reserved for OSIsoft applications.