Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Interface for OPC HDA

Principles of operation

  • Last UpdatedSep 13, 2024
  • 4 minute read

The PI Interface for OPC HDA is an OPC HDA client that allows the Data Archive and other software applications to exchange data across a network. During installation of the interface, entries are put into the Windows Registry, which then allows the Windows system to locate the OPC HDA Server whenever the client wants to connect to it. If the PI OPC HDA Interface and an OPC HDA Server are running on different machines, the OPCEnum tool can be used to locate those registry entries on the other machine.

At interface startup the PI OPC HDA Interface attempts connection to both the OPC HDA Server and the PI Data Archive. If OPC HDA server is unavailable, the interface will attempt to connect every 5 seconds until successful. If the Data Archive is unavailable, the interface will attempt to connect every 60 seconds. After connection to both servers is successfully established, the interface periodically checks its node clock against that of the OPC HDA Server and against that of the Data Archive, to eliminate any differences due to clock drift.

The interface goes on to identify the PI points associated with the instance of the interface, based on the PointSource and Location1 point attributes. The interface will make sure that each of these PI points is properly configured so that it knows what data to collect from the OPC HDA Server. An incorrectly configured point is rejected and a message is sent to the log file. Once the properly configured PI points are identified, the interface will perform history recovery before entering the data collection mode.

The interface will use the timestamp of the last good PI archive value or the /hi=x command-line parameter, whichever is closer to the current time, to determine how far back in time to retrieve data. If the interface is unable to connect to Data Archive and attempt to determine the last good PI archive value, it will then use the timestamp of 5 minutes before the current time for the history start time of the tag. During a reconnect to the OPC HDA server, the interface will use the same process to determine the history start time for each tag.

The interface supports the SyncRead::ReadRaw and SyncRead::ReadProcessed methods. Because of this support you must set up scan classes to control how frequently to collect data from the OPC HDA server.

For Event reads, the Data Archive informs the interface when the trigger point has a new event (not necessarily a change in value), and the interface sends a synchronous Read for the points attached to that trigger. All data since the last read will be processed using the SyncRead::ReadRaw method.

During data collection all data stored in the history database since the last scan will be read during the current scan. For example, if a point is in a scan class of 1 minute, and data goes into the history database on the OPC HDA Server every 10 seconds, 6 values will be read and processed for each scan.

The SyncUpdate::InsertReplace method is used for outputs from PI to the HDA Server. This function inserts or replaces values and qualities in the HDA for the time stamp of the sourcetag. If the item has a value at the specified time stamp, the new value and quality will replace the old one. If there is no value at that time stamp, the function will insert the new data. If the soucetag’s value is a system digital state (e.g., io timeout, shutdown,…), the output will not be done. The quality of the data sent to the HDA will be set to Good.

PI point configurations can be updated (added, edited, or deleted) while the interface is running and these changes will be picked up by the interface automatically. In general, the interface will check for point updates every 2 minutes. However, if it finds that at least 25 points have been updated, it will check again in 30 seconds; otherwise it will wait another 2 minutes before checking again. With some OPC HDA servers, this operation can require more time and more system resources. Therefore, it is more efficient to stop and restart the interface if a large number of points are edited.

The PI OPC HDA Interface is designed to send messages about its operation to the pipc.log file. This file will contain the following information about the interface:

  • Informational messages on interface startup and shutdown

  • The scan rates for each scan class

  • A count of the Input points in each scan class and the number of Output points

  • Error messages for rejected PI points or error messages from the OPC HDA Server

  • Notification for all connections and disconnections from the OPC HDA server

    Note: The PI OPC HDA Interface can be configured to run on the same system as the OPC HDA Server, Data Archive or on another node. The configuration affects the specific system settings needed for the interface to be installed and perform correctly. Therefore, it is crucial to know the operational details of the interface presented in this section before installing and running it.

TitleResults for “How to create a CRG?”Also Available in