PI_OPCHDAInt_1.4.2.35

185
OPC HDA Interface Version 1.4.1.x – 1.4.2.x

description

OPC HDA Manual

Transcript of PI_OPCHDAInt_1.4.2.35

OPC HDA Interface

OPC HDA Interface

Version 1.4.1.x 1.4.2.xOSIsoft, LLC 777 Davis St., Suite 250San Leandro, CA 94577 USA

Tel: (01) 510-297-5800Fax: (01) 510-357-8136

Web: http://www.osisoft.comOSIsoft Australia Perth, Australia

OSIsoft Europe GmbH Frankfurt, Germany

OSIsoft Asia Pte Ltd. Singapore

OSIsoft Canada ULC Montreal & Calgary, Canada

OSIsoft, LLC Representative Office Shanghai, Peoples Republic of China

OSIsoft Japan KK Tokyo, Japan

OSIsoft Mexico S. De R.L. De C.V. Mexico City, Mexico

OSIsoft do Brasil Sistemas Ltda. Sao Paulo, Brazil

OPC HDA InterfaceCopyright: 2005-2011 OSIsoft, LLC. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, photocopying, recording, or otherwise, without the prior written permission of OSIsoft, LLC.OSIsoft, the OSIsoft logo and logotype, PI Analytics, PI ProcessBook, PI DataLink, ProcessPoint, Sigmafine, Analysis Framework, IT Monitor, MCN Health Monitor, PI System, PI ActiveView, PI ACE, PI AlarmView, PI BatchView, PI Data Services, PI Manual Logger, PI ProfileView, PI WebParts, ProTRAQ, RLINK, RtAnalytics, RtBaseline, RtPortal, RtPM, RtReports and RtWebParts are all trademarks of OSIsoft, LLC. All other trademarks or trade names used herein are the property of their respective owners.U.S. GOVERNMENT RIGHTSUse, duplication or disclosure by the U.S. Government is subject to restrictions set forth in the OSIsoft, LLC license agreement and as provided in DFARS 227.7202, DFARS 252.227-7013, FAR 12.212, FAR 52.227, as applicable. OSIsoft, LLC.Published: 07/2011

Table of Contents

viiTerminology

1Chapter 1.Introduction

1Reference Manuals

2Supported Features

6Diagram of Hardware Connection

9Chapter 2.Principles of Operation

10Transformations and Scaling

15Chapter 3.Installation Checklist

15Data Collection Steps

16Interface Diagnostics

17Advanced Interface Features

19Chapter 4.Interface Installation

19Naming Conventions and Requirements

20Interface Directories

20PIHOME Directory Tree

20Interface Installation Directory

20Interface Installation Procedure

20Installing Interface as a Windows Service

21Installing Interface Service with PIInterfaceConfigurationUtility

21Service Configuration

23Installing Interface Service Manually

25Chapter 5.DCOM Configuration

25OPCEnum Tool

25General Steps for DCOM Configuration

26OPC HDA Server Registration

27Chapter 6.PI_HDATool

29Chapter 7.Digital States

31Chapter 8.PointSource

33Chapter 9.PI Point Configuration

33Point Attributes

33Tag

34PointSource

34PointType

34Location1

34Location2

34Location3

35Location4

35Location5

35InstrumentTag

36ExDesc

39Scan

39Shutdown

40Output Points

40Trigger Method 1 (Recommended)

41Trigger Method 2

41Output Timestamps

41PI Point Configuration Tool

41Configuration Tool Command-line Parameters

43Chapter 10.Startup Command File

43Configuring the Interface with PI ICU

45OPCHDAInt Interface page

53Command-line Parameters

60Sample PIOPCHDAInt.bat File

61Chapter 11.UniInt Failover Configuration

61Introduction

62Quick Overview

63Synchronization through a Shared File (Phase 2)

64Configuring Synchronization through a Shared File (Phase 2)

67Configuring UniInt Failover through a Shared File (Phase 2)

67Start-Up Parameters

69Failover Control Points

70PI Tags

74Detailed Explanation of Synchronization through a Shared File (Phase2)

75Steady State Operation

77Failover Configuration Using PI ICU

77Create the Interface Instance with PI ICU

78Configuring the UniInt Failover Startup Parameters with PIICU

78Creating the Failover State Digital State Set

79Using the PI ICU Utility to create Digital State Set

79Using the PI SMT 3 Utility to create Digital State Set

82Creating the UniInt Failover Control and Failover State Tags (Phase 2)

83Chapter 12.Interface Node Clock

85Chapter 13.Security

85Windows

87Chapter 14.Starting / Stopping the Interface

87Starting Interface as a Service

87Stopping Interface Running as a Service

89Chapter 15.Buffering

89Which Buffering Application to Use

90How Buffering Works

90Buffering and PI Server Security

91Enabling Buffering on an Interface Node with the ICU

91Choose Buffer Type

92Buffering Settings

94Buffered Servers

97Installing Buffering as a Service

101Chapter 16.Interface Diagnostics Configuration

101Scan Class Performance Points

104Performance Counters Points

105Performance Counters

105Performance Counters for both (_Total) and (Scan Class x)

107Performance Counters for (_Total) only

109Performance Counters for (Scan Class x) only

111Interface Health Monitoring Points

116I/O Rate Point

118Interface Status Point

121Appendix A.Error and Informational Messages

121Message Logs

121Messages

125System Errors and PI Errors

126UniInt Failover Specific Error Messages

126Informational

127Errors (Phase 1 & 2)

128Errors (Phase 2)

129Appendix B.PI SDK Options

131Appendix C.OPC HDA Server Issues

131Browsing

131Disconnecting

133Appendix D.Debugging

135Appendix E.Technical Support and Resources

135Before You Call or Write for Help

135Help Desk and Telephone Support

136Search Support

136Email-based Technical Support

136Online Technical Support

137Remote Access

137On-site Service

137Knowledge Center

137Upgrades

139Appendix F.Revision History

Terminology

To understand this interface manual, you should be familiar with the terminology used in this document.

Buffering

Buffering refers to an Interface Nodes ability to store temporarily the data that interfaces collect and to forward these data to the appropriate PI Servers.

N-Way Buffering

If you have PI Servers that are part of a PI Collective, PIBufss supports n-way buffering. N-way buffering refers to the ability of a buffering application to send the same data to each of the PI Servers in a PI Collective. (Bufserv also supports n-way buffering to multiple PI Server however it does not guarantee identical archive records since point compressions specs could be different between PI Servers. With this in mind, OSIsoft recommends that you run PIBufss instead.)

ICU

ICU refers to the PI Interface Configuration Utility. The ICU is the primary application that you use to configure PI interface programs. You must install the ICU on the same computer on which an interface runs. A single copy of the ICU manages all of the interfaces on a particular computer.

You can configure an interface by editing a startup command file. However, OSIsoft discourages this approach. Instead, OSIsoft strongly recommends that you use the ICU for interface management tasks.

ICU Control

An ICU Control is a plug-in to the ICU. Whereas the ICU handles functionality common to all interfaces, an ICU Control implements interface-specific behavior. Most PI interfaces have an associated ICU Control.

Interface Node

An Interface Node is a computer on which

the PI API and/or PI SDK are installed, and

PI Server programs are not installed.

PI API

The PI API is a library of functions that allow applications to communicate and exchange data with the PI Server. All PI interfaces use the PI API.

PI Collective

A PI Collective is two or more replicated PI Servers that collect data concurrently. Collectives are part of the High Availability environment. When the primary PI Server in a collective becomes unavailable, a secondary collective member node seamlessly continues to collect and provide data access to your PI clients.

PIHOME

PIHOME refers to the directory that is the common location for PI 32-bit client applications.

A typical PIHOME on a 32-bit operating system is C:\Program Files\PIPC.

A typical PIHOME on a 64-bit operating system is C:\Program Files (x86)\PIPC.PI 32-bit interfaces reside in a subdirectory of the Interfaces directory under PIHOME.

For example, files for the 32-bit Modbus Ethernet Interface are in [PIHOME]\PIPC\Interfaces\ModbusE.

This document uses [PIHOME] as an abbreviation for the complete PIHOME or PIHOME64 directory path. For example, ICU files in [PIHOME]\ICU.

PIHOME64

PIHOME64 is found only on a 64-bit operating system and refers to the directory that is the common location for PI 64-bit client applications.

A typical PIHOME64 is C:\Program Files\PIPC.

PI 64-bit interfaces reside in a subdirectory of the Interfaces directory under PIHOME64.

For example, files for a 64-bit Modbus Ethernet Interface would be found in C:\ProgramFiles\PIPC\Interfaces\ModbusE.

This document uses [PIHOME] as an abbreviation for the complete PIHOME or PIHOME64 directory path. For example, ICU files in [PIHOME]\ICU.PI Message Log

The PI message Log is the file to which OSIsoft interfaces based on UniInt 4.5.0.x and later writes informational, debug and error message. When a PI interface runs, it writes to the local PI message log. This message file can only be viewed using the PIGetMsg utility. See the UniInt Interface Message Logging.docx file for more information on how to access these messages.PI SDK

The PI SDK is a library of functions that allow applications to communicate and exchange data with the PI Server. Some PI interfaces, in addition to using the PI API, require the use of the PI SDK.

PI Server Node

A PI Server Node is a computer on which PI Server programs are installed. The PI Server runs on the PI Server Node.

PI SMT

PI SMT refers to PI System Management Tools. PI SMT is the program that you use for configuring PI Servers. A single copy of PI SMT manages multiple PI Servers. PI SMT runs on either a PI Server Node or a PI Interface Node.Pipc.log

The pipc.log file is the file to which OSIsoft applications write informational and error messages. When a PI interface runs, it writes to the pipc.log file. The ICU allows easy access to the pipc.log.

Point

The PI point is the basic building block for controlling data flow to and from the PI Server. For a given timestamp, a PI point holds a single value.

A PI point does not necessarily correspond to a point on the foreign device. For example, a single point on the foreign device can consist of a set point, a process value, an alarm limit, and a discrete value. These four pieces of information require four separate PI points.

Service

A Service is a Windows program that runs without user interaction. A Service continues to run after you have logged off from Windows. It has the ability to start up when the computer itself starts up.

The ICU allows you to configure a PI interface to run as a Service.

Tag (Input Tag and Output Tag)

The tag attribute of a PI point is the name of the PI point. There is a one-to-one correspondence between the name of a point and the point itself. Because of this relationship, PI System documentation uses the terms tag and point interchangeably.

Interfaces read values from a device and write these values to an Input Tag. Interfaces use an Output Tag to write a value to the device.Chapter 1. Introduction

The PI OPC HDA Interface is an OPC HDA COM interface for bi-directional data transfer between an OPC HDA Server and an OSIsoft PI System. The interface accesses data from the OPC HDA Server. The design of the interface allows running multiple instances of the interface simultaneously. Each interface is able to connect with only one OPC HDA Server, which may be on the same or a different machine. More than one interface may be configured to connect to the same OPC HDA Server. The interface may reside on a PI home node or a PI Interface node.

This interface is designed only for an Intel platform. It requires both the PI API and the PI SDK.Note: The value of [PIHOME] variable for the 32-bit interface will depend on whether the interface is being installed on a 32-bit operating system (C:\ProgramFiles\PIPC) or a 64bit operating system (C:\ProgramFiles(x86)\PIPC). The value of [PIHOME64] variable for a 64-bit interface will be C:\ProgramFiles\PIPC on the 64-bit Operating system.In this documentation [PIHOME] will be used to represent the value for either [PIHOME] or [PIHOME64]. The value of [PIHOME] is the directory which is the common location for PI client applications.Note: Throughout this manual there are references to where messages are written by the interface which is the PIPC.log. This interface has been built against a of UniInt version (4.5.0.59 and later) which now writes all its messages to the local PI Message log.

Please note that any place in this manual where it references PIPC.log should now refer to the local PI message log. Please see the document UniInt Interface Message Logging.docx in the %PIHOME%\Interfaces\UniInt directory for more details on how to access these messages.Reference Manuals

OSIsoftPI Server manuals

PI API Installation manual

UniInt Interface User Manual

VendorThe OPC standards are available from the OPC Foundation at http://www.opcfoundation.org.

This interface uses the OPC Historical Data Access Specification Version 1.20Supported Features

FeatureSupport

Part NumberPI-IN-OS-OPCHDA-NT

* Platforms32-bit Interface64-bit Interface

Windows XP

32-bit OSYesNo

64-bit OSYes (Emulation Mode)No

Windows 2003 Server

32-bit OSYesNo

64-bit OSYes (Emulation Mode)No

Windows Vista

32-bit OSYesNo

64-bit OSYes (Emulation Mode)No

Windows 2008

32-bit OSYesNo

Windows 2008 R2

64-bit OSYes (Emulation Mode)No

Windows 7

32-bit OSYesNo

64-bit OSYes (Emulation Mode)No

Auto Creates PI PointsAPS Connector

Point Builder UtilityYes

ICU ControlYes

PI Point TypesFloat16 / Float32 / Float64 / Int16 / Int32 / Digital / String

Sub-second TimestampsYes

Sub-second Scan ClassesYes

Automatically Incorporates PIPoint Attribute ChangesYes

Exception ReportingDone by interface

*Outputs from PIYes

Inputs to PI: Scan-based / Unsolicited / Event TagsScan-based / Unsolicited / Event Tags

Supports Questionable BitYes

Supports Multi-character PointSourceYes

Maximum Point CountUnlimited

* Uses PI SDKYes

PINet String SupportNo

* Source of TimestampsOPC HDA Server

* History RecoveryYes

* UniInt-based

Disconnected Startup

* SetDeviceStatusYesNoYes

FailoverUniInt Failover (Phase 2 Warm , Cold); Server-level failover

* Vendor Software Required on PI Interface Node / PINet NodeNo

Vendor Software Required on Foreign DeviceYes

Vendor Hardware RequiredNo

Additional PI Software Included with InterfaceYes

Device Point TypesSee below

Serial-Based InterfaceNo

* See available paragraphs below for further explanation.PlatformsThe Interface is designed to run on the above mentioned Microsoft Windows operating systems.

Outputs from PI

The OPCHDA Server must have the method: SyncUpdate::InsertReplace implemented for outputs from PI to work. Not all OPCHDA Servers implement this optional method. Honeywell Experion OPCHDA Server does not implement this method.

Uses PI SDKThe PI SDK and the PI API are bundled together and must be installed on each PI Interface node. This Interface does not specifically make PI SDK calls.

Source of Timestamps

The interface uses the timestamps from the OPC HDA Server. The timestamps will be adjusted to the time difference from the OPC HDA Server and the PI Server.

It is possible to use the /TSU command-line parameter to adjust this behavior of the interface.

/TSU is an option that must be selected with caution. With this option, the timestamps received from the OPCHDA Server will be sent to the PI Server directly without any adjustments. If the OPC Server time is ahead of the PI Server time, this option will result in the PI Server receiving timestamps that are in the future. Consequently, the data will not be written to the PI Server. The user should select this option only if the clock settings on both servers are appropriate (i.e. either the same or the PI Server clock is ahead) and the clocks are either automatically synchronized or clock checks are made frequently. If the user is getting error 11049 in the pipc.log file, the clocks on the PI Server and on the interface node must be checked. This error will occur when the interface has sent a timestamp that is outside of the range for the PI archives.History Recovery

History recovery is performed at interface startup and when the connection to the OPC HDA Server has been re-established after a loss of connection. On a per-point basis (for both scanned and event tags), 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. In this context a good PI Archive value means one that is not a system digital state. System digital state values within the history recovery time period are deleted from PI. UniInt-based

UniInt stands for Universal Interface. UniInt is not a separate product or file; it is an OSIsoftdeveloped template used by developers, and is integrated into many interfaces, including this interface. The purpose of UniInt is to keep a consistent feature set and behavior across as many of OSIsofts interfaces as possible. It also allows for the very rapid development of new interfaces. In any UniInt-based interface, the interface uses some of the UniIntsupplied configuration parameters and some interface-specific parameters. UniInt is constantly being upgraded with new options and features.

The UniInt Interface User Manual is a supplement to this manual.SetDeviceStatus

The Interface is built with a version of UNIINT that is higher than 4.3.0.x and that supports interface health points. The health point with the point attribute Exdesc = [UI_DEVSTAT], is used to represent the status of the source devices.

The following events can be written to the point:

GoodThe interface is properly communicating and reading data from the devices. If no data collection points have been defined, this indicates the interface has successfully started.

3 | 1 devices(s) in error The interface has determined that the listed device(s) are offline. A device is considered offline when the connection to the HDA Server has failed.

Please refer to the UniInt Interface User Manual for more information on how to configure interface health points.Failover

Server-Level Failover This interface supports server-level failover which allows the interface to continue to collect data from the currently active OPC HDA server when two servers are running in unison and the primary server shutdown or an unexpected communication failure occurs.UniInt Failover Support

UniInt Phase 2 Failover provides support for cold, warm, or hot failover configurations. The Phase 2 hot failover results in a no data loss solution for bi-directional data transfer between the PI Server and the Data Source given a single point of failure in the system architecture similar to Phase 1. However, in warm and cold failover configurations, you can expect a small period of data loss during a single point of failure transition. This failover solution requires that two copies of the interface be installed on different interface nodes collecting data simultaneously from a single data source. Phase 2 Failover requires each interface have access to a shared data file. Failover operation is automatic and operates with no user interaction. Each interface participating in failover has the ability to monitor and determine liveliness and failover status. To assist in administering system operations, the ability to manually trigger failover to a desired interface is also supported by the failover scheme.

The failover scheme is described in detail in the UniInt Interface User Manual, which is a supplement to this manual. Details for configuring this Interface to use failover are described in the UniInt Failover Configuration section of this manual.

Vendor Software Required The OPC HDA Server may run on the same system as the interface, or it may run on another system. Additional PI Software

The PI HDA Tool is an OSIsoft product that ships with the interface to assist in configuring and troubleshooting of the interface.

Device Point Types

By default, the interface will request the following data types:

PI PointTypeOPC HDA Server Data Type

Digital2-byte Integer (VT_I2)

Int162-byte Integer (VT_I2)

Int324-byte Integer (VT_I4)

Float324-byte Float (VT_R4)

Float648-byte Float (VT_R8)

StringString (VT_BSTR)

Diagram of Hardware ConnectionConfiguration 1: Preferred Configuration

This configuration is the simplest and allows data buffering on the interface node.

Configuration 2: Common Configuration

This configuration allows data buffering on the interface node and it is recommended to have all machines in the same domain.

Configuration 3: Alternate Configuration

This configuration is possible, but not the preferred configuration. Having the interface and the PI server compete for resources can impair efficiency.

Note: All configurations require DCOM settings, and it is recommended using buffering even when the interface runs on the PI Server node.

Chapter 2. Principles of Operation

The PI OPC HDA Interface is an OPC HDA client that allows the PI System 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 Server. If OPC HDA server is unavailable, the interface will attempt to connect every 5 seconds until successful. If the PI Server 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 PI Server, to eliminate any differences due to clock drift.

The interface goes on to identify the PI tags 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 tags is properly configured so that it knows what data to collect from the OPC HDA Server. An incorrectly configured tag is rejected and a message is sent to the log file. Once the properly configured PI tags 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.

The interface supports the SyncRead::ReadRaw and SyncRead::ReadProcessed method. This requires setting up scan classes to control how frequently to collect data from the OPC HDA server.

For Event reads, the PI Server 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 tags attached to that trigger. All data since the last read will be processed using the SyncRead::ReadRaw method.

If communication between the interface and the OPC HDA Server is lost, the interface will periodically try to reestablish the connection. All the historical data for when the connection was down will be recovered after communication is re-established and then data collection will resume. If communication between the interface and the PI Server is lost, the interface will still collect data and the interface will periodically attempt to re-establish communication. If PI API Buffering is enabled, no data is lost. If buffering is not enabled data is lost.

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 tag 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.

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 timestamp of the sourcetag. If the item has a value at the specified timestamp, the new value and quality will replace the old one. If there is no value at that timestamp, the function will insert the new data. If the soucetags 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 tag 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 tag updates every 2 minutes. However, if it finds that at least 25 tags 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 tags 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 tags 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, PI Server 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.Transformations and Scaling

While OPC Servers can perform their own transformations and scaling, some users have found that the desired functions are not filled by their server. In this case, configure the PI points so that the interface will perform transformations and scaling. Note that transformation and scaling happens before the value is compared to the exception parameters for the tag, so the exception parameters are applied to the value that would be sent to PI, rather than to the raw value. The Transformation and Scaling calculations are the same as the PIOPC interface.Scaling

Scaling is fairly complex and is controlled by the TotalCode and SquareRoot properties of the tag. Since were limited in what information we can get about the tag, the Convers attribute is used to carry the Span of the device, and the ExDesc does further duty to carry the device Zero (Dzero). The interface can then translate a value from the scale of what the device can send to the scale of the actual tag.

If TotalCode is zero, the only scaling performed is based on the value of SquareRoot. If Square Root is a 1, the value read will be squared before sending it to PI, and for an output value the square root will be taken before writing to the device. If SquareRoot is a 2, the opposite happens: for values read from the device, the square root of the value read will be sent to PI, while output values will be squared before sending them to the device.

If TotalCode is non-zero, some other scaling may be performed, either to transform the value read into another scale of measurement or to apply an offset or conversion factor. Just as the value stored in the tag ranges from (Zero) to (Zero + Span), so too the values read from or written to the device can range from (Dzero) to (Dzero +Convers). This allows the value stored in PI to be a simple transformation from one scale to another. The SquareRoot attribute can be used to specify that the square or square root of the value should be used rather than the value itself. In other cases, the Convers value may be added to or subtracted from the value, or may be used as a multiplier, or applied as a bit mask. Again, the SquareRoot attribute may specify using the square or square root of the value, rather than the raw value, as the input to the formula.

Scaling is only supported for numeric tags. A tag may be defined in PI as a number, yet the OPC Server reads and writes the Item as a string, and those tags would support scaling. But if the PI tag is defined as a string, any scaling will be ignored.

The table below covers all the scaling formulas currently used. Again, if SquareRoot is a 1 or a 2, the square root or square of the value will be calculated first, and then the formula will be applied.

ConversTotalCodeSquareRootDzeroOperation

000Dont careValue = value

001Dont careInput tags: Value = (Value)2Output tags: Value = (Value)0.5

002Dont careInput tags: Value = (Value)0.5 Output tags: Value = (Value)2

Not 010DefinedInput tags: Value = [ (Value Dzero) / Convers ] * Span + ZeroOutput tags: Value = [ (Value Zero) / Span] * Convers + Dzero

Not 011DefinedInput tags: Value = [ ((Value)2 Dzero) / Convers ] * Span + ZeroOutput tags: Value = [ ((Value)0.5 Zero) / Span] * Convers + Dzero

Not 012DefinedInput tags: Value = [ ((Value)0.5 Dzero) / Convers ] * Span + ZeroOutput tags: Value = [ ((Value)2 Zero) / Span] * Convers + Dzero

Not 020Dont careInput tags: Value = Value * ConversOutput tags: Value = Value / Convers

Not 021Dont careInput tags: Value = (Value)2 * ConversOutput tags: Value = (Value)0.5 / Convers

Not 022Dont careInput tags: Value = (Value)0.5 * ConversOutput tags: Value = (Value)2 / Convers

Not 030DefinedInput tags: Value = (Value / Convers) DzeroOutput tags: Value = (Value + Dzero) * Convers

Not 031DefinedInput tags: Value = ((Value)2 / Convers) DzeroOutput tags: Value = ((Value)0.5 + Dzero) * Convers

Not 032DefinedInput tags: Value = ((Value)0.5 / Convers) DzeroOutput tags: Value = ((Value)2 + Dzero) * Convers

Not 040DefinedInput tags: Value = (Value Dzero)/ ConversOutput tags: Value = (Value * Convers) + Dzero

Not 041DefinedInput tags: Value = ((Value)2 Dzero)/ ConversOutput tags: Value = ((Value)0.5 * Convers) + Dzero

Not 042DefinedInput tags: Value = ((Value)0.5 Dzero)/ ConversOutput tags: Value = ((Value)2 * Convers) + Dzero

Not 050Dont careInput tags: Value = Value + ConversOutput tags: Value = Value Convers

Not 051Dont careInput tags: Value = (Value)2 + ConversOutput tags: Value = (Value)0.5 Convers

Not 052Dont careInput tags: Value = (Value)0.5 + ConversOutput tags: Value = (Value)2 Convers

Not 06Dont careDont careInput tags: Value = Value AND ConversOutput tags: Value = Value AND Convers

Not 07Dont careDont careInput tags: Value = Value OR ConversOutput tags: Value = Value OR Convers

Not 08Dont careDont careInput tags: Value = Value XOR ConversOutput tags: Value = Value XOR Convers

UniInt Failover

This interface supports UniInt failover. Refer to the UniInt Failover Configuration section of this document for configuring the interface for failover.Chapter 3. Installation ChecklistIf you are familiar with running PI data collection interface programs, this checklist helps you get the Interface running. If you are not familiar with PI interfaces, return to this section after reading the rest of the manual in detail.

This checklist summarizes the steps for installing this Interface. You need not perform a given task if you have already done so as part of the installation of another interface. For example, you only have to configure one instance of Buffering for every Interface Node regardless of how many interfaces run on that node.

The Data Collection Steps below are required. Interface Diagnostics and Advanced Interface Features are optional.

Data Collection Steps

1. Confirm that you can use PI SMT to configure the PI Server. You need not run PI SMT on the same computer on which you run this Interface.

2. If you are running the Interface on an Interface Node, edit the PI Servers Trust Table to allow the Interface to write data.

3. Run the installation kit for the PI Interface Configuration Utility (ICU) on the interface node. This kit runs the PI SDK installation kit, which installs both the PI API and the PI SDK.

4. Run the installation kit for this Interface. .

5. If you are running the Interface on an Interface Node, check the computers time zone properties. An improper time zone configuration can cause the PI Server to reject the data that this Interface writes.

6. Run the ICU and configure a new instance of this Interface. Essential startup parameters for this Interface are

Point Source (/PS=x)Interface ID (/ID=#)PI Server (/Host=host:port) Scan Class (/F=##:##:##,offset)7. Use the Connection Tool to confirm connection between the Interface Node and the device.

8. If you will use digital points, define the appropriate digital state sets.

9. Build input tags and, if desired, output tags for this Interface. Important point attributes and their use are:

Location1 specifies the Interface instance ID

Location2 specifies whether to store the quality or value. If location2=1, interface stores point quality rather than point value. Location3 specifies tag type (either scanned or output). If location3=0, the point is an input tag; if location3=2, the point is an output tag. Location4 specifies the scan class.Location5 specifies treatment of data with uncertain quality:

If location5=0, interface flags data with uncertain quality as questionable when sending to PI.

If locatation5=1, interface sets the digital state of data with uncertain quality to Bad Quality.

If location5=2, interface treats data with uncertain quality as good quality and does not flag the data. ExDesc specifies long ItemID. InstrumentTag specifies ItemID for the tag (unless specified in ExDesc). 10. Start the Interface interactively and confirm its successful connection to the PI Server without buffering.

11. Confirm that the Interface collects data successfully.

12. Stop the Interface and configure a buffering application (either Bufserv or PIBufss). When configuring buffering use the ICU menu item Tools ( Buffering ( Buffering Settings to make a change to the default value (32678) for the Primary and Secondary Memory Buffer Size (Bytes) to 2000000. This will optimize the throughput for buffering and is recommended by OSIsoft.13. Start the buffering application and the Interface. Confirm that the Interface works together with the buffering application by either physically removing the connection between the Interface Node and the PI Server Node or by stopping the PI Server.

14. Configure the Interface to run as a Service. Confirm that the Interface runs properly as a Service.

15. Restart the Interface Node and confirm that the Interface and the buffering application restart.

Interface Diagnostics

16. Configure Scan Class Performance points.

17. Install the PI Performance Monitor Interface (Full Version only) on the Interface Node.

18. Configure Performance Counter points.

19. Configure UniInt Health Monitoring points

20. Configure the I/O Rate point.

21. Install and configure the Interface Status Utility on the PI Server Node.

22. Configure the Interface Status point.

Advanced Interface Features

23. Configure UniInt Failover; see that section in this document for details related to configuring the interface for failover.Chapter 4. Interface Installation

OSIsoft recommends that interfaces be installed on a PI Interface Nodes instead of directly on the PIServer node. A PI Interface Node is any node other than the PI Server node where the PIApplication Programming Interface (PI API) has been installed (see the PI APImanual). With this approach, the PI Server need not compete with interfaces for the machines resources. The primary function of the PIServer is to archive data and to service clients that request data.

After the interface has been installed and tested, Buffering should be enabled on the PI Interface Node. Buffering refers to either PI API Buffer Server (Bufserv) or the PI Buffer Subsystem (PIBufss). For more information about Buffering see the Buffering section of this manual.In most cases, interfaces on PI Interface Nodes should be installed as automatic services. Services keep running after the user logs off. Automatic services automatically restart when the computer is restarted, which is useful in the event of a power failure.

The guidelines are different if an interface is installed on the PI Server node. In this case, the typical procedure is to install the PI Server as an automatic service and install the interface as an automatic service that depends on the PI Update Manager and PI Network Manager services. This typical scenario assumes that Buffering is not enabled on the PI Server node. Bufserv can be enabled on the PI Server node so that interfaces on the PI Server node do not need to be started and stopped in conjunction with PI, but it is not standard practice to enable buffering on the PI Server node. The PI Buffer Subsystem can also be installed on the PI Server. See the UniInt Interface User Manual for special procedural information.

Naming Conventions and Requirements

In the installation procedure below, it is assumed that the name of the interface executable is PIOPCHDAInt.exe and that the startup command file is called PIOPCHDAInt.bat.

When Configuring the Interface Manually

It is customary for the user to rename the executable and the startup command file when multiple copies of the interface are run. For example, PIOPCHDAInt1.exe and PIOPCHDAInt1.bat would typically be used for interface number 1, PIOPCHDAInt2.exe and PIOPCHDAInt2.bat for interface number 2, and so on. When an interface is run as a service, the executable and the command file must have the same root name because the service looks for its command-line parameters in a file that has the same root name.

Interface Directories

PIHOME Directory Tree

32-bit Interfaces

The [PIHOME] directory tree is defined by the PIHOME entry in the pipc.iniconfiguration file. This pipc.ini file is an ASCII text file, which is located in the %windir% directory. For 32-bit operating systems a typical pipc.ini file contains the following lines:

[PIPC]PIHOME=C:\ProgramFiles\PIPCFor 64-bit operating systems a typical pipc.ini file contains the following lines:

[PIPC]PIHOME=C:\ProgramFiles (X86)\PIPCThe above lines define the root of the PIHOME directory on the C: drive. The PIHOME directory does not need to be on the C: drive. OSIsoft recommends using the paths shown above as the root PIHOME directory name. Interface Installation Directory

The interface install kit will automatically install the interface to:

PIHOME\Interfaces\OPCHDAIntPIHOME is defined in the pipc.ini file.A new interface installation will create two subdirectories: PI-OPC Tools and PI_HDATool. Installed in the PIHOME directory, the PI_HDATool directory is a subdirectory of the PI-OPC Tools directory:

PIHOME\PI-OPC Tools\PI_HDATool

Interface Installation Procedure

The PI OPC HDA Interface setup program uses the services of the Microsoft Windows Installer. Windows Installer is a standard part of Windows 2000 and greater operating systems. To install, run the appropriate installation kit.

Installing Interface as a Windows Service

The PI OPC HDA Interface service can be created, preferably, with the PIInterfaceConfigurationUtility, or can be created manually.Installing Interface Service with PIInterfaceConfigurationUtilityThe PIInterfaceConfigurationUtility provides a user interface for creating, editing, and deleting the interface service:

Service Configuration

Service name

The Service name box shows the name of the current interface service. This service name is obtained from the interface executable.ID

This is the service id used to distinguish multiple instances of the same interface using the same executable. Display name

The Display Name text box shows the current Display Name of the interface service. If there is currently no service for the selected interface, the default Display Name is the service name with a PI- prefix. Users may specify a different Display Name. OSIsoft suggests that the prefix PI- be appended to the beginning of the interface to indicate that the service is part of the OSIsoft suite of products.Log on as

The Log on as text box shows the current Log on as Windows User Account of the interface service. If the service is configured to use the Local System account, the Log on as text box will show LocalSystem. Users may specify a different Windows User account for the service to use.

Password

If a Windows User account is entered in the Log on as text box, then a password must be provided in the Password text box, unless the account requires no password.

Confirm password

If a password is entered in the Password text box, then it must be confirmed in the Confirm Password text box.Dependencies

The Installed services list is a list of the services currently installed on this machine. Services upon which this interface is dependent should be moved into the Dependencies list using the button. For example, if API Buffering is running, then bufserv should be selected from the list at the right and added to the list on the left. To remove a service from the list of dependencies, use the button, and the service name will be removed from the Dependencies list.

When the interface is started (as a service), the services listed in the dependency list will be verified as running (or an attempt will be made to start them). If the dependent service(s) cannot be started for any reason, then the interface service will not run.

Note: Please see the PI Log and Windows Event Logger for messages that may indicate the cause for any service not running as expected.

- Add Button

To add a dependency from the list of Installed services, select the dependency name, and click the Add button.

- Remove Button

To remove a selected dependency, highlight the service name in the Dependencies list, and click the Remove button.

The full name of the service selected in the Installed services list is displayed below the Installed services list box.

Startup Type

The Startup Type indicates whether the interface service will start automatically or needs to be started manually on reboot.If the Auto option is selected, the service will be installed to start automatically when the machine reboots.

If the Manual option is selected, the interface service will not start on reboot, but will require someone to manually start the service.

If the Disabled option is selected, the service will not start at all.

Generally, interface services are set to start automatically.Create

The Create button adds the displayed service with the specified Dependencies and with the specified Startup Type.

Remove

The Remove button removes the displayed service. If the service is not currently installed, or if the service is currently running, this button will be grayed out. Start or Stop Service

The toolbar contains a Start button and a Stop button . If this interface service is not currently installed, these buttons will remain grayed out until the service is added. If this interface service is running, the Stop button is available. If this service is not running, the Start button is available.

The status of the Interface service is indicated in the lower portion of the PI ICU dialog.

Installing Interface Service ManuallyHelp for installing the interface as a service is available at any time with the command:PIOPCHDAInt.exe help

Open a Windows command prompt window and change to the directory where the PIOPCHDAInt1.exe executable is located. Then, consult the following table to determine the appropriate service installation command.Windows Service Installation Commands on a PI Interface Node or a PI Server Node with Bufserv implemented

Manual servicePIOPCHDAInt.exe -install -depend "tcpip bufserv"

Automatic servicePIOPCHDAIntexe -install -auto -depend "tcpip bufserv"

*Automatic service with service idPIOPCHDAInt.exe -serviceid X -install -auto -depend "tcpip bufserv"

Windows Service Installation Commands on a PI Interface Node or a PI Server Node without Bufserv implemented

Manual servicePIOPCHDAIntexe -install -depend tcpip

Automatic servicePIOPCHDAInt.exe -install -auto -depend tcpip

*Automatic service with service idPIOPCHDAInt.exe -serviceid X -install -auto -depend tcpip

*When specifying service id, the user must include an id number. It is suggested that this number correspond to the interface id (/id) parameter found in the interface .bat file.Check the Microsoft Windows Services control panel to verify that the service was added successfully. The services control panel can be used at any time to change the interface from an automatic service to a manual service or vice versa.

Chapter 5. DCOM ConfigurationAll OPC HDA servers and clients are based on Microsofts DCOM technology. DCOM is the network connection protocol that allows communication between machines through the network. This type of communication requires proper DCOM configuration for all DCOM applications. Hence both OPC HDA client and server machines must have proper DCOM settings permitting them to securely access one another remotelyThere are two major steps that must be taken to properly configure DCOM permissions:

24. DCOM configuration for OPC HDA Server application on an OPC HDA Server node;

25. DCOM configuration for default permissions on a PI OPC HDA Interface node.

The general steps for DCOM configuration are similar. However depending on whether the machines are within the same domain or different domains, or even no domain, the sequence of steps will be different.OPCEnum Tool

The OPC Foundation has provided a tool to allow OPC HDA clients to locate servers on remote nodes, without having information about those servers in the local registry. This tool is called OPCEnum and is freely distributed by the OPC Foundation. The PI OPC HDA interface installation installs OPCEnum as well. The primary function of OPCEnum is to inform or request information from other instances of OPCEnum about existing OPC HDA Servers on the local system. When OPCEnum is installed, it grants Launch and Access DCOM permission to Everyone and sets the Authentication level to NONE. This allows access to any user who can log on to the system. The permissions can be changed using dcomcnfg.exe.

While the interface, DCOM, and the PI_HDATool only require NT 4.0 with Service Pack 3, OPCEnum requires at least SP4 and Internet Explorer 4 or higher be installed. See the PI_HDATool documentation for more information about OPCEnum and how to use it.

General Steps for DCOM Configuration

DCOM configuration can be done with the DCOM Configuration utility (dcomcnfg.exe) that comes with the Windows OS. In order to be able to use this utility, the user must be logged in with administrators privileges. This utility allows for the configuration of special security rules for all DCOM objects on the local node. The DCOM Configuration utility may look slightly different and setting options may differ, depending on the version of the Windows OS.

For detail information on how to configure DCOM, please refer to the DCOMConfigurationGuide.pdf found in the [PIHOME]\PI-OPC Tools\DCOM Guide\ directory.OPC HDA Server Registration

If the PI_HDATool does not list the OPC HDA server when running the tool on the same machine as the OPC HDA Server, register it using the command:

servername.exe -regserver (to unregister use unregserver)

This command should work for most servers.

Do a search on all hard drives for opcproxy.dll (this comes with the OPC HDA server). Make sure there is only one version on the machine. More than one copy of the file should not be a problem if they are all same version. If there are multiple versions, rename all but the latest one and keep it in the \winnt\system32 directory.

Then register the following DLLs. Make sure opcproxy.dll and opccomn_ps.dll exist in the \winnt\system32 directory. Run

C:>regsvr32 opcproxy.dll

The following dialog box should open:

Then run:

C:>regsvr32 opccomn_ps.dll

The following dialog box should open:

Click OK to complete this procedure.

Chapter 6. PI_HDATool

The OPC HDA Interface includes the PI_HDATool to help you install and troubleshoot the PI OPC HDA Interface and OPC HDA Server(s). The tool consists of an executable file, PI_HDATool.exe, which you can run by double-clicking the file name in Windows Explorer or My Computer. The interface installs the tool into the PIHOME\PI OPC Tools\PI_HDATool directory. You can find a manual describing the tool in the same directory.

The general purpose of PI_HDATool is to verify that a connection from the Interface node can be made to the OPC HDA Server and data read and optionally written. If the OPC HDA Server is on a different node than the Interface and PI_HDATool, OPCEnum must be installed on both machines. If a connection cannot be established using the PI_HDATool, then the PI OPC HDA Interface will also fail to connect to that OPC HDA Server.

PI_HDATool can also be used to read from and write data to the OPC HDA Server. If successful in reading data from the OPC HDA Server by using the Synchronous ReadRaw button in the PI_HDATool, the PI OPC HDA Interface should also be able to read and write data.

Note: If able to connect and read/write points from/to an OPC HDA Server with the PI_HDATool, but not with the Interface, then check the DCOM settings and the Userid under which the interface is running.Chapter 7. Digital States

This interface does not require any specific digital states. However, you must create digital states before creating digital points. 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 PIdigital tags and editing digital state sets, see the PI Server manuals.

An interface point that contains discrete data can be stored in PI as a digital tag. A Digitaltag associates discrete data with a digital state set, as specified by the user.

System Digital State Set

Similar to digital state sets is the system digital state set. This set is used for all tags, regardless of type to indicate the state of a tag at a particular time. For example, if the interface receives bad data from an interface point, it writes the system digital state badinput 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.Chapter 8. PointSource

The PointSource is a unique, single or multi-character string that is used to identify the PI point as a point that belongs to a particular interface. For example, the string Boiler1 may be used to identify points that belong to the MyInt Interface. To implement this, the PointSource attribute would be set to Boiler1 for every PI Point that is configured for the MyInt Interface. Then, if /ps=Boiler1 is used on the startup command-line of the MyInt Interface, the Interface will search the PI Point Database upon startup for every PI point that is configured with a PointSource of Boiler1. Before an interface loads a point, the interface usually performs further checks by examining additional PI point attributes to determine whether a particular point is valid for the interface. For additional information, see the /ps parameter. If the PI API version being used is prior to 1.6.x or the PIServer version is prior to 3.4.370.x, the PointSource is limited to a single character unless the SDK is being used.

Case-sensitivity for PointSource Attribute

The PointSource character that is supplied with the /ps command-line parameter is not case sensitive. That is, /ps=P and /ps=p are equivalent. Reserved Point Sources

Several subsystems and applications that ship with PI are associated with default PointSource characters. The Totalizer Subsystem uses the PointSource character T, the Alarm Subsystem uses G and @, Random uses R, RampSoak uses 9, and the Performance Equations Subsystem uses C. Do not use these PointSource characters or change the default point source characters for these applications. Also, if a PointSource character is not explicitly defined when creating a PIpoint; the point is assigned a default PointSource character of Lab (PI 3). Therefore, it would be confusing to use Lab as the PointSource character for an interface.

Note: Do not use a point source character that is already associated with another interface program. However it is acceptable to use the same point source for multiple instances of an interface.Chapter 9. PI Point Configuration

The PI point is the basic building block for controlling data flow to and from the PIServer. A single point is configured for each measurement value that needs to be archived.

Point Attributes

Use the point attributes below to define the PI point configuration for the Interface, including specifically what data to transfer.TagThe Tag attribute (or tagname) is the name for a point. There is a one-to-one correspondence between the name of a point and the point itself. Because of this relationship, PI documentation uses the terms tag and point interchangeably.

Follow these rules for naming PI points:

The name must be unique on the PI Server.

The first character must be alphanumeric, the underscore (_), or the percent sign (%).

Control characters such as linefeeds or tabs are illegal.

The following characters also are illegal: * ? ; { } [ ] | \ ` Length

Depending on the version of the PI API and the PI Server, this Interface supports tags whose length is at most 255 or 1023 characters. The following table indicates the maximum length of this attribute for all the different combinations of PI API and PI Server versions. PI APIPI ServerMaximum Length

1.6.0.2 or higher3.4.370.x or higher1023

1.6.0.2 or higherBelow 3.4.370.x255

Below 1.6.0.23.4.370.x or higher255

Below 1.6.0.2Below 3.4.370.x255

If the PI Server version is earlier than 3.4.370.x or the PI API version is earlier than 1.6.0.2, and you want to use a maximum tag length of 1023, you need to enable the PI SDK. See Appendix_B for information.PointSourceThe PointSource is a unique, single or multi-character string that is used to identify the PI point as a point that belongs to a particular interface. For additional information, see the /pscommand-line parameter and the PointSource section.PointTypeTypically, device point types do not need to correspond to PI point types. For example, integer values from a device can be sent to floating point or digital PI tags. Similarly, a floating-point value from the device can be sent to integer or digital PI tags, although the values will be truncated.

The interface supports the Float16, float32, float 64, int16, int32, digital, and string point types. For more information on the individual PointTypes, see PI Server manuals.

Note that not all OPC HDA Servers will support all these PI point types. Refer to the vendor-supplied documentation for your specific OPC HDA Server to determine what point types that server supports. If the point type defined in PI does not match the canonical data type defined in the OPC HDA Server, the interface will attempt to translate the data. Try using the PI_HDATool to read the point directly from the OPC HDA Server, this can help determine whether the PI PointType can be used for the data to be read.. Location1Location1 indicates to which copy of the Interface the point belongs. The value of this attribute must match the /id startup parameter.Location2For Input tags: Location2 indicates whether the tag stores the data value or the quality of the data:

0 Store the data value

1 Store the quality of the data

For Output tags: Location 2 indicates whether the tag sends the digital string for digital tags or the ordinal number (0,1,2,):0 Send the ordinal number

1 Send the digital stringLocation3Location3 indicates whether this tag is an Input or Output tag:0 or 1 Input

2 OutputLocation4Scan-based Inputs

For scan-based data collection, Location4 defines the scan class for the PI point. The scan class determines the frequency at which input points are scanned for new values. For more information, see the description of the /f parameter in the Startup Command File section.

Trigger-based Inputs, Unsolicited Inputs, and Output Points

Location 4 should be set to zero for these points.

Location5

Location5 indicates how the point handles data that has the quality of Uncertain:

0 Send Uncertain data to PI Server with the questionable bit set.

1 Store the digital state Bad Quality if the quality is Uncertain.

2 Treat Uncertain data as good-quality data.

Note that data can have a quality of Good, Uncertain, or Bad. If the quality is Bad, then the digital state Bad Input will be sent to PI Server.Quality Information

The data values from the HDA have a quality value of either Good, Uncertain, or Bad. Because the PI archive stores either the quality or the value, the interface will translate the qualities that are Uncertain to GOODSTAT, and set the questionable value parameter for the data value. This behavior can be changed on a point-by-point basis with the Location5 PI point attribute. Setting Location5=1 will cause the interface to store the digital state Bad Quality if the quality is Uncertain. If Location5=2, the interface will ignore the Uncertain quality, and treat the value as if it had good quality. Note: if Location 5 is set to anything other than 0, 1 or 2, the interface will write an error message for that tag and use the location 5 = 0 setting.QualityLocation5 = 0Location5 = 1Location5 = 2

GOODvaluevaluevalue

Questionablevalue, parameterdigital statevalue

BADdigital statedigital statedigital state

You can also store the quality in a separate PI tag, so both the values reported and also the qualities that came with those values are stored in PI, with no loss of granularity. Setting Location2=1 for a tag tells the interface to store the quality for the associated OPC HDA Item, rather than the value. Since OPC HDA qualities are unsigned, 32-bit integers, an Int32 PI tag must receive them. The values are stored in PI without any change, and their status is always GOOD. To understand what those quality values represent, please go to http://www.OPCfoundation.org and download the OPC HDA Data Access specifications, which contain a brief discussion of quality data.InstrumentTagInstrumentTag contains the ItemID for the tag. The format of this field depends on your specific OPC HDA Server. Refer to the documentation for the specific server to determine the proper format. This field must exactly match the point defined on the OPC HDA Server. That means punctuation, spaces, uppercase vs. lowercase, and so on.

Length

Depending on the version of the PI API and the PI Server, this Interface supports an InstrumentTag attribute whose length is at most 32 or 1023 characters. The following table indicates the maximum length of this attribute for all the different combinations of PI API and PI Server versions. PI APIPI ServerMaximum Length

1.6.0.2 or higher3.4.370.x or higher1023

1.6.0.2 or higherBelow 3.4.370.x32

Below 1.6.0.23.4.370.x or higher32

Below 1.6.0.2Below 3.4.370.x32

If the PI Server version is earlier than 3.4.370.x or the PI API version is earlier than 1.6.0.2, and you want to use a maximum InstrumentTag length of 1023, you need to enable the PI SDK. See Appendix B for information.

To verify an ItemID, use the PI_HDATool. If the server supports browsing, use List Servers Tags to see a list of defined ItemIDs. Double-clicking an ItemID in the tree will result in the full ItemID being displayed in the Item field. This is the ItemID to use in InstrumentTag.If the instrument tag for a point is longer than 32 characters and PI API 1.6 or better and PI 3.4.370x PI server are not installed, put the InstrumentTag in the Exended Descriptor attribute, using the form instr = whatever.the-OPC HDA/server*needs. Note that the InstrumentTag must exactly match the ItemID defined on the OPC HDA Server. If the InstrumentTag contains a comma, enclose the tagname with double quote characters (), such as:

Instr=whatever.you, or someone*needs*

ExDescYou can use the extended descriptor attribute for several purposes, such as indicating a point is a performance point, associating a trigger point with an input point, and specifying different ItemIDs for the timestamp and the point value. When using the field for multiple purposes, insert a comma between each definition.Length

Depending on the version of the PI API and the PI Server, this Interface supports an Extended Descriptor attribute whose length is at most 80 or 1023 characters. The following table indicates the maximum length of this attribute for all the different combinations of PI API and PI Server versions. PI APIPI ServerMaximum Length

1.6.0.2 or higher3.4.370.x or higher1023

1.6.0.2 or higherBelow 3.4.370.x80

Below 1.6.0.23.4.370.x or higher80

Below 1.6.0.2Below 3.4.370.x80

If the PI Server version is earlier than 3.4.370.x or the PI API version is earlier than 1.6.0.2, and you want to use a maximum ExDesc length of 1023, you need to enable the PI SDK. See Appendix B for information.

Performance Points

For UniInt-based interfaces, the extended descriptor is checked for the string PERFORMANCE_POINT. If this character string is found, UniInt treats this point as a performance point. See the section called Scan Class Performance Points.

Trigger-based Inputs For trigger-based input points, a separate trigger point must be configured. An input point is associated with a trigger point by entering a case-insensitive string in the extended descriptor (ExDesc) PI point attribute of the input point of the form:

keyword=trigger_tag_name

where keyword is replaced by event or trig and trigger_tag_name is replaced by the name of the trigger point. There should be no spaces in the string. UniInt automatically assumes that an input point is trigger-based instead of scan-based when the keyword=trigger_tag_name string is found in the extended descriptor attribute.

An input is triggered when a new value is sent to the Snapshot of the trigger point. The new value does not need to be different than the previous Snapshot value to trigger an input, but the timestamp of the new value must be greater than (more recent than) or equal to the timestamp of the previous value. This is different than the trigger mechanism for output points. For output points, the timestamp of the trigger value must be greater than (not greater than or equal to) the timestamp of the previous value.

Conditions can be placed on trigger events. Event conditions are specified in the extended descriptor as follows:

Event=trigger_tag_name event_condition

The trigger tag name must be in single quotes. For example,

Event=Sinusoid Anychange

will trigger on any event to the PI Tag sinusoid as long as the next event is different than the last event. The initial event is read from the snapshot.

The keywords in the following table can be used to specify trigger conditions.

Event ConditionDescription

AnychangeTrigger on any change as long as the value of the current event is different than the value of the previous event. System digital states also trigger events. For example, an event will be triggered on a value change from 0 to Bad Input, and an event will be triggered on a value change from Bad Input to 0.

IncrementTrigger on any increase in value. System digital states do not trigger events. For example, an event will be triggered on a value change from 0 to 1, but an event will not be triggered on a value change from Pt Created to 0. Likewise, an event will not be triggered on a value change from 0 to Bad Input.

DecrementTrigger on any decrease in value. System digital states do not trigger events. For example, an event will be triggered on a value change from 1 to 0, but an event will not be triggered on a value change from Pt Created to 0. Likewise, an event will not be triggered on a value change from 0 to Bad Input.

NonzeroTrigger on any non-zero value. Events are not triggered when a system digital state is written to the trigger tag. For example, an event is triggered on a value change from Pt Created to 1, but an event is not triggered on a value change from 1 to Bad Input.

Sending Timestamp and Output Value to Different ItemIDs

Specify the timestamp ItemID in ExDesc when you want to write the output value to one ItemID and the corresponding timestamp to a different ItemID. In this case, the ItemID specified in the InstrumentTag field or in the ExDesc field as instr=ItemId will contain the value, and the ItemID specified in the ExDesc field will contain the timestamp that goes with that value. Again, the ItemID string must match exactly the ItemID on the OPC Server.

There are two formats, depending on the data type of the ItemID that receives the timestamp.

FormatDescription

Tim=ItemID Interface writes the timestamp as a string (VT_BSTR) formatted according to the /TF setting in the startup file. In this format, the timestamp matches the PI Server timestamp, and is not adjusted for differences in time zone or daylight saving time settings.

Dat=ItemID Interface writes the timestamp as a VT_DATE. In this format, the timestamp is in universal (UTC) format, and has no dependency on the time zone or daylight saving time setting.

The timestamp written to the OPC Server is the same timestamp seen on the PI machine when looking at the archive timestamp.

Timestamp Strings

You can only specify one format string for an instance of the interface. If you must process more than one format of timestamp, then you must use more than one copy of the interface. The interface will make a copy of the format string, and will then replace the tokens with the actual values, to create a string. To read a string, it will look for numbers that are in the same position as the tokens, and use those numbers as values.

The tokens that the interface recognizes in the /TF parameter are:

TokenDescription

cc2-digit century

yy2-digit year

mn2-digit month

monmonth as a 3-character abbreviation, one of the following:

Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec

dd2-digit day

hh2-digit hour from 0 to 23

hr2-digit hour from 0 to 12

mm2-digit minute

ss2-digit second

03-digit milliseconds

XMeither AM or PM

You can put the tokens together in any combination, with anything or nothing between them. What matters to the interface is where in the string the tokens are found. It reads from left to right, looking for a recognizable token. The following table shows some common format strings and example timestamps.Format StringExample Timestamp

ccyy/mn/dd hh:mm:ss.0001998/11/29 15:32:19.391

dd mon, ccyy hr:mm:ss XM29 Nov, 1998 03:32:19 PM

mn-dd-ccyy hh:mm:ss11-29-1998 15:32:19

hh:mm:ss.00015:32:19.482

Dzero for scaled tags

When the device returns values that must be scaled to fit the range of values the tag stores (such as scaling from device voltage to temperature in degrees Celsius), store the device Zero in ExDesc. (The Convers attribute is used to specify the device Span.) The format is for the device Zero is:

Dzero=nnnnn.nnn

Scan

By default, the Scan attribute has a value of 1, which means that scanning is turned on for the point. Setting the scan attribute to 0 turns scanning off. If the scan attribute is 0 when the Interface starts, a message is written to the pipc.log and the tag is not loaded by the Interface. There is one exception to the previous statement.

If any PI point is removed from the Interface while the Interface is running (including setting the scan attribute to 0), SCAN OFF will be written to the PI point regardless of the value of the Scan attribute. Two examples of actions that would remove a PI point from an interface are to change the point source or set the scan attribute to 0. If an interface specific attribute is changed that causes the tag to be rejected by the Interface, SCAN OFF will be written to the PI point.ShutdownThe Shutdown attribute is 1 (true) by default. The default behavior of the PI Shutdown subsystem is to write the SHUTDOWN digital state to all PI points when PI is started. The timestamp that is used for the SHUTDOWN events is retrieved from a file that is updated by the Snapshot Subsystem. The timestamp is usually updated every 15 minutes, which means that the timestamp for the SHUTDOWN events will be accurate to within 15minutes in the event of a power failure. For additional information on shutdown events, refer to PI Server manuals.

Note: The SHUTDOWN events that are written by the PI Shutdown subsystem are independent of the SHUTDOWN events that are written by the Interface when the /stopstat=Shutdown command-line parameter is specified.

SHUTDOWN events can be disabled from being written to PI when PI is restarted by setting the Shutdown attribute to 0 for each point. Alternatively, the default behavior of the PI Shutdown Subsystem can be changed to write SHUTDOWN events only for PIpoints that have their Shutdown attribute set to 0. To change the default behavior, edit the \PI\dat\Shutdown.dat file, as discussed in PI Server manuals.

Bufserv and PIBufssIt is undesirable to write shutdown events when buffering is being used. Bufserv and PIBufss are utility programs that provide the capability to store and forward events to a PIServer, allowing continuous data collection when the Server is down for maintenance, upgrades, backups, and unexpected failures. That is, when PI is shutdown, Bufserv or PIBufss will continue to collect data for the Interface, making it undesirable to write SHUTDOWN events to the PI points for this Interface. Disabling Shutdown is recommended when sending data to a PIcollective to support high availability. Refer to the Bufserv or PIBufss manuals for additional information.

Output Points

Output points control the flow of data from the PI Server to any destination that is external to the PI Server, such as a PLC or a third-party database. For example, to write a value to a register in a PLC, use an output point. Each interface has its own rules for determining whether a given point is an input point or an output point. There is no de facto PI point attribute that distinguishes a point as an input point or an output point.

Outputs are triggered for UniInt-based interfaces. That is, outputs are not scheduled to occur on a periodic basis. There are two mechanisms for triggering an output.

As of UniInt 3.3.4, event conditions can be placed on triggered outputs. The conditions are specified using the same event condition keywords in the extended descriptor as described under Trigger-based Inputs. The only difference is that the trigger tag is specified with the SourceTag attribute instead of with the event or trig keywords. Otherwise, the behavior of event conditions described under Trigger-Based Inputs is identical for output points. For output points, event conditions are specified in the extended descriptor as follows:event_condition

Trigger Method 1 (Recommended)

For trigger method 1, a separate trigger point must be configured. The output point must have the same point source as the interface. The trigger point can be associated with any point source, including the point source of the interface. Also, the point type of the trigger point does not need to be the same as the point type of the output point.

The output point is associated with the trigger point by setting the SourceTag attribute of the output point equal to the tag name of the trigger point. An output is triggered when a new value is sent to the Snapshot of the trigger point. The new value does not need to be different than the previous value that was sent to the Snapshot to trigger an output, but the timestamp of the new value must be more recent than the previous value. If no error is indicated, then the value that was sent to the trigger point is also written to the output point. If the output is unsuccessful, then an appropriate digital state that is indicative of the failure is usually written to the output point. If an error is not indicated, the output still may not have succeeded because the interface may not be able to tell with certainty that an output has failed.

Trigger Method 2

For trigger method 2, a separate trigger point is not configured. To trigger an output, write a new value to the Snapshot of the output point itself. The new value does not need to be different than the previous value to trigger an output, but the timestamp of the new value must be more recent than the previous value.

Trigger method 2 may be easier to configure than trigger method 1, but trigger method 2 has a significant disadvantage. If the output is unsuccessful, there is no tag to receive a digital state that is indicative of the failure, which is very important for troubleshooting.

Output TimestampsIf you need to write the timestamp of an output value to one ItemID and the output value itself to another, you can get the timestamp by specifying the ItemID in the ExDesc field. In this case, you must specify whether the ItemID is to be written as a VT_DATE or as a VT_BSTR (string value). To write as a string value, define the /TF parameter in the startup file, so the interface knows what format to use to create the string. See the sections on ExDesc and Command-line Parameters for more details on settings.PI Point Configuration ToolThe OPC HDA Tag Builder Tool is a command-line utility that helps you create PI points from the OPC HDA Server. When executed, the tool browses the OPC HDA Server and gets the attributes needed to configure a PI tag.

To get the information required to build PI tags, execute the tool with the following command:

PIHOME\interfaces\OPCHDAInt\HDATagBuilder.exe /node=turboberry /server=OSI.HDA.1 /ps=had

The following section lists optional and required arguments.

Configuration Tool Command-line Parameters

ParameterDescription

/db (Optional)Logging for internal data translation and is helpful for PI Tech Support.

/h or /help (Optional)Displays information about the use of command-line parameters.

/loc1=# (Optional)Specifies the copy of the interface to which the point belongs. The value of this attribute must match the /id interface startup parameter.

/loc2=# (Optional)For input tags, this value specifies whether to store the data value(0) or quality of the data(1).

For output tags, this value is used to indicate whether this tag is to send the digital string(0) or the ordinal number(1) (0, 1, 2, ) for digital tags.

/loc3=# (Optional)Specifies whether the tag is an Input(0) or Output(2) tag.

/loc4=# (Optional)For interfaces that support scan-based collection of data, this value defines the scan class number for the PI Point.

For Trigger-based Inputs and Output Points, set this value to zero.

/loc5=# (Optional)Specifies how the point is to use data that has the quality of Uncertain:

0 Uncertain data will be sent to PI with the questionable bit set.

1 store the digital state Bad Quality if the quality is Uncertain.

2 Uncertain quality will be treated as good quality

/node=nodename

(Required if interface not loaded on OPC HDA server node, otherwise optional)Specifies the node where the OPC HDA server is running (optional). This argument is needed only when executing the configuration tool on a separate node from the OPC HDA server.

/ps=Point Source (Required) The PointSource used by the PI Points.

/server=servername (Required)Specifies the name of the server

(i.e. OSI.HDA.1)

For more information on the Point Attributes listed above, please see the Point Attributes section of this manual.

To build PI OPC HDA Interface tags, use the output file, hdatagbuilder.csv, from the configuration tool within PI SMT to export the tags to PI.Chapter 10. Startup Command File

Command-line parameters can begin with a / or with a -. For example, the /ps=M and -ps=M command-line parameters are equivalent.

For Windows, command file names have a .bat extension. The Windows continuation character (^) allows for the use of multiple lines for the startup command. The maximum length of each line is 1024 characters (1 kilobyte). The number of parameters is unlimited, and the maximum length of each parameter is 1024 characters.

The PI Interface Configuration Utility (PI ICU) provides a tool for configuring the Interface startup command file.Configuring the Interface with PI ICU

Note: PI ICU requires PI 3.3 or greater.

The PI Interface Configuration Utility provides a graphical user interface for configuring PI interfaces. If the Interface is configured by the PI ICU, the batch file of the Interface (PIOPCHDAInt.bat) will be maintained by the PI ICU and all configuration changes will be kept in that file and the module database. The procedure below describes the necessary steps for using PI ICU to configure the PI OPC HDA Interface.

From the PI ICU menu, select Interface, then NewWindows Interface Instance from EXE..., and then Browse to the PIOPCHDAInt.exe executable file. Then, enter values for Point Source and Interface ID#. A window such as the following results:

Interface name as displayed in the ICU (optional) will have PI- pre-pended to this name and it will be the display name in the services menu.

Click on Add.

The following display should appear:

Note that in this example the Host PI System is MKELLYLAPTOP. To configure the interface to communicate with a remote PI Server, select Interface => Connections item from PI ICU menu and select the default server. If the remote node is not present in the list of servers, it can be added.

Once the interface is added to PI ICU, near the top of the main PI ICU screen, the Interface Type should be opchdaint. If not, use the drop-down box to change the Interface Type to be opchdaint.Click on Apply to enable the PI ICU to manage this copy of the PI OPC HDA Interface.

The next step is to make selections in the interface-specific tab (i.e., opchdaint) that allow the user to enter values for the startup parameters that are particular to the PI OPC HDA Interface.

Since the PI OPC HDA Interface is a UniInt-based interface, in some cases the user will need to make appropriate selections in the UniInt page. This page allows the user to access UniInt features through the PI ICU and to make changes to the behavior of the interface. To set up the interface as a Windows Service, use the Service page. This page allows configuration of the interface to run as a service as well as to starting and stopping of the interface. The interface can also be run interactively from the PI ICU. To do that go to menu, select the Interface item and then Start Interactive.

For more detailed information on how to use the above-mentioned and other PI ICU pages and selections, please refer to the PI Interface Configuration Utility User Manual. The next section describes the selections that are available from the opchdaint page. Once selections have been made on the PI ICU GUI, press the Apply button in order for PI ICU to make these changes to the interfaces startup file.

OPCHDAInt Interface page

Since the startup file of the PI OPC HDA Interface is maintained automatically by the PI ICU, use the opchdaint page to configure the startup parameters and do not make changes in the file manually. The following is the description of interface configuration parameters used in the PI ICU Control and corresponding manual parameters.

OPCHDAInt The OPCHDAIint ICU Control for PI ICU has four tabs. A yellow text box indicates that an invalid value has been entered, or that a required value has not been entered.General Parameters

OPCHDA Server Node Name

Host name of the node where the OPCHDA Server is located. If the interface is running on the computer where the OPCHDA Server is located then the NodeName:: must be omitted in the command line parameter argument . If the server name has embedded spaces, enclose the name in double quotes. This is a required field and must be filled in. (/Server=NodeName::OPCHDAServerName)

Load Available OPCHDA Server Names Click this button to get a list of available OPCHDA Server names from the OPCHDA Server Node entered above. It will populate the OPCHDA Server Name drop down box.

OPCHDA Server Name Lists the OPCHDA Servers available at the node specified in OPCHDA Server Node Name. Select the server that the interface will access. (/Server=NodeName::OPCHDAServerName)

Current Active Server Tag The string tag into which should be written the name of the currently active OPC HDA Server (/CS=tag).Optional parameters

History Recovery Only History time range

Specifies a range of history to recover before exiting. Specify the times using PI time string formats with a colon separating the date and the time. For example, if you enter 10-dec-04:10:00:00,10-dec-04:12:00:00, the interface will recover two hours of data from the OPC HDA Server, send the data to the PI System for all points, and then exit. (/HRONLY= dd-mmm-yy:hh:mm:ss,dd-mmm-yy:hh:mm:ss)

Use Timestamp String Format

Sets the format for timestamp strings written to the OPCHDA Server. (/TF=format)

Use ReadProcessed CallTells the interface to use the OPC HDA ReadProcessed call instead of the ReadRaw call. The ReadProcessed call will return values at an interval based on the scan time of the points scan class. (/RP=flag where flag=0 The ReadProcessed call will be made with the OPCHDA_INTERPOLATIVE flag. This will cause the OPC HDA server to return interpolated values at the scan interval. Flag=1 The ReadProcessed will be made with the OPCHDA_START flag. This will cause the OPC HDA server to return the value and timestamp at the start time of the interval. Flag=2 The ReadProcessed will be made with the OPCHDA_END flag. This will cause the OPC HDA server to return the value and timestamp at the end time of interval)

History Recovery Maximum Time

Specifies the maximum amount of time to go back in history at startup. To use, select the check box, enter a value, and choose a unit of measure. (/HI=#c, where # is a number and c is a unit, like D for days, H for hours, M for minutes, or S for seconds.)

Adjust Timestamp with Offset

Applies an adjustment to the timestamp, to deal with broken servers and broken installations, where the clock for the OPCHDA Server is set incorrectly (for example, the server requires the clock to match the wall clock, but the time zone must be GMT, regardless of where the server is actually located). To use, select the check box, enter a value (which maybe either positive or negative), and choose a unit of measurement. The interface converts the value stored in the batch file to the number of seconds corresponding to the chosen unit of measurement. (/TO=#, where # is either a positive or negative value depending on whether the time must be adjusted forward or backward.)

Maximum Time Period Per CallSpecifies the maximum amount of time to request data from the OPC HDA per call. Instead of asking for data from last value to current time, interface calls data in chunks of time using the passed in max time period. To use, select the check box, enter a value, and choose a unit of measure. (/MP=#c, where # is a number, and x is a unit like D for days, H for hours, M for minutes, and S for seconds.

Time delay before reading OPC Tags

Specifies the number of seconds to wait after connecting to the OPCHDA Server before scanning data. This delay provides time for loading points on the OPCHDA Server before scanning. (/SD=#, where # is a number in seconds.)

MS to pause between History Retrieval

Specifies the number of milliseconds to pause between history recovery of a tag. (/HRPAUSE=millisecond)

Times Not Adjusted to the PI Server

The OPCHDA Server provides the timestamp, but the interface does not adjust for any offset between the OPC Server and the PI Server. (/TSU).

Note: Use this option with caution.

Discard Sub-Subsecond Portion of Timestamp

When selected, the interface discards the subsecond portion of the timestamp passed to PI Server and only sends whole integer seconds. This parameter can improve performance: PI Server will require less spaceand possibly less CPUto store the same amount of data. The interface truncates the fractional part of the timestamp. (/IT)

Group Size (# of Tags)

Specifies maximum number of tags to include in a call to the OPCHDA Server. Within each scan class, the interface calls the OPCHDA server in groups of the specified size, up to the number of points in the scan class. The start time of each data request matches the end time of the previous request. If you do not specify this parameter, the interface calls the OPCHDA Server one tag at a time with the start time set to the timestamp of the last value read from the OPCHDA Server. (/GS=#)

Start Time Adjust (sec.)

Used with Group Size, sets the start time of the data call to the previous end time minus the specified seconds. With this parameter, you can provide some overlap in the data call to ensure that you do not miss data that enters the OPCHDA Server after the interface made the read call. If the /GS parameter is not passed in, the /sa parameter has no effect. (/SA=#, where # is a number in seconds.)

End Time Adjust (sec.)

Used with Group Size, sets the end time of the data call to the current time minus the specified seconds. With this parameter, you can provide some overlap in the data call to ensure that you do not miss data that enters the OPCHDA Server after the interface made the read call. If the /GS parameter is not passed in, the /ea parameter has