OPC DA Interface
OPC DA Interface
Version 2.3.11.0
Revision C
ii
OSIsoft, Inc. OSIsoft Australia
777 Davis St., Suite 250 Perth, Australia
San Leandro, CA 94577 USA Auckland, New Zealand
(01) 510-297-5800 (main phone) OSI Software GmbH
(01) 510-357-8136 (fax)
(01) 510-297-5828 (support phone) Altenstadt, Germany
http://techsupport.osisoft.com OSIsoft Asia Pte Ltd.
[email protected] Singapore
Houston, TX
Johnson City, TN OSIsoft Canada ULC
Longview, TX Montreal, Canada
Mayfield Heights, OH Calgary, Canada
Philadelphia, PA
Phoenix, AZ OSIsoft, Inc. Representative Office
Savannah, GA Shanghai, People’s 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
Sales Outlets/Distributors
Middle East/North Africa South America/Caribbean
Republic of South Africa Southeast Asia
Russia/Central Asia South Korea Taiwan
www.osisoft.com
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, Inc.
OSIsoft, the OSIsoft logo and logotype, PI Analytics, PI ProcessBook, PI DataLink, ProcessPoint, Sigmafine, Analysis
Framework, PI Datalink, IT Monitor, MCN Health Monitor, PI System, PI ActiveView, PI ACE, PI AlarmView, PI BatchView,
PI ManualLogger, PI ProfileView, ProTRAQ, RLINK, RtAnalytics, RtBaseline, RtPortal, RtPM, RtReports and RtWebParts are
all trademarks of OSIsoft, Inc. All other trademarks or trade names used herein are the property of their respective owners.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph I(1)(ii) of the Rights in
Technical Data and Computer Software clause at DFARS 252.227-7013
Table of Contents
Terminology ................................................................................................................. ix
Introduction ................................................................................................................... 1
Reference Manuals ..................................................................................................... 1
Supported Features ..................................................................................................... 1
Configuration Diagrams ............................................................................................... 5
Principles of Operation................................................................................................. 7
Overview of OPC Servers and Clients ......................................................................... 8
Connections - Creating, Losing, and Recreating .......................................................... 9
The OPCEnum Tool .................................................................................................... 9
Timestamps ............................................................................................................... 10
Writing Timestamps to the Device.......................................................................... 10
Plug-in Post-processing DLLs.................................................................................... 11
Polling, Advising and Event Tags .............................................................................. 11
Data Types ................................................................................................................ 12
Transformations and Scaling ..................................................................................... 15
Quality Information .................................................................................................... 17
Questionable Qualities -- Store the Status or the Value? ....................................... 18
Storing Quality Information Directly ........................................................................ 18
Installation Checklist .................................................................................................. 23
Data Collection Steps ................................................................................................ 23
Interface Diagnostics ................................................................................................. 24
Advanced Interface Features ..................................................................................... 24
Interface Installation ................................................................................................... 25
Naming Conventions and Requirements ................................................................... 25
Interface Directories .................................................................................................. 25
PIHOME Directory Tree ......................................................................................... 25
Interface Installation Directory ................................................................................ 26
OPCEnum Directory .............................................................................................. 26
Plug-ins Directory .................................................................................................. 26
Tools Directory....................................................................................................... 26
iv
Table of Contents
Userint2 ................................................................................................................. 67
Scan ...................................................................................................................... 67
Shutdown ............................................................................................................... 67
Exception Processing ............................................................................................ 68
Output Points............................................................................................................. 68
Trigger Method 1 (Recommended) ........................................................................ 68
Trigger Method 2 ................................................................................................... 69
Sample Tag Configurations ....................................................................................... 69
Scan Classes ......................................................................................................... 69
Output Tags ........................................................................................................... 69
Polled Tags ............................................................................................................ 70
Advise Tags ........................................................................................................... 70
Event Tags ............................................................................................................ 71
Array Tags ............................................................................................................. 72
Arrays as Event Tags............................................................................................. 73
Reading Basic Quality as a Digital Tag .................................................................. 73
Startup Command File ................................................................................................ 75
Configuring the Interface with PI ICU ......................................................................... 75
OPC Interface Tab ................................................................................................. 78
Command-line Parameters ........................................................................................ 93
Sample OPCInt.bat file ............................................................................................ 108
UniInt Failover Configuration ................................................................................... 109
Introduction.............................................................................................................. 109
Quick Overview.................................................................................................... 110
Configuring Synchronization through the Data Source (Phase 1) ............................ 111
Configuring Synchronization through a Shared File (Phase 2) ................................ 115
Configuring UniInt Failover through the Data Source (Phase 1) .............................. 119
Start-Up Parameters ............................................................................................ 119
Data Source Points .............................................................................................. 121
PI Tags ................................................................................................................ 121
Detailed Explanation of Synchronization through the Data Source .......................... 125
Steady State Operation........................................................................................ 126
Synchronization through a Shared File (Phase 2) .................................................... 128
Configuring UniInt Failover through a Shared File (Phase 2) ................................... 129
Start-Up Parameters ............................................................................................ 129
vi
Table of Contents
viii
Terminology
In order to understand this interface manual, you should be familiar with the terminology
used in this document.
Buffering
Buffering refers to an Interface Node's 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 in order to configure and run 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 and run 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.
OPC
OPC (originated from OLE for Process Control, now referred as open connectivity via
open standards) is a standard established by the OPC Foundation task force to allow
applications to access process data from the plant floor in a consistent manner.
OPCTool
This tool used to be the main tool for testing connection to and supported functionality of
OPC Servers. OSIsoft recommends using the PI OPCClient for these purposes and leave
the PI OPCTool only as a debugging utility when requested by tech support for
troubleshooting specific OPC Server problems with their server vendors.
OPCEnum Tool
The OPC Foundation has provided a tool to allow OPC 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.
OPCClient
This tool can be used to test connectivity to the OPC Server, and to browse OPC Items
and verify data collection.
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 client applications. A
typical PIHOME is C:\Program Files\PIPC. PI interfaces reside in a subdirectory of
the Interfaces directory under PIHOME. For example, files for the Modbus Ethernet
Interface are in C:\Program Files\PIPC\Interfaces\ModbusE.
This document uses [PIHOME] as an abbreviation for the complete PIHOME directory.
For example, ICU files in [PIHOME]\ICU.
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. While 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,
x
Terminology
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.
Reference Manuals
OSIsoft
PI Server manuals
PI API Installation manual
UniInt Interface User Manual
PI OPCClient User’s Guide
PI Interface Configuration Utility User Manual
OPC DA Interface Failover Manual
Supported Features
Feature Support
Part Number PI-IN-OS-OPC-NTI
* Platforms Windows (2000 SP4, XP, 2003 Server,
Vista and 2008 Server)
OPC Data Access Standard 1.0a / 2.0 / 2.05
APS Connector Yes
Point Builder Utility No
ICU Control Yes
Feature Support
PI Point Types Float16 / Float32 / Float64 / Int16 /
Int32 / Digital / String
Sub-second Timestamps Yes
Sub-second Scan Classes Yes
Automatically Incorporates PI Point Attribute Yes
Changes
Exception Reporting Done by Interface / Done by DCS
Outputs from PI Yes
Inputs to PI: Scan-based / Unsolicited / Event Scan-based / Unsolicited / Event Tags
Tags
Supports Questionable Bit Yes
Supports Multi-character PointSource Yes
Maximum Point Count Unlimited
* Uses PI SDK Yes
PINet String Support N/A
* Source of Timestamps Interface / OPC Server
History Recovery No
* UniInt-based Yes
Disconnected Startup Yes
* SetDeviceStatus Yes
* Failover Server-level Failover;
Interface-Level Failover:
UniInt Phase 1 & 2 (Cold/Warm/Hot)
Microsoft Clustering
Vendor Software Required on PI Interface No
Node / PINet Node
* Vendor Software Required on DCS System Yes
* Vendor Hardware Required No
* Additional PI Software Included with Yes
Interface
Serial-Based Interface No
* See paragraphs below for further explanation.
Platforms
The Interface is designed to run on the above mentioned Microsoft Windows operating
systems. Due to the dependency of OPC on COM and DCOM, the PI OPC Interface is
not support on non-windows platforms.
Please contact OSIsoft Technical Support for more information.
2
Introduction
Uses PI SDK
The 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.
If the PI Server is at version 3.4.370 or higher, and the PI API is at version 1.6 or higher,
then the PI SDK is not used even if it is enabled since UniInt will use the new PI API
calls for long Instrument tag field and multiple character point source.
If the PI Server is older than 3.4.370, the new PI API calls cannot be used. The PI SDK
would need to be enabled to use the long instrument tag field and multiple character
pointsource.
The PI SDK cannot be used if the interface will be setup to use Disconnected Startup
since it is based on API calls only.
Source of Timestamps
The interface can accept timestamps from the OPC Server or it can provide timestamps
from the local node. This is controlled by a command-line parameter.
UniInt-based
UniInt stands for Universal Interface. UniInt is not a separate product or file; it is an
OSIsoft-developed 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 OSIsoft‘s 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 UniInt-supplied 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
New functionality has been added to UniInt 4.3.0.15 and later to support health tags. The
OPC Interface is built against a version of UniInt that supports the health tags. The
Health tag with the point attribute Exdesc = [UI_DEVSTAT], is used to represent the
status of the source device. The following events can be written into this tag:
a) ―Good‖ – This value indicates that the Interface is able to connect to all of the
devices referenced in the Interface‘s point configuration. A value of ―Good‖ does
not mean that all tags are receiving good values, but it is a good indication that
there are no hardware or network problems.
b) ―2 | Connected/No Data‖ - This message shows that the interface is connected
to the OPCServer but No Data can be read for some or all tags.
c) ―3 | 1 devices(s) in error‖ - The connection to the OPCServer is down.
d) “4 | Intf Shutdown” – The Interface has shut down.
Please refer to the UniInt Interface User Manual.doc file for more information on how to
configure health points.
Failover
Server-Level Failover
The interface supports server-level failover that allows collecting data from either
primary or backup OPC Servers. This feature is built into the interface and does
not require any additional hardware or software. See OPC DA Interface Failover
Manual for more details
Interface-Level Failover using UniInt (Phase 1 and 2)
This interface supports Interface-Level Failover using UniInt, as well as
Interface-Level Failover using Microsoft Clustering.
UniInt provides support for a hot failover configuration which 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. This
failover solution requires that two copies of the interface be installed on different
interface nodes collecting data simultaneously from a single data source.
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. This type of failover does not require a special type of
hardware or software (e.g. a Microsoft Cluster).
The failover scheme is described in detail in the UniInt Interface User Manual,
which is a supplement to this manual.
Interface-Level Failover using Microsoft Clustering
This type of failover allows two copies of the interface to run on two clustered
machines, with only one copy actually collecting data at any given time. This
failover option can be combined with the Server-Level Failover, so that the user
can have redundancy for both the OPC server and the interface. Details of
configuring the failover are documented in the OPC DA Interface Failover
Manual.
4
Introduction
Configuration Diagrams
Configuration 1: Preferred Configuration
This configuration is the simplest, and allows data buffering on the interface node.
PI Server
Windows OS /
VMS / UNIX
TCP / IP
Windows OS
PI-SDK
PI-OPC
Interface
OPC Server
PI Server
Windows OS /
VMS / UNIX
TCP / IP
Windows OS Windows OS
(or different OS)
PI-SDK
Windows OS Windows OS
(or different OS)
PI Server
OPC Server
PI-SDK
PI-OPC
Interface
Note: All configurations require DCOM settings and it is recommended that buffering be
used even when the interface runs on the PI Server node, because OPC Server
sometimes sends data in bursts, with all values coming in within the same millisecond.
6
Principles of Operation
The PI OPC Interface is an OPC Data Access (DA) client that allows process data to be
passed between an OPC DA Server and a PI Server. The PI OPC Interface is designed to
provide connection to only one OPC Server and run multiple instances of the interface
simultaneously. More than one interface may be configured to connect to the same OPC
Server.
At start up, the PI OPC Interface tries to establish connection to both the OPC and PI
Servers. After connection is successfully established, it periodically checks its clock
against that of the OPC Server and against that of the PI Server to eliminate any
differences in clock speeds. This procedure is also important to provide positive
feedback to the interface that the OPC Server is still up and running, even if all points are
configured for ‗Advise‘ (i.e., the OPC Server sends data whenever a new value is read
into the server‘s cache) and no data has come in for some time. If the interface cannot
communicate with the OPC Server, the interface will periodically try to reestablish the
connection. Once the connection to the OPC Server is reestablished, the interface will
recreate its groups and items on the server and resume data collection.
Once startup is complete, the Interface enters the processing loop, which includes:
Servicing scheduled input points. Each Scan Class is processed in turn.
Servicing output points as events arrive.
Servicing triggered input points as events arrive.
The PI Point Database is checked every 2 minutes for points that are added,
edited, and deleted. If point updates are detected, the points are loaded (or
reloaded) by the Interface as appropriate. The 2-minute update interval can be
adjusted with the /updateinterval command-line parameter discussed in the
UniInt Interface Users Manual. The Interface will only process 25 point updates
at a time. If more than 25 points are added, edited, or deleted at one time, the
Interface will process the first 25 points, wait 30 seconds (or by the time
specified by the /updateinterval parameter, whichever is lower), process the
next 25 points, and so on. Once all points have been processed, the Interface will
resume checking for updates every 2 minutes (or by the time specified by the
/updateinterval parameter). All tag edits are performed in the following
way: old versions of edited tags are deleted from the interface; new versions are
added in. With some OPC 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 Interface is designed to constantly send messages about its operation to the
pipc.log file. This file will contain the following information about the PI OPC
Interface:
Informational messages on interface startup and shutdown;
The scan rate for each scan class and the actual update rate provided by the OPC
Server.
A count of the points in each scan class (i.e., Polled tags), the number of Output
points, and a count of the Advised tags and Event tags;
Error messages for points rejected by the interface because they are configured
incorrectly;
Error messages for points rejected by the OPC Server or error messages sent
from the OPC Server;
Notification for all connections and disconnections from the server (e.g. when the
connection with the OPC Server is lost and the interface attempts to reconnect)
Note: The PI OPC Interface can be configured to run on the same system as the OPC
Server, PI Server or on another system. 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.
Failover
This interface supports three types of failover: Server-Level Failover, Interface-Level
Failover using Microsoft Clustering, and Interface-Level Failover using UniInt. See the
UniInt Failover Configuration section for configuring the interface for failover using
UniInt. To configure failover using Microsoft Clustering or for server-level failover, refer
to the OPC DA Interface Failover Manual.
8
Principles of Operation
a Group, it specifies how often the cache values for the points in that Group should be
updated. The requested update rate is usually the same as the scan rate for those points.
Since this is a requested update rate, the OPC Server may not accept the requested rate,
and will return the update rate that it will support for that group. The update rate to
which the server agrees will be noted in the pipc.log file. All tags in a group must be
in the same scan class.
be changed using dcomcnfg.exe (see DCOM Configuration Details section for more
information on DCOM settings).
If the OPC Server is on a different node which does not have the OPCEnum tool
(OPCEnum.exe), it is allowed to manually copy it from the Windows\System32 directory
of the interface node and place it in the Windows\System32 directory of the OPC Server
node. This application can be registered as a service on the OPC Server node by entering
the command OPCEnum.exe –service from the Windows\System32 directory in a
Command Prompt window. Administrative privileges are required for the login
UserId on the OPC Server system.
Timestamps
The interface is designed to get timestamps from the OPC Server along with the data.
The interface will then adjust those timestamps to match the time on the PI Server. This
is done because system clock settings can be different for different systems or the clocks
may drift. The interface calculates the difference of the timestamps from the PI Server
and the OPC Server every 30 seconds.
If the OPC Server provides timestamps it is possible to use the /TS command-line
parameter to adjust the behavior of the interface. With the /TS=Y setting, the interface
expects the OPC Server to provide timestamps, and will only adjust them to compensate
for the offset between OPC Server time and PI Server time.
/TS=N is used if the OPC Server cannot provide any timestamps or if the user doesn‘t
want to get them from the OPC Server. In this case, the interface will timestamp each
value as it receives it and adjusts that to compensate for the offset between interface node
time and PI Server time. This is the default setting.
/TS=A is used if the OPC Server will provide timestamps for Advise tags. Some servers
will return correct values for Advise items, but for Polled reads they will return the time
that the value last changed, rather than the time of the read. This option has the interface
use the Advise timestamps, but provide timestamps for the Polled values, just as it would
with /TS=N.
/TS=U is an option that needs to be selected with caution. With this option, the
timestamps received from the OPC 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 need to be checked. This error will occur when the
interface has sent a timestamp that is outside of the range for the PI archives.
For more details on Advise and Polled tags, see the section below on Polling, Advising
and Event Tags.
Writing Timestamps to the Device
Timestamps may be written to or read from the device as data. To read and write
timestamps from a PI tag, where the timestamp is the value of the tag, see the section on
Data Types.
10
Principles of Operation
For the special case where the user needs to write the timestamp of an output value to one
ItemID and the output value itself to another, it is possible to get the timestamp by
specifying the ItemID in the ExDesc field. In this case it is required to specify whether
the ItemID is to be written as a VT_DATE or as a VT_BSTR (string value). If it is to be
written as a string value, the /TF parameter in the startup file must be defined, 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.
Polled Tags
Polled tags are grouped by scan class; all tags in a scan class will be in the same Group.
Since reads are done on a Group level, it is best not to have too many tags in one Group.
Multiple scan classes with the same scan rate can be used; use the offset parameter to
ensure that the load on the interface is smooth, rather than having the interface attempt to
read all the tags at the same time. Note that the offset parameter may have no effect on
the load on the OPC server; for more information, see the section on the /f parameter in
Command-line Parameters.
Advise Tags
Advise tags will be grouped automatically by the interface if they are in scan class 1. A
scan class is specified for Advise tags, the same as for Polled tags, but for tags in scan
class 1 the interface will automatically limit the number of tags in the Advise Group to
800 by default. This means that up to 800 tags with the same deadband will be put into
one Group. If there are more than 800 tags with the same deadband in scan class 1, the
interface will create as many Groups as are needed. To change this limit to a different
number, use the /AM parameter.
Event Tags
Event tags (triggered inputs) are usually used to read a set of data points after a particular
event has occurred. The PI tag that triggers the read is named in the ExDesc field. When
a new event for a trigger tag is sent to the PI snapshot, the PI system informs the interface
of this and the interface then goes out to read the values for all the associated event tags
from the OPC Server. For v1.0a servers, an Asynchronous read is sent to the server‘s
cache. For v2.0 servers, the Asynchronous read from cache is not available and the
interface must do an Asynchronous read from the device. Doing very many of these
device reads could impact the performance of the OPC Server. For any Asynchronous
read, the server is required to return all of the values together, so it is possible that there
could be a delay in getting the new values back to the PI Server, if the OPC Server has a
delay in reading one or more of the values. Grouping those tags by the device where the
data resides might be important for performance, in those cases.
For event tags, the scan class must be set to zero, but a Group number will be entered in
UserInt2. The interface will create a Group for each unique UserInt2, and when an
event happens, a read will be performed for each Group that contains one or more of the
event tags that depend on the triggering event. The UserInt2 number creates a logical
grouping of event tags, but the only effect of that grouping is in how the interface itself
handles the data processing, and how it asks the server for the information. Thus, a large
number of event tags that share the same trigger tag can be split up into logical groups,
which will each be read independently of the other groups, so that delays in reading from
a given device need not impact the rest of the data acquisition.
Data Types
By default, the interface will request the following OPC data types:
PI PointType OPC Data Type
Digital 2-byte Integer (VT_I2)
Int16 2-byte Integer (VT_I2)
Int32 4-byte Integer (VT_I4)
Float32 4-byte Float (VT_R4)
Float64 8-byte Float (VT_R8)
String String (VT_BSTR)
12
Principles of Operation
setting Location2=1. Make sure that the strings used by the OPC Server are exactly
identical to the strings in the Digital Set, including punctuation, and spacing.
Other OPC Servers cannot serve certain numbers as numeric and they can only provide
the character strings. For these servers, set Location2=1 for Int16, Int32, Float32, and
Float64 tags, and the interface will request the data as a string (BSTR) and try to read the
resulting data as a number.
Reading Tags as Booleans
Some servers appear to have been written to not only send Boolean values as 0 and -1
when read as VT_BOOL (as specified by Microsoft's definition of a VARIANT of type
VT_BOOL), but also to send the same values when read as integers. This creates a
problem when reading that data into a PI Digital tag, since "-1" is not actually what
should be stored. While most servers appear to handle this properly, to handle the data
from ill-behaved servers, the interface will take the absolute value of any integer or real
values read for digital tags. Since digital tag values are actually offsets into the digital set
for the tag, and a negative offset has no functional meaning, this should not cause
problems for properly written servers.
The interface may also request the item as a Boolean (VT_BOOL). This will only work
for items which truly only have two possible states, as any nonzero value will be
interpreted as a 1. To have tags read and written as though they were Booleans, set
Location2=2.
Reading Tags as 4-byte Integers
If the OPC Server does not send data as a 2-byte integer (VT_I2), set Location2=3 to
have the interface request the data as a 4-byte integer (VT_I4). Note that this option uses
more resource, so use it only if necessary.
Reading Tags as Float64 Values
Likewise, if your OPC Server will only give a particular value as an 8-byte floating-point
number (VT_R8), set Location2=5 to have the interface request VT_R8 even though it
will be storing it to a 4-byte floating-point tag. There may be some loss of precision, and
if the number is too large to fit in the tag, a status of BAD INPUT will be stored for the
tag.
Converting Timestamps into Seconds
Setting Location2=6 tells the interface that the OPC Item is a string (VT_BSTR) that
will have a timestamp string value in it, such as 2000/11/02 15:34:29. The format of
the strings must be supplied in the command file with the /TF parameter. See the section
below on Timestamp Strings for how to create that format.
If the PI tag is an integer, the interface will attempt to translate the timestamp into whole
seconds and store that in the PI Archive. (Remember that Int16 tags can only hold
numbers up to 32767, so for time spans longer than 9 hours Int32 tags will be needed.) If
the PI tag is a Float tag, the timestamp will be translated into seconds and stored as a
floating-point number. The interface will not perform any adjustments on the timestamps
received, regardless of the time zone settings or /TS parameter on the command line.
However, if the tag is configured to use scaling or transformation that operation will
happen after the string has been translated into seconds, which allows a wide range of
values to be handled.
14
Principles of Operation
may not be possible. Where possible, always specify the data type that matches the PI
tag.
16
Principles of Operation
Quality Information
The OPC Data Access standard uses Fieldbus quality flags. The interface translates those
quality flags to the closest approximation within the PI System State table. The low 8 bits
of the Quality flags are currently defined in the form of three bit fields, Quality, Sub-
status and Limit status. The 8 Quality bits are arranged as follows:
QQSSSSLL
The tables at the end of this section give the transformation to PI status. The second table
gives the status codes that will be used if the PI system is version 3.3 or higher. That
version of PI is the first that defines the states needed by the OPC interface so that the
interface will not use the Archive Offline and other states which were causing some
confusion.
Questionable Qualities -- Store the Status or the Value?
Because the PI archive stores either the quality or the value, the interface will translate
the qualities in the ―questionable‖ category to GOODSTAT, and set the ―questionable
value‖ flag for the data value. ―Bad quality‖ flags get the corresponding PI status stored
for the tag. If the quality is SUBSTITUTED_ST, the interface will currently store the
status rather than the value sent. This behavior can be changed with the /SQ parameter
in the startup file. Setting /SQ=Y parameter will cause the interface to store the quality
(translated to a PI digital state) if the quality is anything but GOOD. Similarly, if /SQ=I
is set, the interface will ignore the "questionable" quality, and treat the value as if it had
good quality.
The behavior can be enhanced to send only GOOD quality data by setting the /SG
parameter. If the /SG is set, only GOOD quality data will be sent to PI. Questionable
quality data and BAD quality data will be ignored.
If the /SQ=I or /SQ=Y flag is also set, then Questionable Quality data will be sent to
PI as described above. BAD quality data will continue to be ignored.
The quality information will continue to be sent to tags that are configured to store
quality instead of values.
18
Principles of Operation
Questionable
Quality OPC Definition PI Status
010110LL Sub-Normal Bad_Quality
010101LL Engineering Units Exceeded
QQSSSS01 Low Limited Under LCL
QQSSSS10 High Limited Over UCL
Otherwise Inp OutRange
010100LL Sensor Not Accurate
QQSSSS01 Low Limited Under Range
QQSSSS10 High Limited Over Range
Otherwise Out of calibration Invalid Data
010011LL Invalid Bad Input
010010LL Invalid Bad Input
010001LL Last Usable Value No_Sample
010000LL Non-specific Doubtful
Bad Quality
Quality OPC Definition PI Status
000111LL Out of Service DCS failed
000110LL Comm Failure Arc Off-line
000101LL Last Known Value Scan Timeout
000100LL Sensor Failure Equip Fail
000011LL Device Failure Unit Down
000010LL Not Connected Access Denied
000001LL Configuration Error Configure
000000LL Non-specific Bad
Questionable
Quality OPC Definition PI Status
010110LL Sub-Normal Bad_Quality
010101LL Engineering Units Exceeded
QQSSSS01 Low Limited Under LCL
QQSSSS10 High Limited Over UCL
Otherwise Inp OutRange
010100LL Sensor Not Accurate
QQSSSS01 Low Limited Under Range
QQSSSS10 High Limited Over Range
Otherwise Out of calibration Invalid Data
010011LL Invalid Bad Input
010010LL Invalid Bad Input
010001LL Last Usable Value No_Sample
010000LL Non-specific Doubtful
Bad Quality
Quality OPC Definition PI Status
000111LL Out of Service Out of Service
000110LL Comm Failure Comm Fail
000101LL Last Known Value Scan Timeout
000100LL Sensor Failure Equip Fail
000011LL Device Failure Unit Down
000010LL Not Connected Not Connected
000001LL Configuration Error Configure
000000LL Non-specific Bad
20
Principles of Operation
PointSource – identifies all tags that belong to this instance of the interface
Location1 – interface ID/instance.
Location2 – special handling.
Location3 – tag type (Polled/Advised/Output).
Location4 – scan class number.
Location5 – optional deadband value for Advise tags.
InstrumentTag – ItemID for the OPC Server item
ExDesc – Event Tags, Long ItemID or ItemID with trailing spaces, DZero for
scaled tags, or ItemID to get the timestamp for an output value
12. Start the Interface interactively and confirm its successful connection to the PI Server
without buffering.
13. Confirm that the Interface collects data successfully.
14. Stop the Interface and configure a buffering application (either Bufserv or PIBufss).
15. 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.
16. Configure the Interface to run as a Service. Confirm that the Interface runs properly
as a Service.
17. Restart the Interface Node and confirm that the Interface and the buffering
application restart.
Interface Diagnostics
1. Configure Scan Class Performance points.
2. Install the PI Performance Monitor Interface (Full Version only) on the Interface
Node.
3. Configure Performance Counter points.
4. Configure UniInt Health Monitoring points
5. Configure the I/O Rate point.
6. Install and configure the Interface Status Utility on the PI Server Node.
7. Configure the Interface Status point.
24
Interface Installation
OSIsoft recommends that interfaces be installed on PI Interface Nodes instead of directly
on the PI Server node. A PI Interface Node is any node other than the PI Server node
where the PI Application Programming Interface (PI API) has been installed (see the PI
API manual). With this approach, the PI Server need not compete with interfaces for the
machine‘s resources. The primary function of the PI Server is to archive data and to
service clients that request data.
OSIsoft highly encourages all users to use the PI Interface Configuration Utility (PI ICU)
to configure and run all interfaces when the PI Server is 3.3 or greater.
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. 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. See the UniInt Interface
Users Manual for special procedural information.
Interface Directories
PIHOME Directory Tree
The PIHOME directory tree is defined by the PIHOME entry in the
pipc.ini configuration file. This pipc.ini file is an ASCII text file, which is located
in the %windir% directory. A typical pipc.ini file contains the following lines:
[PIPC]
PIHOME=c:\pipc
The above lines define the \pipc directory as the root of the PIHOME directory tree on
the C: drive. OSIsoft recommends using \pipc as the root directory name. The
PIHOME directory does not need to be on the C: drive.
Plug-ins Directory
There are plug-in DLLs, which perform post-processing (for input tags) or pre-processing
(for output tags) for specific applications. These contain application logic which is not
suitable for inclusion in the interface itself, as it is specific to a given OPC Server and
usage, but which is used by more than one customer. The DLLs are installed into a sub-
directory below the interface directory called Plug-ins. The documentation for their
usage and supporting utility files are installed into sub-directories below the Plug-ins
directory called Documentation and Utilities, respectively. All of these directories
are created during interface installation.
Tools Directory
Various tools are included with the installation, most prominently the PI OPCClient.
Some of these tools are installed into a sub-directory below the interface directory called
Tools. The PI OPCClient tool is installed to a directory called:
PIHOME\PI-OPC Tools\PI_OPCClient\
26
Interface Installation
After running the setup program, a directory structure and files such as the following
result:
PIHOME\Interfaces\OPCInt\OPCInt.exe
PIHOME\Interfaces\OPCInt\OPCInt.bat
PIHOME\Interfaces\OPCInt\PI_OPCInt.doc
PIHOME\Interfaces\OPCInt\Plug-Ins\
PIHOME\Interfaces\OPCInt\Plug-Ins\Documentation\
PIHOME\Interfaces\OPCInt\Plug-Ins\Utilities\
PIHOME\Interfaces\OPCInt\Tools\
PIHOME\PI-OPC Tools\PI_OPCClient\
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 PI 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 PI 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 PI interface service will not run.
Note: Please see the PI Log and Operating System Event Logger for messages that may
indicate the cause for any server 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.
28
Interface Installation
- 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
To Start or Stop an interface service, use the Start button and a Stop button on the
ICU toolbar. 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.
Status of
Status of the Service
the ICU
Interface installed or
Service uninstalled
*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.
The service can be started from the services control panel or with the command:
OPCInt.exe -start
or with the command
net start OPCInt
A message will be echoed to the screen informing the user whether or not the interface
has been successfully started as a service. Even if the message indicates that the service
started successfully, make sure that the service is still running by checking in the services
control panel. There are several reasons that a service may immediately terminate after
startup. One of them is that the service may not be able to find the command-line
parameters in the associated .bat file. For this to succeed, the root name of the .bat
file and the .exe file must be the same, and the .bat file and the .exe file must be in
the same directory. If the service terminates prematurely for whatever reason, no error
messages will be echoed to the screen. The user must consult the pipc.log file for error
messages. See the Appendix A: Error and Informational Messages for additional
information.
If the interface runs interactively but cannot connect to the server when run as a service,
it is almost always a DCOM permissions problem, recheck the DCOM configuration
settings.
30
Interface Installation
The service can be stopped at any time from the services control panel or with the
command:
OPCInt.exe -stop
The service can be removed by
OPCInt.exe –remove
Upgrading an Installation
When upgrading from version 2.1.48.0 or less, before installing a new version, the older
version should to be uninstalled. To do this, go to the Control Panel and use
Add/Remove Programs. The interface installation will not let a new version to be
installed on top of an existing installation, if the old version is 2.1.48.0 or older. This
requirement also applies when there are multiple copies of the interface are installed. All
copies should be to be uninstalled and batch files should be saved to a different directory,
before upgrading the interface.
DCOM Configuration for Windows XP, 2003 Server, Vista and 2008
Server
There are two main steps for DCOM configuration that must be done no matter if the
OPC client (i.e. PI OPC Interface) and server are on the same node or on different nodes.
The first step is to configure Default DCOM permissions on the client node. This step
needs to be performed with caution, since it is going to affect all COM/DCOM
applications running on this node. The second is to configure DCOM permissions for the
specific OPC Server on the OPC Server node.
Default DCOM Permissions on OPC Client Node
1. Launch the DCOM Configuration utility: Type dcomcnfg in the Run dialog of
Start menu and click OK.
Right click on My Computer and on the pop-up window select Properties. This should
bring up the My Computer Properties window.
34
DCOM Configuration Details
3. Configure the default DCOM settings for this machine: Select the Default
Properties tab. Make sure that ―Enable Distributed COM on this computer‖ is
checked, ―Default Authentication Level‖ is set to Connect, and ―Default Impersonation
Level‖ is set to Identify. These are the preferred settings that can be appropriate for
most cases. However, due to domain or machine security policy and restrictions, these
settings might not work. In this case, you should identify workable settings and use them
here.
Caution: You should be aware that changing the Default Authentication and
Impersonation levels will affect all COM/DCOM applications that use default settings on
this machine. If this is causing issues with other applications, do not change them.
Instead, you can set them specifically for the OPC Interface process by using /DI and /DA
parameters in the start up file. See DCOM Security Configuration for the Interface section
for more details.
Next select Default COM Security tab and click on ―Edit Default…‖ button for
Access Permissions. If running on Windows XP SP1 the following dialog should
appear.
For Windows XP SP2 and Windows 2003, it should look like this:
Next the Group or user names listed for the Default Access Permissions of your
machine will appear.
36
DCOM Configuration Details
Click OK to finish.
For Windows XP SP2 and Windows 2003, also check Edit Limits options for both Access
and Launch permissions and make sure that all required accounts have been added as
above.
38
DCOM Configuration Details
2. From the list of applications find the OPC Server and with the right click on the server
application select Properties. This will bring up the Properties window for the server.
If, as above, the Authentication Level is set to ―Default‖, that means that whatever is set
as the default Authentication Level for that node will also apply to the server. Do not
change this setting unless there are problems connecting to the server.
3. Next select the Security tab. This is where accounts are specified for Launch and
Access permissions. Both of them will present two options: ―Use Default‖ or
―Customize‖. If ―Use Default‖ is selected, it will use the default settings, like those
specified for the client node in the first step. If ―Use Default‖ is set, the default setting
should be checked and possibly changed. We suggest using ―Customize‖ instead, to set
only the permissions for who can access the server, rather than changing DCOM
permissions for all programs on the node. To specify which accounts can access the
server, select Customize and click on the Edit button. Remember, the default permissions
for the system specify who is allowed to get in, but the server-specific permissions
regulate who is allowed to actually connect to the server. Users who have permission
under the default settings may be able to access other COM servers, and see that the OPC
server is there, but if they do not have permission here in the Server security
configuration, they won‘t be able to connect to the server.
Add all user IDs which will be used by clients to access the server. These may be
individual users, who will run clients interactively, or it may be a Role account or Group.
4. The last tab in the DCOM configuration tool is ―Identity‖. We strongly suggest
specifying a particular account, perhaps one created for OPC clients and servers, or for
this server. Using ―The Interactive User‖ will create problems if someone logs in who
does not have permission to access the server. Using ―The launching user‖ can lead to
situations where multiple copies of the server running might be running, which can cause
problems.
40
DCOM Configuration Details
2. A window that looks more or less like the following will show up. What is displayed
may be a little different, depending on what versions of what Microsoft (TM) products
are installed.
3. Configure the default DCOM settings for this machine: Select the Default Properties
tab. Make sure that ―Enable Distributed COM on this computer‖ is checked, ―Default
Authentication Level‖ is set to Connect, and ―Default Impersonation Level‖ is set to
Identify. These are the preferred settings that can be appropriate for most cases.
However, due to domain or machine security policy and restrictions, these settings might
not work. In this case, you should identify workable settings and use them here.
Caution: You should be aware that changing the Default Authentication and
Impersonation levels will affect all COM/DCOM applications that use default settings on
this machine. If this is causing issues with other applications, do not change them.
Instead, you can set them specifically for the OPC Interface process by using /DI and /DA
parameters in the startup file. See DCOM Security Configuration for the Interface section
for more details.
4. Next click on Default COM Security tab. The following should be displayed:
42
DCOM Configuration Details
Click on ―Edit Default…‖ button for Default Access Permissions. Make sure that at least
all of the following accounts are there.
The Type of Access should be Allow Launch. Click OK, and get back to the main
Default Security screen.
2. On the DCOM window under General tab similar information should be displayed for
the specific OPC Server.
If, as above, the Authentication Level is set to ―Default‖, that means that whatever is set
as the default Authentication Level for that node will also apply to the server. Do not
change this setting unless there are problems connecting to the server.
3. Next select the Security tab. This is where accounts are specified for Launch and
Access permissions. Both of them will present two options: “Use Default” or
“Customize”. If “Use Default” is selected, it will use the default settings, like those
specified for the client node in the first step. If ―Use Default‖ is set, the default setting
should be checked and possibly changed. We suggest using ―Customize‖ instead, to set
only the permissions for who can access the server, rather than changing DCOM
permissions for all programs on the node. To specify which accounts can access the
server, select Customize and click on the Edit button. Remember, the default permissions
for the system specify who is allowed to get in, but the server-specific permissions
44
DCOM Configuration Details
regulate who is allowed to actually connect to the server. Users who have permission
under the default settings may be able to access other COM servers, and see that the OPC
server is there, but if they do not have permission here in the Server security
configuration, they won‘t be able to connect to the server
Add all the UserIDs that will be used by clients to access the server. These may be
individual users, who will run clients interactively, or it may be a Role account or Group.
4. The last tab in the DCOM configuration tool is “Identity‖. We strongly suggest
specifying a particular account, perhaps one created for OPC clients and servers, or for
this server. Using ―The Interactive User‖ will create problems if someone logs in who
does not have permission to access the server. Using ―The launching user‖ can lead to
situations where multiple copies of the server are running, which can cause problems.
although it may well launch the OPC Server. Note that these accounts must be a local
account on each node, not a domain account.
Some sites have reported problems when their server and client nodes were in different
Workgroups. If establishing communication between the server and a client is not
possible, and the two machines are in different workgroups, it might succeed by moving
the two machines into the same Workgroup.
Note: Do not use the Local System account to run applications that use DCOM. While
the Local System account has plenty of privileges locally, it has no authority outside its
own system.
DCOM Configuration on Two Nodes
If two nodes are being used, both nodes have to be configured to allow access. That is
because the OPC Server makes calls to the client, and the client makes calls to the server,
and if the configuration is not set up to give them both permission to communicate, the
windows system will not allow communication.
DCOM Configuration on a Single Node
Even if you are using the same node for both the OPC server and the OPC client, DCOM
still needs to be configured. In this case, make sure that DCOM permissions have been
granted to the accounts under which the OPC server and the client will run.
Registration of Proxy DLLs
The OPC clients (e.g. OPC Interface, PI OPCClient tool, etc.) use proxy DLL‘s to
communicate with OPC Servers. On the client node the following files are needed
opcproxy.dll and opccomn_ps.dll. These files are usually installed during the
interface installation. However, if they are missing, the client will not be able to
communicate to the server. These files are also located (usually in …\system32
directory) on the OPC Server node. They can be manually copied and registered on the
client node.
Here is how to register: Make sure they are both copied (opcproxy.dll and
opccomn_ps.dll) into …\system32 directory. Run
C:>regsvr32 opcproxy.dll
The following dialog box should appear:
46
DCOM Configuration Details
Select ―Network Access: Sharing and security model for local accounts‖. Verify that it is set
to ―Classic: Local users Authenticate as themselves‖.
Security Settings
If you do not want to use the system‘s settings, you can use the interface‘s special
command line parameters that can set the DCOM security for the interface. This can be
done with /DA and /DI parameters. The changes made to those parameters will only
affect the PI OPC Interface. Here is a brief description of what they do and configuration
options:
/DA parameter is used for setting up the Default Authentication Level. This setting is
necessary for authentication of an OPC server application during establishing a
communication and making calls. The possible options for this parameter are the
following:
Default – Uses a standard negotiation between the interface and OPC Server for
selecting an appropriate authentication level. This may vary depending on
Windows OS;
None – Does not use authentication. All security settings are ignored;
Connect – The authentication takes place only when an initial connection is
made to the server. After connection has been established, no additional
authentication checks will be performed.
Call – The authentication occurs at the beginning of each RPC call (i.e. a
callback from OPC Server). In this case the data packet headers are signed, but
the data packets exchange is not signed or encrypted;
Packet – Authenticates the data on a per-packet basis. All data is authenticated.
Packet Integrity – Authenticates and verifies that the data packets are signed
and have not been modified during transit (i.e. checks for packet integrity). The
packets are not encrypted;
50
DCOM Security Configuration for the Interface
Packet Privacy – Includes all previous authentication levels and signs and
encrypts each data packet. This setting ensures that the communication between
the client and the server is confidential.
If you do not set the Default Authentication Level correctly, the OPC server will not be
able to send callbacks to the client. This usually means that all Asynchronous calls (e.g.
Poll or Advise) will not return data updates. The most commonly used settings are
Connect and None.
/DI parameter sets up the Default Impersonation Level. The Default Impersonation Level
is used for granting permissions to the PI OPC Interface for executing permissible
operations on OPC Server objects. The possible options are as follows:
Anonymous – The client is anonymous to the server. This means that the
identity of the user associated with the OPC Interface is hidden from the OPC
server.
Identify – The OPC Server can identify the user associated with the OPC
Interface, and can perform actions as that user.
Impersonate – The OPC Server can perform actions as the user associated with
the OPC Interface, but is not allowed to access other computers as that user.
Delegate – The DCOM server can act as the user associated with the DCOM
client, including access other computers as that user (only supported in Windows
2000 and later)
The most commonly used settings are Identify and Impersonate.
PI OPCTool
The PI OPCTool is also installed with the interface. It is located in a sub-directory of the
…\PIPC\PI-OPC Tools\ called PI_OPCTool. This tool used to be the main tool for
testing connection to and supported functionality of OPC Servers. OSIsoft recommends
using the PI OPCClient for these purposes and leave the PI OPCTool only as a debugging
utility when requested by tech support for troubleshooting specific OPC Server problems
with their server vendors.
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.
Point Attributes
PI tags/points have approximately 50 attributes. These attributes define how data are to
be collected and stored for the point. The proper configuration of these attributes is the
key to optimizing the PI Server for both data storage efficiency and quick retrieval. Each
PI interface handles specific point attributes differently.
The following information is necessary to define PI OPC tags for use with an OPC
Server. Failing to correctly configure the PI tags will mean that the interface cannot
communicate properly with the OPC Server. See Appendix A: Error and Informational
Messages for information on how to recognize configuration problems.
Tag
The 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.
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: PI SDK Options for information.
PointSource
The PointSource is a unique single or multiple character string that is used to identify the
PI point as a point that belongs to a particular interface. For additional information, see
the /ps command-line parameter and the ―Point Source‖ section.
PointType
Typically, 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.
PI 2 Server Nodes
Scaled real, full-precision real, integer, and digital point types are supported on
PI 2 Servers. For more information on the individual point types, refer to the
Data Archive (DA) section of PI System Manual I.
PI 3 Server Nodes
Float16, float32, float 64, int16, int32, digital, string, and blob point types are supported
on PI 3 Servers. For more information on the individual point types, see PI Server
manuals.
The interface supports all PI point types except the BLOB, but not all OPC Servers will
support all PI point types. Refer to the vendor-supplied documentation for the OPC
Server to determine what point types are supported by the specific server. If the point
type defined in PI does not match the canonical data type defined in the OPC Server, the
interface will attempt to translate the data. To determine whether the point can be read as
the type needed, use the PI OPCClient to try to read the point directly from the OPC
Server. Also, see the Data Types section for special settings.
Location1
Location1 indicates to which copy of the interface the point belongs. The value of this
attribute must match the /id startup parameter.
Location2
This field is used to indicate special handling. See the discussion on DataTypes for more
information.
Location2 = 0
Normal processing; no special handling is used.
Location2 = 1
If Location2 is 1, the value in the OPC Server will be read as a String and written as a
String. For Digital tags, this will only work if the strings read from the OPC Server are
an exact match for the strings in the Digital State Set used by the tag. See the Data
Archive Manual for a complete discussion of Digital State sets and Digital State tags.
For Integer and Real tags, setting Location2=1 will cause the interface to request a
String value, and then try to translate that String value into a number.
60
PI Point Configuration
Location2 = 2
If Location2 is set to 2 for a Digital State tag, the value will be read as a Boolean.
Booleans having only two possible values, zero and nonzero; Location2=2 can only be
used if the Digital State Set only has two values. Likewise, for numeric tags, any value
but 0 will be True (-1), and a value of 0 will be False (0). Note if receiving a Boolean
from the OPC Server for a two-state Digital tag, this option must be used in order to
correctly convert the OPC Server Boolean into the PI Digital State. If this option is not
used, the PI tag may get ‗Bad‘ values for a Boolean when it is ‗True‘.
Location2 = 3
If Location2 is set to 3, the value will be read as a 4-byte integer. This setting is
included to accommodate servers which cannot send the value as a 2-byte integer. This is
how Digital tags are normally read.
Location2 = 4
This setting will cause the interface to store the quality of the item rather than the value.
This allows the interface to store the value of the item in one tag and the quality in
another.
Location2 = 5
This setting is for floating point numbers. By default, the interface will request Real tags
as VT_R4 items (4-byte real). If Location2 is set to 5, the interface will request Real
tags as VT_R8 items (8-byte real). For Float32 tags, including all PI2 Real tags, values
that cannot be fit in a 32-bit floating point number will lose precision. This setting is
included to enable the use of servers which do not translate VT_R8 data to VT_R4 data
themselves, or to allow the use of Float32 tags where the benefit of greater precision is
not worth the overhead of using Float64 tags.
Location2 = 6
This setting allows reading timestamps from the OPC Server as strings and transforming
those strings into a number of seconds. The PI tag may be an Int or a Float. The format
of the timestamp string is specified in the startup file with the /TF parameter and the
same format is used for all tags. For more information on this, see the section above on
Datatypes.
Location2 = 7
This setting allows the interface to read timestamps from the OPC Server as VT_DATE
variables. These values can either be translated into timestamp strings or passed to PI as
a number of seconds, suitable for use in computations. If the value is translated into a
String, the timestamp format specified with the /TF parameter will be used. For more
information on this, see the section above on Datatypes.
Location2 = 8
This setting will allow the server to determine the Datatype. The interface will try to
transform the value into the proper data type for the PI tag. This may not be possible in
all cases, so use this with caution, and only when the OPC server will not provide data
without specifying a Datatype. It is always better to specify what type of data to get,
unless the server will not honor such a request.
62
PI Point Configuration
InstrumentTag
This field contains the ItemID for the tag. The format of this field depends on the
specific OPC Server being used. Refer to the documentation for the server to determine
the proper format. This field must exactly match the point defined on the OPC Server.
That means punctuation, spaces, uppercase vs. lowercase, etc. If the ItemID is longer
than 32 characters and you have a PI 2 system, use the ExDesc attribute and leave this
attribute blank.
Note: If the ItemID contains trailing spaces, and the interface is configured to NOT use
the PISDK, you must specify the ItemID in the ExDesc field instead, as trailing spaces will
be truncated by the API when the PISDK is not used.
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.
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: PI SDK Options for information.
To verify an ItemID, use the PI OPCClient. If the OPC server supports browsing, use
List Server’s Tags to see a list of defined ItemIDs. Double-clicking on an ItemID
in the tree will result in the full ItemID being displayed in the Item field. This is the
ItemID that should be used in InstrumentTag.
Note: If there is anything in the InstrumentTag, the ExDesc is not checked for an OPC
ItemID.
ExDesc
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 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.
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: PI SDK Options for information.
64
PI Point Configuration
To define an event tag, this field will contain ―event=tagname‖, where ―tagname‖ is
any valid PI tagname. When that tag has an exception event, the points for which it
is the event, or ―trigger‖, will be read from the OPC Server.
For a long ItemID:
If the ItemID for this point is longer than 32 characters and a PI 2 system is being
used, the ItemID must use the ExDesc in the form instr=ItemID. Note that the
ItemID must exactly match the ItemID defined on the OPC Server. If the ItemID
contains a comma, enclose it in double quote characters (―), such as:
Instr=”whatever.you, or someone*needs*”
This can also be applied to a PI 3 system.
To specify an ItemID with trailing blanks:
Some OPC Items may have trailing blanks, which can be truncated if not using the
PISDK and specifying the ItemID in the InstrumentTag field. To include the trailing
blanks, the ItemID must be specified in the ExDesc field, as shown above.
To specify 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
To specify the ItemID to receive the timestamp for an output value:
When the output value is to go to one ItemID and the timestamp that comes with the
output value is to go to another ItemID, specify the timestamp ItemID in ExDesc.
Thus, the ItemID specified in the InstrumentTag field or in ExDesc as
instr=ItemId will get the value and the ItemID specified in the ExDesc field will
get 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 is to receive the timestamp:
Tim=ItemID
Dat=ItemID
Both of these formats will write the date and time. The difference is that Tim=
indicates that the interface is to write the timestamp as a string (VT_BSTR), formatted
according to /TF setting in the startup file, while using Dat= indicates that the
interface is to write the timestamp as a VT_DATE. When written as a VT_DATE, the
timestamp is in universal (UTC) format, so there is no dependence on the time zone
or daylight savings time setting. When written as a VT_BSTR, the timestamp is that
of the PI Server, and is not adjusted for differences in time zone or daylight savings
time setting. The timestamp written to the OPC Server is the same timestamp seen
on the PI machine when looking at the archive timestamp.
Please note that in error messages relating to this timestamp ItemID, the interface
will report a generated tagname of the form TS:xxxxxx, where xxxxxx will be the PI
tagname of the output tag.
If this field is used to specify more than one of the above items, put a comma between the
definitions.
This field can contain 80 characters for a PI 2 system or 1024 for a PI 3 system.
SourceTag
An output point is associated with a source point by setting the SourceTag attribute of
the output point equal to the tag name of the source point.
See the section below on ―Output Points‖ for more information.
TotalCode
This field holds the code used to indicate what scaling to apply to the value. It is used in
conjunction with the SquareRoot, Convers, and ExDesc attributes. See the section on
Transformations and Scaling for a complete description of how to use this field. Valid
values are 0 through 5, with 0 being the default.
SquareRoot
This field is used to indicate that the value stored in PI or written to the device should be
squared first, or the square root should be found. See the section on Transformations and
Scaling for a complete discussion of its use. Valid values for this field are 0, 1, and 2.
The default is 0.
Convers
This field is used for scaled tags to hold the device span. Just as a PI tag has a zero and a
span, which together define the legal range of values, the device Item may have a DZero
and a DSpan, which define the actual span of values, which the device will send. The
interface can use those two ranges to translate from the units used by the device to the
units defined for the PI tag. The Convers field may also hold an offset or multiplier.
See the section on Transformations and Scaling for more information on how to use this
attribute.
Userint1
This attribute is used to indicate the index number for a tag within an array. The OPC
standard supports reading data as an array of values; the array has one timestamp and one
quality, with multiple values attached to them. These items can be identified by using the
PI OPCClient to add the item to a group, and then perform a Sync Read. The tool will
display the data type of the item, and if it is an array item, the Type of the value will be
VT_ARRAY & VT_other, where VT_other will be one of the valid data types such as
VT_R4 or VT_I2. The values in the array are all sent as one data item and they will all
be the same data type.
To map these values to PI tags, the interface uses the Userint1 attribute to give the one-
based index into the array for each tag. Thus, the first value in the array will correspond
to the tag with Userint1=1, the second to the tag with Userint1=2, and so on. If these
values need to be processed as different data types, use the Location2 attribute and the
settings for Scaling and Transformation, to vary how the interface handles the individual
value for a given tag. The interface will receive the data as the data type shown in the
tool, but it can then process the value according to how the tag is configured.
All the tags that belong to the same array must have exactly the same values in
InstrumentTag, ExDesc, and all Location attributes. The tag names can be
whatever is appropriate.
Note: All tags that are not part of an array MUST have a zero in Userint1.
66
PI Point Configuration
Userint2
This field is used to designate an event group for an event tag. See the section on Event
Tags for more on this topic.
Note: All tags that are not event tags MUST have a zero in Userint2.
Scan
The Scan attribute has the default value of 1, indicating that the Interface should collect
data for the point; setting the Scan attribute to 0 turns off data collection for that point. If
the Scan attribute is 0 when the interface starts, the Interface will not load the point
(SCAN OFF will not be written) and the point will not get any data updates. If the user
changes the Scan attribute from 1 to 0 while the interface is running, the Interface writes
SCAN OFF only when it detects that change. This might take up to 2 minutes.
There is one other situation, which is independent of the Scan attribute, where UniInt will
write SCAN OFF to a PI point. If a point that is currently loaded by the interface is edited
so that the point is no longer valid for the interface, the point will be removed from the
interface, and SCAN OFF will be written to the point. For example, if the PointSource of a
PI point that is currently loaded by the interface is changed, the point will be removed
from the interface and SCAN OFF will be written to the point.
Shutdown
PI 2 Server Nodes
The Shutdown attribute is not used if the server node is a PI 2 system. For information on
configuring shutdown events for PI 2, see Data Archive (DA) section 4.2.3 of
PI System Manual I.
PI 3 Server Nodes
The 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 15 minutes
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 PI points 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
It is undesirable to write shutdown events when Bufserv is being used. Bufserv is a utility
program that provides the capability to store and forward events to a PI Server, allowing
continuous data collection when the Server is down for maintenance, upgrades, backups,
and unexpected failures. That is, when PI is shut down, Bufserv will continue to collect
data for the interface, making it undesirable to write SHUTDOWN events to the PI points
for this interface.
Exception Processing
Because the PI OPC Interface is based on UniInt, exception reporting is handled by the
UniInt interface. See the UniInt Interface User Manual for more information about
exception processing.
The following parameters control exception reporting in the PI OPC Interface.
ExcMax
The longest time period allowed between sending values to the PI Server.
For Advise tags, if the interface does not receive a value after ExcMax
seconds, and the interface has no indication that communication with the
OPC server has failed (the interface checks the connection every 30
seconds), it assumes that the value has remained the same and sends
the last value received to the PI Server with the timestamp set to the
current time.
For Polled tags, the interface sends a value to the PI Server if it has not
sent one in the last ExcMax seconds, even if the new value does not pass
ExcDev tests.
ExcMin
The minimum time between values sent to the PI Server.
ExcDev
The minimum change from the last value sent to the PI Server that causes the
interface to send a new value event to the PI Server.
To turn off exception reporting, all three parameters, ExcMax, ExcMin, and ExcDev
must be set to 0.
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 the OPC server. The PI OPC Interfaces uses
Location3=2 to indicate 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.
Trigger Method 1 (Recommended)
For trigger method 1, a separate source point must be configured. The output point must
have the same point source as the interface. The source point can be associated with any
point source, including the point source of the interface. Also, the point type of the source
point does not need to be the same as the point type of the output point.
The output point is associated with the source point by setting the SourceTag attribute of
the output point equal to the tag name of the source point. An output is triggered when a
68
PI Point Configuration
new value is sent to the Snapshot of the source 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 source 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 source 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.
In the above example, every time a value is written to Sinusoid, the same value will be
sent to the OPC Item ItemID1, and if the write is successful, the value will also be written
Advise Tags
For Advise tags, the interface asks the OPC Server to send data when it changes, and how
often it should read the device to see if there is a new value. The scan period or requested
update rate (/UR) sets that time span. Here is an example:
Tag ExDesc InstrumentTag loc1 loc2 loc3 loc4 loc5 UserInt1 UserInt2
AdvFiveSecs.PV ItemID1 1 0 1 4 0 0 0
AdvOneMin.PV ItemID2 1 0 1 2 0 0 0
AdvNinetyMins.PV ItemID3 1 0 1 3 0 0 0
Note that the same settings in the startup file can be used for either Polled or Advised
tags, but to use both of these sample configurations, there would need to be another three
scan periods, using the first set for either Advised or Polled tags, and the second set for
the other types of tags. So the scan class parameters would be:
/F=2 /F=1:00 /F=1:30:00 /F=00:00:05 /F=2 /F=1:00 /F=1:30:00 /F=00:00:05
Tag ExDesc InstrumentTag loc1 loc2 loc3 loc4 loc5 UserInt1 UserInt2
FiveSecond.PV ItemID1 1 0 0 4 0 0 0
OneMinute.PV ItemID2 1 0 0 2 0 0 0
NinetyMinute.PV ItemID3 1 0 0 3 0 0 0
AdvFiveSecs.PV ItemID1 1 0 1 8 0 0 0
AdvOneMin.PV ItemID2 1 0 1 6 0 0 0
AdvNinetyMins.PV ItemID3 1 0 1 7 0 0 0
70
PI Point Configuration
Event Tags
Event tags are only read when the triggering event occurs. An event happens when the PI
snapshot receives a value for the trigger tag. It may have the same timestamp and quality
and value as the last event so the snapshot value for that trigger may seem the same, but
the act of receiving a value for the trigger tag causes the interface to receive a notification
that the trigger has been updated.
To configure triggered input tags set Location4=0 and specify the name of the trigger
tag in the ExDesc field using the following format:
TRIG=’triggertagname’ event_condition.
where the triggertagname is enclosed in single quotes and if
specified the event_condition immediately follows the
triggertagname. If the event_condition is not specified then it
defaults to Anychange. See the UniInt Interface Users Manual for
more information on the event_condition field.
The default update rate for event groups is 1 second, so the server will be asked to update
its cache every second for every event tag defined. That is probably faster than is
necessary, especially if using a server that uses the OPC v2.0 standard, where all
asynchronous reads are done from the device, so updating the cache is essentially wasted
effort. If the OPC server is v2.0, set the event rate (/ER in the startup file) to something
much higher, perhaps 8 hours. Even if the OPC server is v1.0a, where asynchronous
reads are from the cache, the cache does not need to be updated that often for all event
tags.
Use UserInt2 to specify in which event group an event tag belongs. The parameter
does nothing else; it is only an instruction to the interface as to which tags get read
together. All values for a single read must be returned at the same time, so grouping has
different effects on different servers. Also, a plug-in DLL that does post-processing of
data before the data is sent to the PI Server may require that a set of data be processed as
a complete set so all the tags that make up that set must be in the same group.
For v1.0a servers, it is useful to separate event tags into groups based on the triggering
event. This is the most efficient mode.
For v2.0 servers, it is probably more important to separate event tags based on where the
data actually comes from. The OPC v2.0 standard requires that all asynchronous reads be
read from the device, rather than from the server‘s cache, so set the cache update rate
very high, and most importantly, try not to have an event group contain values that come
from different devices. Typical example:
Tag ExDesc InstrumentTag loc1 loc2 loc3 loc4 loc5 UserInt1 UserInt2
PM1_Temp.PV TRIG=PM1 ItemID1 1 0 0 0 0 0 1
_Trigger
PM1_Rate.PV TRIG=PM1 ItemID2 1 0 0 0 0 0 1
_Trigger
PM2_Temp.PV TRIG=PM2 ItemID3 1 0 0 0 0 0 2
_Trigger
In this case, PM1_Trigger and PM2_Trigger are tags that are updated from somewhere,
either by this interface, by another interface, or by manual entry. When PM1_Trigger
gets a new event in the PI snapshot, the interface will send the OPC Server one read
command, which requests data for both PM1_Temp.PV and PM1_Rate.PV. Both values
will be returned in a single call. Likewise, when PM2_Trigger gets an event in the
snapshot, the interface will request a value for PM2_Temp.PV.
Array Tags
OPC Servers can provide data in the form of arrays. Each OPC array consists of multiple
values (i.e. array elements) of the same datatype and only one quality and timestamp
associated with them. The OPC interface can read array data and store them in two
different ways: 1. each element value goes into separate PI tags; 2. all values go into one
PI tag. Here we will describe how to configure the first case. The second case requires
using the TimeArray plug-in of the interface (see TimeArray plug-in manual for more
details).
Since the PI Server doesn‘t support array datatypes, the interface should extract
individual values from an array before putting them into PI tags. This requires a special
configuration of those tags. So, to configure PI tags for array elements, use the ItemID of
the array item as the InstrumentTag and UserInt1 should have the index number of
the specific element within the array. Thus, if the array item has 100 values/elements in
it, configure 100 tags, all with the same InstrumentTag or ExDesc (e.g. with
instr=ItemId), and the tag with UserInt1=1 will get the first value in the array, the
tag with UserInt1=2 will get the 2nd value in the array, and etc. The tag with
UserInt1=1 will actually cause the interface to read array values. So a tag should
always be configured for the first element, even if the value is not required. If all values
of the array are not required then configure PI tags only for those required. In this case,
the interface will ignore the ones that are omitted. However, a tag must be configured for
the first value of the array.
All PI tags configured for a specific array must have matching PointSource,
Location1, and Location4 (and UserInt2, if they are event tags) tag attributes. If
multiple arrays are to be read, they should be put into a separate scan classes. For
instance, if one of the arrays has 300 or more tags, then the two arrays should not be
sharing the same scan class and/or have a lot of other tags in the scan class with the array.
This is due to the way the interface processes arrays. For a given ItemID, which
distinguishes the array, the interface expects to find only one tag for each array element.
So if the same array item needs to be read more than once, each tag that points to that
array item must be in a different scan class.
Note: While many tags may have the same ItemID or the same array member, do not
have more than one set of tags in a scan class or event class that points to arrays.
72
PI Point Configuration
2. Polled tags – set Location3=0 and Location4 to the same scan class for the array
tags as follows:
Tag ExDesc InstrumentTag loc1 loc2 loc3 loc4 loc5 userint1 userint2
ArrayTag0001.PV Data.Array 1 0 0 4 0 1 0
ArrayTag0002.PV Data.Array 1 0 0 4 0 2 0
ArrayTag0002.PV Data.Array 1 0 0 4 0 3 0
Since all the tags within one array must belong to the same group, even if the OPC server
is v2.0 and some part of the array data comes from a different device than the rest of the
array data, all the array tags must still be configured to be in the same event group.
In summary, there can be many scan classes with the same scan period and event classes
are just a logical grouping of tags, so putting event arrays into their own classes with only
the other tags that need to be read with the array is efficient and makes it easy to keep
track of what tags are read as a set.
This manual includes examples where a single array tag from the OPC Server can be read
into multiple PI tags. In this case each PI tag will get its own value (based on UserInt1)
and the same timestamp and quality, since an array comes with multiple values and only
one timestamp and quality associated with them. However, if an array tag is to be read
into a single PI tag, then the TimeArray plug-in of the OPC Interface is needed in
addition to UserInt1. The TimeArray plug-in allows storing the array of values into a
single PI tag as successive data values, incrementing the timestamp that came with the
array by a configured interval for each value. For more details on how to use this plug-
in, please refer to the TimeArray plug-in manual.
Reading Basic Quality as a Digital Tag
It has been already shown how to read the quality of a value rather than reading the value
itself, and it has also been mentioned how to use transformations and scaling to adjust the
value read. These two options may be combined to create a PI tag that corresponds to the
quality of the item, translated into a simple digital state set of Bad Value,
Questionable Value, Invalid Value, and Good Value, in that specific order. Set
Location2=4 to tell the interface to read the quality rather than the value of the item.
Lastly, set up a transformation to mathematically translate the quality values into one of
those three values (0, 1, 2, or 3).
All that is really needed is to divide the quality number by a conversion factor, which will
get the proper number, since the values are defined to be within ranges. The possible
values for the quality have the ranges as follows:
Less than 0x40 Bad Value
At least 0x40, but less than 0x80 Questionable Value
At least 0x80, but less than 0xc0 Not used by OPC
At least 0xc0 Good Value
Each range has a size of 0x40. Using that as the conversion factor means that no offset is
needed. In the table of available conversions we find:
74
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.
The PI OPC Interface on Windows has a PI ICU Control that will aid in configuring the
PI OPC Interface startup command file:
From the PI ICU menu, select Interface, NewWindows Interface Instance from EXE…,
and then Browse to the opcint.exe executable file. Enter a value for the Host PI
System (required):, Interface name as displayed in the ICU
(optional):, Point Source, Interface ID# and Service 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. If this value is not filled in the
default will be InterfaceExecutableName# . (i.e. OPCInt2)
Click on Add.
A display such as the following should appear:
Note that in this example the Host PI System is MKELLYLAPTOP. However, if you
want the interface to communicate with a different PI Server, you need to make the
remote PI Server node as your Default server before going to the above step. This can be
done by selecting ‗Connections…‘ item from PI ICU menu. If you do not see the remote
node in the list of servers, you can add that in and then make it Default by pressing the
‗Set as Default‘ button.
Once the interface has been added to PI ICU, near the top of the main PI ICU screen, the
Interface Type should be opcint. If not, use the drop-down box to change the Interface
Type to be opcint.
Then add an entry for the Scan Classes. The values of these entries specify the frequency
at which the interface reads values from the OPC Server.
Click on Apply to enable the PI ICU to manage this copy of the PI OPC Interface.
76
Startup Command File
The next step is to make selections in the interface-specific tab (i.e. ―opcint‖) this allow
the entry of values for the startup parameters that are particular to the PI OPC Interface.
Since the PI OPC Interface is a UniInt-based interface, in some cases the user will need
to make appropriate selections in the UniInt tab. This tab allows the user to access
UniInt features through the PI ICU and to make changes to the behavior of the interface.
The interface can be setup as a Windows Service, by using the Service tab. This tab
allows the configuration of the interface to run as a service as well as to start and stop the
interface. The interface can be run interactively from the PI ICU also. To do that, click
on the Interface item and then Start Interactive or as a short cut just type a Ctrl+T.
For more detailed information on how to use the above-mentioned and other PI ICU tabs
and selections, please refer to the PI Interface Configuration Utility User Manual. In the
next section the other options will describe the selections that are available from the
opcint tab. After these selections have been made on the PI ICU GUI, you will need to
press the Apply button in order for PI ICU to make these changes to the interface‘s startup
file.
List Available Servers -- This button when click get a list of OPC Server
Names from system found in the OPC Server Node Name field. It populates the
OPC Server Name dropdown list.
OPC Server Node Name – The name or IP address of the OPC Server Node
(/SERVER=node::name); Leave blank if interface and OPC server are on same
node.
OPC Server Name – Registered name of OPC server on the OPC Server node.
(/SERVER=node::name);
Force v1.0a Protocol – Normally, the interface will try to connect with the
v2.0 OPC Data Access specification (/VN=2), but if that does not work it will use
v1.0a. This parameter forces the interface to use v1.0a OPC Data Access
specification without trying v2.0 first. It is useful if an OPC Server only works
with v1.0a (/VN=1);
Timestamps:
78
Startup Command File
Advanced Options
Time delay before reading OPC Tags (sec) – This parameter specifies a
delay (in seconds) before reading from or writing to the OPC Server. If this
parameter is specified, the interface will connect to an OPC Server and wait till
the delay time is expired. (/SD=#)
Event Tags Source -- Determines whether event tags are read from the OPC
Server‘s CACHE or directly from the DEVICE for v1.0a servers. For v2.0
servers, it has no impact, because all event tag reads are from DEVICE (/ES=#,
where # is CACHE or DEVICE)
Advise Groups on Creation -- Some OPC Servers do not return an initial
value when an Advise PI tag is created. The symptom is that when an Advise tag
is created for a value that does not change often, the interface does not write a
value to PI when it first starts up. This problem can be tested by using PI
OPCClient to create a group, add tags, and then Advise the group. If an
immediate value is not returned for your tags, but adding another tag to the group
gets a value for that tag, this parameter will need to be used. Clicking the
checkbox sets /AF=Y;
Disable Mass Tag Adding -- It is faster to add many items to a group at once,
instead of one by one. But some servers will reject the entire group if one tag is
invalid, and it can take a lot of work to figure out which tag was the problem. So
the interface can be set to add tags one at a time (/MA=N) by clicking the
checkbox);
GlobalLocking Not Valid -- If ―‖OnDataChange: Invalid group ID‖ is in the
pipc.log file try clicking this checkbox (/GL=N). If this helps, it means that
the OPC server is does not follow the OPC specifications so please, e-mail us at
[email protected] and tell us what server it is so we can talk to the
vendor. This flag is only meaningful for version 1.0a of OPC DA.
Ignore Group Status -- If ―OnDataChange: Header status:‖ is in the
pipc.log file, the Group status sent by the server is invalid. Clicking the
checkbox set tells the interface to ignore the group status (/GS=N). This flag is
only meaningful for version 1.0a of OPC DA.
Ignore Server Status -- The OPC Server should go to
OPC_STATUS_RUNNING state when it is ready to send data. If it does not, set
the interface to try to talk to it anyway by clicking this checkbox (/IS=Y);
Ignore OPC Server Access Rights -- If ―Invalid read/write mode
requested‖ is found in the pipc.log file, click this checkbox (/AR=N);
Use Honeywell Plantscape Failover Error Codes -- Enable checking for
error codes specific to the Honeywell Plantscape system, for server-level
failover. Obsolete because Honeywell stopped using these codes after only one
release (/HWPS);
Reconnect to Server Delay (sec) -- If the server goes away ungracefully,
and the interface gets an error code indicating the RPC server is unavailable or
too busy to answer, the interface will wait this many seconds before trying to
reconnect (/RD=#);
Update Rate -- This parameter specifies the requested update rate if different
from the scan period. Select a scan class from the dropdown box, enter a period
of time in the box to the right of the scan class, and click on the square box
80
Startup Command File
within a box just above the period; the scan class, scan rate, and update rate will
appear in the box below the period. Only those scan classes with update rates
appear in this box. (/UR=period). This option is useful when the server should
always have a very recent value for the items, but the interface will not read it
very often, such as when the interface will poll for the value every 30 minutes,
but the value itself must be no more than 1 minute old. Be aware that this
imposes more load on the OPC server than having the update rate and the scan
period be the same, but it can reduce latency of values for items which only need
to be read less frequently.
Data Handling
Staggered Group Activation -- This option will cause the interface to make
all groups inactive on startup, and to stagger the activation of the groups based
upon the offsets specified with the scan period for the group. This will only have
an effect on some servers, but for those servers, it will aid in leveling the
workload on the server to avoid having all groups with the same scan period be
scheduled for update at the same time. Note that this does not enforce any
particular server behavior, it only provides assistance in creating a more
measured demand on the server, if the server is able to take advantage of the
delays. This option must NOT be used if there are tags in scan class 1, as those
tags will not get activated. (/GA)
Inactivate Groups on Startup -- This option will cause the interface to make
all groups inactive on startup. Once the groups are built, then the groups will be
activated. This is to help with CPU issues on startup. (/GI)
82
Startup Command File
the wall clock but the server‘s time zone information is required to be something
other than the local zone), this will set the interface to adjust all the timestamps
by a specific amount. The format is the same as that of the scan period
parameters (/F), but may be optionally preceded by a negative sign
(/TO=HH:MM:SS or /TO=-HH:MM:SS).
Event Update Rate -- This parameter defines the requested update rate for the
event class group. All event-based points belong to one group, and the default
update rate for the group is one second. If the OPC Server‘s data cache for
event-based tags does not need to be updated that frequently, use this parameter.
For example: /ER=00:00:10. For v2.0 servers, all event reads are done from
device, so this value should be set quite large, /ER=24:00:00, unless there is
some other reason to update the cache.
DCOM Security
another server when the current server no longer serves data, when an OPC item changes
value or quality, or when the server changes state. For this primary and
secondary/backup OPC servers must be specified.
For Cluster Interface Level failover, two copies of the interface must be running at the
same time along with Microsoft Clustering to control which copy of the interface is
actually collecting data at any given time. This failover can be combined with Server
Level failover.
UniInt Interface Level failover is also designed to provide redundancy on the interface
level. However, UniInt failover doesn‘t require a Microsoft Cluster; instead two copies
of the interface can be installed on different interface nodes collecting data
simultaneously from a single OPC Server. This failover can also be combined with
Server Level failover. UniInt failover includes Hot, Warm, and Cold failover modes.
The complementary information on server and Clustered redundancy configuration of the
PI OPC Interface is given in great detail in the OPC DA Interface Failover Manual. Here
we only list available selections from the PI ICU for the interface specific parameters.
For the full discussion of UniInt Failover, see UniInt Failover Configuration.
UniInt Interface Level Failover
The first three options on this page are only available if Warm Failover is selected on the
UniInt Failover tab. If Hot or Cold Failover, is selected, or none, then the Warm mode
selections are inactive.
84
Startup Command File
This node is the -- Select whether this node is Primary (/PR=1) or Backup
(/PR=2);
Failover mode –
Chilly (/FM=1) -- do not create groups on the server;
Cool (/FM=2) -- Create groups inactive, and add tags;
Warm (/FM=3) -- Create groups active, do not advise groups (the default mode);
Cluster Mode -- Selects behavior for the backup interface.
Primary Bias (/CM=0) -- specifies this node as the preferred primary.
No Bias (/CM=1) -- specifies no preferential mode, where whichever interface is
active will stay active until the cluster resource fails over, either through a failure
or through human intervention.
Resource Number for APIOnline -- Identify the apionline instance that goes
with this interface instance (/RN=#). /RN=1 will indicate that the interface is to
depend on apionline1 (i.e. will look for the service named apionline1), /RN=2
will indicate that the interface is to depend on apionline2, and so forth. /RN=-1
will indicate that the service is apionline.
Active Interface Node Tag -- This is the string tag into which should be
written the name of the currently active interface node (/CN=tag).
Health Tag Id – If cluster level failover is enabled, a Health Tag ID (/UHT_ID)
parameter must be specified. This parameter is used to filter UniInt Health Tags
by Location3. The parameter should be different from another interface – failover
member parameter. If the same /UHT_ID value is used for both instances, the
text box will have yellow background color indicating an invalid value. If this
parameter has an invalid value or is missing, the default value of 0 will be used
for the Location3 PI attribute when creating UniInt Health Points (/UHT_ID=#,
where # is the number for the Location3 PI Attribute).
86
Startup Command File
Backup OPC Server Node Name -- The name or IP address of the backup
OPC Server Node (/BACKUP);
Backup OPC Server Name -- The registered name of the backup OPC Server
on the above node (/BACKUP);
List Servers -- This button when clicked gets a list of OPC Server Names from
the system found in the Backup OPC Server Node Name field. It populates the
Backup OPC Server Name dropdown list.
Number of Interfaces on this Node -- The count of how many instances of
the OPC interface are running on this node (/NI=#);
Switch to Backup Delay (sec) -- The number of seconds to try to connect,
before switching to the backup server (/FT=#);
Wait for RUNNING State (sec) -- The number of seconds to wait for
RUNNING status, before switching to the backup server (/SW=#);
Current Active Server Tag -- The string tag into which should be written the
name of the currently active OPC server (/CS=tag);
Primary Server Watchdog Tag -- Watchdog tag for the Primary Server
(/WD1=tag);
Backup Server Watchdog Tag -- Watchdog tag for the Backup Server
(/WD2=tag);
Plug-Ins
Post Processing DLL -- The DLL name and path to the post-processing DLL,
e.g. DLL=“c:\pipc\Interfaces\OPCInt\plug-ins\mydll.dll”
Plug-In Configuration File -- This is the name of the post-processing DLL
configuration file. This text box will only be visible if the post-processing DLL
requires a configuration file.
88
Startup Command File
Miscellaneous
Debug
This selection allows the user to set the debugging parameter (/DB). The debugging
parameter is a troubleshooting tool that enables logging interface behavior to specific
files. The parameter is a Bit-mask value, which means more than one option can be set at
the same time and the Debug-Level counter will show the total value. For more
information on debugging see Appendix C: Debugging.
Internal Testing Only -- This is for internal testing only, and is not useful to
users (/DB=1);
Log of Startup -- Log startup information for each tag, including
InstrumentTag and ExDesc (/DB=2);
Log Write Op’s and Acks for Tag: -- This parameter will cause the PI OPC
Interface to log every time it sends a write to and every time it receives an ACK
from the OPC server, as well as any time it stores a write into its ―pending write‖
queue. This can also be done for a specific tag if the Debug Tag field is entered.
(/DB=4);
Log Timestamps of Refresh -- This setting will cause the interface to create
three files: opcscan.log, opcrefresh.log, and opcresponse.log.
(/DB=8);
Log Information for ExcMax -- Log information about exception reporting
(/DB=16);
90
Startup Command File
Log Timestamp and Data (All Tags) -- This setting will log the timestamp
with the data, the adjusted timestamp, the PI time, the scan class, and TransID for
each data value that the interface receives (/DB=32);
Log Timestamp and Data for Tag -- This setting will log the same items as
/DB=32, but the interface will log them for only the tag specified as the debug
tag (/DB=64 /DT=tagname). Enter the tagname in the Debug Tag box;
Log Cluster and Failover Information -- (/DB=128);
Logging of Event Tags -- This will causes the interface to print the name of
each tag into the pipc.log file as it receives data for the tag. (/DB=256);
Logging of Array Tags -- Log information about the array tags (/DB=512);
Logging of OPC List Pointers -- This is internal and is not useful for users
(/DB=1024);
Ignore Point Edits -- This setting will cause the interface to ignore PI point
edits after startup. This is not usually useful to users (/DB=2048);
Log TS, Data and Quality for Tag: -- This will write timestamps, values, and
qualities directly in the pipc.log for a tag that is specified in the Debug Tag field
(/DT=tagname). If there is no tag specified, the first tag for which a value is
received will be declared the debug tag. Care should be taken when using this
option as many messages may be written to the pipc.log file. (/DB=4096);
Log debugging info for /US command -- This setting provides debugging
information for the /US command line parameter and is enabled only when the
Update Snapshot (/US) option is checked. (/DB=8192);
Set Debug Level via a Tag -- Enter the name of a PI tag that has the debug
level. This should be an Int32 tag, configured as an output tag for the interface.
When the value of the tag is changed, the interface will capture the new debug
parameter value. Nothing will be written to the OPC Server for this tag
(/DF=tag);
Debug Tag: -- This parameter is used in conjunction with the /DB=4, 64, and
4096 to log information for a particular tag. This text box is only enabled if one
or more of the above debug check boxes are checked. The button to the right of
the text box can be used to browse for a tag using the tag search facility.
Debug Level -- This value in this box changes as the debug options are
selected. It will be the actual value for the command line (/DB=#).
Additional Parameters
In the space provided the user can supply additional parameters that are not available
through the PI ICU control selections. For example: /dbUniInt=0x0400. Each
parameter needs to have at least one space between it and the next. If a parameter has an
argument and the argument has an embedded space the argument must be enclosed in
double quotes. For example:
/dllconfig=”D:\ProgramFiles\PIPC\Interfaces\OPCInt\Plugins\DaVinciConfiguration.txt”
Note: The UniInt Interface Users Manual includes details about other command-line
parameters, which may be useful.
92
Startup Command File
Command-line Parameters
The list of command-line parameters that is given in the table below describes the details
about each parameter and how it can be used. The list is ordered alphabetically; grouping
them by usage is given in Appendix F: List of Startup Parameters Grouped by Usage.
Note: If the interface startup file has been modified by the PI ICU, do NOT change it
manually. Use the PI ICU to make any changes.
Parameter Description
/AF=c The /AF parameter is provided to help deal with servers which
Optional do not return initial values for Advise tags. This parameter
must not be used in conjunction with Windows Cluster
Default: /AF=N
Failover, as it causes OPC Groups to be advised as soon as they
are created. Set /AF=Y if you do not get an immediate value for
your tags, but adding another tag to the group gets you a value
for that tag.
/AM=# The /AM parameter can be used to control the number of tags
Optional for each advise group created with the first scan class. The
Default: 800 recommended and default value is 800 tags per group.
/AR=c The /AR parameter is used to tell the interface to ignore the
Optional access rights property on items added to a group (/AR=N) and
Default: /AR=Y attempt to use the item anyway. If the interface logs the error
―Invalid read/write mode requested‖; try using /AR=N
The default is to use the access rights property on items (AR=Y).
/AS=system_digital The /AS parameter is used to assign alternate digital states for
Optional questionable and bad qualities. To use this option, it is
Default: none necessary to create a digital state in the system digital state set
that corresponds to the system_digital parameter of the
command line option. Then, any digital states that follow the
system_digital marker are used to map digital states to PI
points when data with questionable or bad qualities are received
from the OPC server, overriding the default digital states listed
in the tables in the Storing Quality Information Directly section.
To determine the correct order of the digital states following the
system_digital, it is necessary to consult the table in
Storing Quality Information Directly section of this manual.
/BACKUP=name The /BACKUP parameter is used if the server-level failover
Optional option is used. This switch specifies the name of the backup
Required for server-level OPC Server. The backup server name is specified after an equal
sign with no spaces or quotes as follows:
failover
/BACKUP=backuphostname::backupOPCservername
Default: none
If the OPC Server is on the local machine, the hostname:: must
be omitted:
/BACKUP=backupOPCservername
If your server name has embedded spaces, enclose the name in
double quotes:
/BACKUP=”Server name with spaces”
Parameter Description
/CM=# Cluster Mode. When the interface is configured for interface-
Optional for interface level level failover, running on a cluster, this parameter specifies
failover. which mode to use. Mode 0 (/CM=0) is the original mode, with
Default: /CM=0 a preferred primary. Mode 1 (/CM=1) is a non-preferential
mode, where whichever interface is active will stay active until
the cluster resource fails over, either through a failure or through
human intervention.
For more on failover modes, please, see the section below on
Interface-level Failover.
/CN=tagname When the interface is configured for interface-level failover,
Optional for interface level running on a cluster, this parameter can be used to specify a PI
failover string tag which will receive the node name of the interface
which is currently gathering data. This allows tracking of which
Default: none
cluster node was the active interface node. Specify the PI tag
with
/CN=tagname
This tag should be configured to be a Lab tag, or otherwise not
belong to a point source which is in use.
/CO=c This parameter is only useful when, for some reason, you are
Optional not using PI API buffering (bufserv). When the PI Server
becomes unreachable, the interface will still try to send the data,
Default: /CO=N
but it will fail. When an attempt to send data succeeds, the
interface can send the current PI value for all output tags to the
device, just as it does when the interface first starts. By default,
the interface will simply wait for the next new value to come
before writing anything to the OPC Server. If you want the
interface to send the current values to the OPC Server when the
PI Server comes back online, include this parameter in your
startup file:
/CO=Y
/CR=c This parameter is only useful when, for some reason, you are
Optional not using PI API buffering (bufserv). When the PI Server
becomes unreachable, the interface will still try to send the data,
Default: /CR=N
but it will fail. When an attempt to send data succeeds, the
interface can call Refresh for all of the Advise tags, to send their
current value to PI, just as it does when the interface first starts.
By default, the interface will simply wait for the next value to
come in. If you want the interface to request the current values
from the OPC Server when the PI Server comes back online,
include this parameter in your startup file:
/CR=Y
/CS=tagname When the interface is configured for server-level failover, this
Optional parameter can be used to specify a PI string tag which will
receive the name of the server which is currently providing data.
Default: none
This allows tracking of which server was the active server
across a period of time. Specify the PI tag with:
/CS=tagname
This tag should be configured to be a Lab tag, or otherwise not
belong to a point source which is in use.
94
Startup Command File
Parameter Description
/DA=string Default Authentication level is part of DCOM security settings
Optional for the interface. This parameter is used to set the interface
specific authentication level that is necessary to verify the
Default: /DA=CONNECT
identity of the OPC Server during calls. The following security
levels can be used:
DEFAULT
NONE
CONNECT
CALL
PKT
PKT_INTEGRITY
PKT_PRIVACY
This parameter should be used in combination with /DI
parameter. The default value of this parameter will be used only
if the user is set /DI and does not set /DA. If neither of
parameters is set, the interface will use the computer‘s default
DCOM security settings. See DCOM Configuration Details
section for more details.
/DB=# This is included to allow some minimal debugging if you have
Optional difficulty figuring out what you‘re getting from your server.
See Appendix E: Debugging for more information.
Default: 0
/DC Disable Callbacks. This option is designed to reduce the load
Optional on the OPC Server by disabling callbacks for groups that are
being Polled. Polled groups have callbacks enabled by default
Default: Callbacks Enabled
but are not used by the interface. Explicitly disabling the call
for all groups.
backs should reduce the load on the OPC Server. For Advise
groups this option has no effect.
/DF=tagname This parameter allows you to change the value of the debug
Optional parameter while the interface is running. Configure an Int32
output tag for the interface, and set its value to 0. Give the
Default: none
name of this tag with the /DF parameter. For example:
/DF=OPC.Debug.Flag
Give it a dummy InstrumentTag. When you change the value
in the PI tag, the interface will capture the new value and set its
debug parameter to that value. Nothing will be written to the
OPC Server. See the section on Debugging for more
information.
Parameter Description
/DI=string Default Impersonation level is part of DCOM security settings
Optional for the interface. This parameter is used to set the interface
specific impersonation level that can grant to an OPC Server to
Default: /DI=IDENTIFY
perform processing tasks on its behalf. The following authority
levels are allowed:
ANONYMOUS
IDENTIFY
IMPERSONATE
DELEGATE
This parameter should be used in combination with /DA
parameter. The default value of this parameter will be used only
if the user is set /DA and does not set /DI. If neither of
parameters is set, the interface will use the computer‘s default
DCOM security settings. See DCOM Security Configuration for
the Interface section for more details.
/DLL=filespec The interface supports post-processing DLLs for specific
Optional operations or specific OPC Servers. The format for telling the
interface where to find your DLL is :
Default: none
/DLL=drive:\directory\to\the\file\yourdll.d
ll
where you replace the directory path and filename with the
appropriate one for your DLL. It will typically be in the
Plug-Ins sub-directory of the interface directory.
/DLLCONFIG=filespec This is the directory path and filename of the configuration file
or for the post-processing DLL. Some post-processing DLL do not
/DLL_INI=filespec require a configuration file.
Optional
Default: none
/DT=tagname The name of the tag to be used with /DB=64. If this tag is not
Optional specified, the interface will use the first tag for which it receives
Default: none a value.
/EC=# The first instance of the /ec parameter on the command line is
Optional used to specify an event counter number, x, for an I/O Rate
Default: 1 point. If x is not specified, then the default event counter is 1.
Also, if the /ec parameter is not specified at all, there is still a
default event counter of 1 associated with the interface. If there
is an I/O Rate point that is associated with an event counter of 1,
each copy of the interface that is running without /ec=x
explicitly defined will write to the same I/O Rate point. This
means that one should either explicitly define an event counter
other than 1 for each copy of the interface or one should not
associate any I/O Rate points with event counter 1.
Configuration of I/O Rate points is discussed in the section
called ―I/O Rate Tag Configuration.‖ Although the interface will
allow multiple instances of the /ec parameter to be specified on
the command line, the rate will only be nonzero for the first rate
tag that is referenced.
96
Startup Command File
Parameter Description
/ER=hh:mm:ss This parameter defines the requested update rate for the event
Optional class group. All event-based points belong to one group and the
default update rate for the group is one second. If the OPC
Default: /ER=00:00:01
Server‘s data cache for event-based tags does not need to be
updated that frequently, use this parameter. For example:
/ER=00:00:10
For v2.0 servers, all event reads are done from device, so this
value should be set quite large, /ER=24:00:00, unless there
is some other reason to update the cache.
/ES=string This parameter determines whether event tag reads for v1.0a
Optional servers will be from CACHE or from DEVICE. DEVICE reads
should be used with caution, as they can have a tremendously
Default: /ES=CACHE
negative impact on the performance of the OPC Server. Please
read the section on Configuring Event Tags before using this
setting: /ES=DEVICE.
/f=SS The /f parameter defines the time period between scans in
or terms of hours (HH), minutes (MM), and seconds (SS). The scans
/f=SS,SS can be scheduled to occur at discrete moments in time with an
or optional time offset specified in terms of hours (hh), minutes
/f=HH:MM:SS (mm), and seconds (ss). If HH and MM are omitted, then the time
or period that is specified is assumed to be in seconds.
/f=HH:MM:SS,
hh:mm:ss Each instance of the /f parameter on the command line defines
a scan class for the interface. There is no limit to the number of
scan classes that can be defined. The first occurrence of the /f
Required for reading scan- parameter on the command line defines the first scan class of the
based inputs interface; the second occurrence defines the second scan class,
Default: none and so on. PI Points are associated with a particular scan class
via the Location4 PI Point attribute.
Two scan classes are defined in the following example:
/f=00:01:00,00:00:05 /f=00:00:07
or, equivalently:
/f=60,5 /f=7
The first scan class has a scanning frequency of 1 minute with
an offset of 5 seconds, and the second scan class has a scanning
frequency of 7 seconds. When an offset is specified, the scans
occur at discrete moments in time according to the formula:
scan times = (reference time) + n(frequency) + offset
where n is an integer and the reference time is midnight on the
day that the interface was started. In the above example,
frequency is 60 seconds and offset is 5 seconds for the first scan
class. This means that if the interface was started at 05:06:06,
the first scan would be at 05:06:10, the second scan would be at
05:07:10, and so on. Since no offset is specified for the second
scan class, the absolute scan times are undefined. Performance
can be further improved by defining scan offsets as explained in
the Polling and Advising section.
Note that offsets only determine when the interface will ask the
OPC server for the current values for polled classes. They do
not control the behavior of the OPC server, and for advise
classes, they have no effect by themselves. If the /GA
parameter is specified, to stagger the activation of groups, then
the offsets will be used to time the activation of all groups
Parameter Description
except for scan class 1 (the special advise class).
This interface will support 200 polled classes and 600 advise
classes.
Sub-second Scan Classes
One can also specify sub-second scan classes on the command
line such as
/f=0.5 /f=00:00:00.1
where the scanning frequency associated with the first scan class
is 0.5 seconds and the scanning frequency associated with the
second scan class is 0.1 of a second.
Similarly, sub-second scan classes with sub-second offsets can
be defined, such as
/f=0.5,0.2 /f=1,0
If the OPC server does not support the requested scan
frequency, the frequency assigned to the class will be logged in
the pipc.log file.
/FM=# Failover mode. This controls the behavior of the backup
Optional for interface level interface when using interface-level failover. The options are:
failover. /FM=1 Chilly: Do not create groups on the server
Default: /FM=3 /FM=2 Cool: Create groups inactive and add tags
/FM=3 Warm: Create groups active, but do not advise groups
For more on failover modes, please see the OPC DA Interface
Failover manual.
/FT=# The /FT parameter is used in conjunction with the /BACKUP
Optional for server level parameter to specify the failover time. The interface will keep
failover trying to connect to the current server for this many seconds
before it gives up and tries to connect to the other server. The
Default: /FT=60
interface will stay on a given server, once connected, until that
server fails, or the watchdog tag(s) indicates that it is no longer
the active server.
This parameter also affects how often the interface will check
the server status. If the failover time (FT) specified is less than
30 seconds, the interface will call GetStatus on the server every
FT seconds. If /FT is not specified, or is more than 30
seconds, GetStatus will be called every 30 seconds. This serves
as a watchdog to ensure that the server is still reachable and
responding, and also allows the interface to monitor clock drift
between the systems. Note that this parameter has a large
impact on systems using the /WS parameter.
/GA For some servers, the load on the OPC server can be leveled
somewhat by having the groups activated one at a time, with a
slight delay between them. This can avoid the problem of
having all scan classes with the same scan period being read all
at once, which can cause the OPC server to be overloaded. For
those servers, using the Group Activation parameter along with
specifying offsets for the scan periods will cause the staggering
of the activation of the groups. See the /f parameter for more
on offsets.
98
Startup Command File
Parameter Description
/GI With this option, the interface will make a group inactive on
Optional startup. Once the groups are built, then the groups will be
activated. This is to help with CPU issues on startup.
/GL=c Some early v1.0a servers did not format messages according to
Optional the OPC specifications and the interface included a work-around
for those servers. This is now turned off by default. If you
Default : /GL=Y
receive the error message ‖OnDataChange: Invalid group ID‖,
try setting /GL=N to see if that fixes it. If it does, please e-mail
OSIsoft at [email protected] to report what server
you‘re using. If possible, e-mail the pipc.log file..
/GS=c The /GS parameter is intended to allow the use of older, non-
Optional compliant OPC Servers which do not provide a valid
GroupStatus on asynchronous reads. If the log file contains an
Default: /GS=Y
error like, ―OnDataChange: Header status‖ followed by a
hexadecimal number, and NO data gets to PI, try using /GS=N
to tell the interface to ignore the group status parameters. If you
are getting some data, but are also getting this error on some
reads, contact the vendor for your OPC Server and give them
the error number, so they can help you determine why your
OPC Server is returning this error indication for the group in
question.
/host=host:port The /host parameter is used to specify the PI Home node.
Required Host is the IP address of the PI Sever node or the domain name
Default: Server in of the PI Server node. Port is the port number for TCP/IP
PILOGIN.INI communication. The port is always 5450 for a PI 3 Server and
545 for a PI 2 Server. It is recommended to explicitly define the
host and port on the command line with the /host parameter.
Nevertheless, if either the host or port is not specified, the
interface will attempt to use defaults.
Defaults:
The default port name and server name is specified in the
pilogin.ini or piclient.ini file. The
piclient.ini file is ignored if a pilogin.ini file is
found. Refer to the PI API manual for more information on the
piclient.ini and pilogin.ini files.
Examples:
The interface is running on a PI Interface Node, the domain
name of the PI 3 home node is Marvin, and the IP address of
Marvin is 206.79.198.30. Valid /host parameters would be:
/host=marvin
/host=marvin:5450
/host=206.79.198.30
/host=206.79.198.30:5450
Parameter Description
/HQ=# The /HQ parameter sets the upper limit for the internal queue of
Optional the interface. The interface may take in data from the OPC
Server faster than it can pass it to PI, or faster than PI will
Default: /HQ=100000
accept data. This data is queued in memory until it can be
DO NOT USE THIS passed to PI. If the internal queue grows too large, it can take so
PARAMETER UNLESS much virtual memory that Windows becomes unstable. This
DIRECTED TO DO SO BY queue limit is a safeguard against such behavior. If the internal
OSIsoft. queue exceeds the HQ limit, the interface will log the fact that it
is exceeding its limits, and it will drop incoming data until the
internal queue has dropped below the low queue limit (LQ).
It is strongly recommended that this value not be changed unless
you are willing to lose incoming data. This parameter is
intended for debugging system performance problems.
/HS=c /HS=Y makes the interface request a cache update rate of ½ of
Optional the scan rate for the scan class. If your scan class is 2 seconds,
the interface will ask the OPC Server to read new values from
Default: /HS=N
the device every second, for all the tags in this scan class. This
OBSOLETE is mostly included for debugging problems with servers, since
we won‘t look at the cache any more often than the scan rate
anyway. If the tags are advised, the scan rate is only used to
define the requested update rate for the group, so you‘d do just
as well to make the scan rate the same as the requested update
rate.
This parameter is obsolete -- use /UR instead.
/HWPS This parameter tells the interface to check for the Plantscape-
Optional specific error codes below when retrieving data values. It
specifically checks for an Item error code of 0xE00483FD or
0xE00483FC, and if it finds either of them, it will attempt to
failover to the other OPC Server.
/ID=# The /id parameter is used to specify the interface identifier.
Optional The interface identifier is a string that is no longer than 9
Default: none characters in length. UniInt concatenates this string to the
header that is used to identify error messages as belonging to a
particular interface. See the section called ―Error and
Informational Messages‖ for more information.
UniInt always uses the /id parameter in the fashion described
above. This interface also uses the /id parameter to identify a
particular interface copy number that corresponds to an integer
value that is assigned to Location1. For this interface, one
should use only numeric characters in the identifier. For
example,
/id=1
/IF=c The /IF=Y parameter tells the interface to ignore the first value
Optional sent for each point. This is to accommodate those servers that
send a response when the interface connects to a point: some
Default: /IF=N
servers send a value back, regardless of whether or not they
have a valid value, and neglect to send a status that would
indicate that the value is invalid. This generally manifests as
odd-looking values showing up whenever the connection to the
OPC Server is established or a point is edited.
100
Startup Command File
Parameter Description
/IS=c /IS=Y tells the interface to ignore the server status returned by
Optional the OPC Server, as far as determining the appropriate actions to
take. All servers should return
Default: /IS=N
OPC_STATUS_RUNNING
when they‘re ready to add groups and items and return values,
but some servers do not do this. If the interface hangs on
startup, and the PI OPCClient shows something in
Server current state =
that isn‘t ―RUNNING‖, you should use this parameter, and
report the problem to your OPC Server vendor.
/IT=c For performance reasons, /IT=Y may be used to discard the
Optional sub-second portion of the timestamps being passed to PI and
only send whole integer seconds. This will mean that PI will
Default: /IT=N
require less space, and possibly less CPU, to store the same
amount of data. The fractional part of the second is simply
truncated. .
/LQ=# The /LQ parameter sets the lower limit for the internal queue of
Optional the interface. If the internal queue has exceeded the HQ limit, the
Default : /LQ=80000 interface will drop incoming data until the internal queue size
has dropped below the low queue limit.
DO NOT USE THIS
It is strongly recommended that this value not be changed unless
PARAMETER UNLESS
you are willing to lose incoming data. This parameter is
DIRECTED TO DO SO BY
OSIsoft. intended for debugging system performance problems. The
difference between HQ and LQ must be greater than 100.
/MA=c By default, the interface will add one item at a time to its
Optional groups. This guards against servers that will reject an entire
group if one item is invalid. /MA=Y tells the interface to add all
Default: /MA=N
the items in a class at the same time. If your OPC Server allows
it, you should use /MA=Y. If this causes lots of tags to be
rejected by the server, remove the /MA parameter, at least until
you determine which tag is the problem.
/MAXSTOPTIME=# The interface, by default, gets 120 seconds to close its
Optional connections and exit cleanly. If your server requires more time,
use this parameter.
Default:
/MAXSTOPTIME=120
/NI=# The /NI parameter specifies the number of instances of the
Optional interface running on the node. This switch is used in conjunction
Used in conjunction with with /FT parameter to specify how long the interface is to wait
/FT if multiple instances until it initiates a server-level failover. This gives the multiple
of the interface are running interfaces extra time to DCOM timeout in case a DCOM call
on the same node. made to the server doesn‘t return in time because the server is
busy servicing requests from other interfaces.
/NT=c The /NT=Y parameter tells the interface to never write I/O
Optional Timeout when it loses the connection to the OPC Server. You
will almost always want to have I/O Timeout written to the tags
Default: /NT=N
at those times, but the ability to turn it off is included for very
special circumstances.
Parameter Description
/OPCSTOPSTAT=state Use this parameter to specify that a digital state should be
Optional written to each input tag when the interface is shut down to
show that data collection was stopped. If no digital state is
Default: /OPCSTOPSTAT=
specified, the interface will use ―I/O Timeout‖, but you can
”Intf Shut”
specify any state in the System State Set. The suggested usage
is /OPCSTOPSTAT=”Intf Shut”.
WARNING: It is common with UniInt-based interfaces to use
the /STOPSTAT parameter. This parameter must not be used
with the PI OPC Interface, instead, use /OPCSTOPSTAT, since
using /STOPSTAT may cause invalid values to be stored to the
PI tags.
/PISDKCONTIMEOUT=# Set the timeout for PISDK calls. The parameter is the number
Optional of seconds to wait before timing out. The default is 15 seconds.
Default:
/PISDKCONTIMEOUT=
15
/PR=# The /PR parameter specifies whether interface-level failover is
Required for interface-level to be supported.
failover /PR=0 No interface-level failover
Default: /PR=0 /PR=1 This is to be the primary interface.
/PR=2 This is to be the secondary/backup interface.
/PS=c The /ps parameter specifies the point source for the interface.
Required c is not case sensitive and can be any single or multi character.
Default: none For example, /ps=P and /ps=p are equivalent.
The point source that is assigned with the /ps parameter
corresponds to the PointSource attribute of individual PI Points.
The interface will attempt to load only those PI points with the
appropriate point source.
/QT=tagname This allows you to define a PI tag which will receive the count
OBSOLETE of how many items the interface has queued up to go to the PI
System. Under normal conditions, this number should be fairly
low and fairly steady, but if PI is slowed down by other
processing or if the OPC Server sends a large burst of data, you
may see it jump. The tag should be an integer tag (Int32 for PI
3), set up for manual input as though it is a lab tag.
Note: This parameter is now obsolete and not supported
as of version 2.3.6.0 of the OPCInt interface.
102
Startup Command File
Parameter Description
/RN=# The /RN parameter specifies the resource number if there are
Optional to be multiple instances of the OPC interface running (with
Required for interface-level different service names) on the same machine in conjunction
failover when multiples with, each dependent on a uniquely-named resource, apionline#.
instances of OPCInt are /RN=1 will indicate that the interface is to depend on
running on the same node. apionline1 (i.e. will look for the service named apionline1),
/RN=2 will indicate that the interface is to depend on
Default: none
apionline2, and so forth. See the Interface-level Failover section
for a more detailed explanation. If interface-level failover is to
be supported and this number is negative (/RN=-1), the cluster
resource name is assumed to be apionline without the suffix #.
/RP=# The /RP parameter specifies the required percentage of tags
Default: /RP=80 which are accepted by the OPC server as valid. If less than this
percentage is accepted, the interface will set its device status to
Connected/No Data, which will trigger failover if UniInt
failover is configured.
/SD=# This parameter specifies a delay (in Seconds) before reading
Optional OPC tags. If this parameter is specified, the interface will
connect to an OPC Server and wait till the delay time is expired.
Default: none
During the waiting period the interface will not perform any
reading from or writing to the OPC Server. This behavior affects
all types of OPC tags, i.e. Polled, Advise, and Output tags.
/SERVER=node::name The OPC Server to be used is defined with this command line
Required parameter. Use the following format:
Default: none /SERVER=FACT1NODE::registeredOPC
where FACT1NODE is the name of the computer where the OPC
Server will run and registeredOPC is the name of the OPC
Server as registered on that machine. If the server will be
running on the same machine as the interface, the node name
must be omitted:
/SERVER=registeredOPC
If your server name has embedded spaces, enclose the name in
double quotes:
/SERVER=”Server name with spaces”
/SG Send only GOOD quality data. If the /SG is set, only GOOD
Optional quality data will be sent to PI. Questionable quality data and
Default: None BAD quality data will be ignored.
If the /SQ=I or /SQ=Y parameter is also set, then
Questionable Quality data will be sent to PI as described by the
/SQ parameter. BAD quality data will continue to be ignored.
The quality information will continue to be sent to tags that are
configured to store quality instead of values.
Parameter Description
/SQ=c For ―uncertain‖ qualities, the interface will by default store the
Optional value, and only flag it as ―uncertain.‖ (/SQ=N) Setting this
Default: /SQ=N parameter to /SQ=Y will cause the interface to store the quality
rather than the value if the quality is anything except GOOD.
Setting this parameter to /SQ=I will cause the interface to
ignore the quality information and treat a questionable quality as
GOOD. BAD quality will still result in a digital state code being
sent to the archive.
/ST=tagname This allows you to define a PI tag (so called the status tag) that
Optional will get the status of the OPC Server whenever it changes.
Although the interface checks for OPC Server‘s status every 30
Default: none
seconds, if the status doesn‘t change from the previous state, the
status tag will not get a new value. This tag should be a digital
state tag, set up for manual input as though it is a lab tag. The
possible values are:
1 = OPC_STATUS_RUNNING
2 = OPC_STATUS_FAILED
3 = OPC_STATUS_NOCONFIG
4 = OPC_STATUS_SUSPENDED
5 = OPC_STATUS_TEST
Note that if the server returns anything other than one of the
states above, a 0 will be sent to PI so that if only the states
above are defined in the digital set, OPC_STATUS_RUNNING
will be archived, since it will be the 0th state. Therefore, the 0th
state in the digital set should be configured to a meaningful state
to denote this.
/STARTUP_DELAY=# If the interface is installed for autostart, but it hangs when the
Optional machine reboots, the network layer may need time to get settled
before trying to use it. This parameter will make the interface
Default: none
sleep for # seconds before trying to actually do anything. The
basic form is:
/STARTUP_DELAY=#
where # is the number of seconds to wait.
/STARTUP_DELAY
will cause a 30-second delay.
/SW=# Even with server-level failover enabled, once the interface has
Optional successfully connected to the server, it will wait forever for the
server to enter OPC_STATUS_RUNNING status or drop the
Default: none
connection. You can use the Status Wait (/SW) parameter to
limit the number of seconds that the interface will wait for the
server to enter OPC_STATUS_RUNNING state. The
parameter is the number of seconds (some interval) which the
interface should wait. If the Status Wait interval has expired and
the connected server has not entered the
OPC_STATUS_RUNNING state, the interface will fail over to
the other server.
For example: /SW=5
104
Startup Command File
Parameter Description
/TF=format This parameter allows you to specify the format of timestamp
Optional strings. The setting will be used for tags with Location2 = 6
Default: none or 7, where the ItemID is either a string that contains a
timestamp, or a VT_DATE value, and also for writing output
timestamps using TIM= in the ExDesc field. See the sections
above on Location2 settings, Data Types, and ExDesc for
more information. The Data Types section gives example
format strings.
Format: valid tokens are
cc yy mn mon dd hh hr mm ss 000 XM
/TO=##:##:## Timestamp Offset. This parameter allows you to apply an
Optional adjustment to all timestamps (coming from the server) to deal
with servers and installations that do not follow the OPC
Default: /TO=00:00:00
specifications, where the clock for the OPC 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). This should not be used if
you have a properly working server. The format is the same as
that of the scan period parameters (/F), but may be optionally
preceded by a negative sign.
Format:
/TO=01:00:00
/TO=-03:00:00
/TS=c This parameter determines whether the interface expects to get
Optional timestamps for the data from the server or whether it will
timestamp the data when it receives it. Some OPC Servers are
Default: /TS=N
able to provide the timestamp for when they read the data from
the device, while others are not.
If the Interface will provide the timestamp when it receives the
data, use:
/TS=N
If the OPC server is able to provide valid timestamps, use:
/TS=Y
If the OPC server can provide valid timestamps only for advised
tags, use:
/TS=A
If you need to store times without having them adjusted to the
PI Server clock, use:
/TS=U
This setting can cause your data to be lost, if your clocks are set
incorrectly. Please see the section on Timestamps before using
this setting.
Parameter Description
/uht_id=# The /uht_id=# command-line parameter is used to specify a
Optional unique ID for interfaces that are run in a redundant mode
Default = Health tags are without using the UniInt failover mechanism. There are several
not filtered by location3 OSIsoft interfaces that are UniInt based and implement their
own version of failover. In order for health tag(s) to be
unless UniInt failover is
configured to monitor a single copy of the interface, an
used
additional parameter is required. If the /uht_id=# is
specified, only health tags with a location3 value = # will be
loaded.
/UR=HH:MM:SS.000 The /ur parameter sets the requested update rate for the group.
Optional This parameter is positional, like the /f scan period parameter.
Default: /UR=scanrate The update rate will be applied to the scan period it follows. If
no update rate is specified for a scan class, the period of the scan
class will also be the update rate. Thus, if you have
/f=00:00:02 /f=00:00:03 /ur=00:00:00.5
/f=00:00:01, you get scan class one with a period of 2
seconds and an update rate of 2 seconds, scan class 2 with a
period of 3 seconds and an update rate of 0.5 seconds, and scan
class 3 with a period of 1 second and an update rate of 1 second.
For polled groups, having the update rate shorter than the scan
period can ensure that when the interface asks for the current
value, the server has updated its cache since the last scan. Thus,
if the scan period is 5 seconds but the update rate is 2 seconds,
the server will read the data source every 2 seconds, but the
interface will only request data every 5 seconds, and the data
will be no more than 2 seconds old when it is read. Be aware
that a faster update rate puts more load on the OPC server.
The update rate for advise groups should be the same as the scan
period, since there is no gain from having them different, except
in the case of UniInt failover. For UniInt failover, because
UniInt uses the scan period as the expected rate of change of
heartbeat tags, it is good to have the update rate shorter, perhaps
half of the scan period. This helps ensure that the OPC server
will see the new heartbeat value as soon as possible, and that
will reduce the risk of thrashing, where each interface thinks it
should be primary, and control switches back and forth
needlessly. Note that it is best to have only the failover tags in
this scan class, with the faster update rate.
/UWQ=# This parameter directs the interface to fail over to the
Optional other interface if the number of watchdog tags with quality other
than GOOD is greater than the parameter value, or if there is an
Default: none
error on reading the item. Note that version 1.0a servers do not
return error codes for individual items, so for v 1.0a servers this
parameter only checks the quality of the value sent from the
server. This parameter is only available when configured for
UniInt Failover.
/US When the /us (update snapshot) parameter is set, if the
Optional current snapshot is a system digital state (i.e. I/O timeout,
shutdown, etc.) and the new value read in is older than the
Default: None
snapshot, the interface sends the new value 1 second after the
snapshot timestamp of the system digital state. This check will
not be done if the current snapshot is a good value.
106
Startup Command File
Parameter Description
/VN=# The /VN=1 parameter is used to tell the interface that the OPC
Optional Server uses OPC v1.0a. If this parameter is omitted or /VN=2
Default: /VN=2 is used, the interface will try to communicate using OPC v2.0,
and will fall back to v1.0a if v2.0 does not succeed.
/WD=# When using multiple watchdog tags, failover will be triggered if
the sum of the values of these tags drops below the # specified
by the /WD option.
/WD1 The /WD1 and /WD2 parameters can be used if the redundant
/WD2 OPC Servers return OPC_STATUS_RUNNING status when in
Optional backup mode as well as in primary mode. Please see the section
on Watchdog Tags in the OPC DA Interface Failover manual
Default: none for more information.
/WQ=# /WQ=# directs the interface to fail over to the other server if the
Optional number of watchdog tags with quality other than GOOD is
greater than the /WQ= option, or if there is an error on reading
Default: none
the item. Note that v1.0a servers do not return error codes for
individual items, so for version 1.0a servers this parameter only
checks the quality of the value sent from the server.
/WS=# Once the interface connects to a server that enters the
Optional OPC_STATUS_RUNNING state, it will stay connected until
the server disconnects and the watchdog tag indicates that this is
Default: /WS=0
not the active server, or the interface is shut down. (/WS=0)
If you want the interface to disconnect from the server if the
server leaves the OPC_STATUS_RUNNING state, set this
parameter to: /WS=1
By default, the server status is checked every 30 seconds. This
can be adjusted to be more frequent by using the /FT parameter
to specify the failover time.
REM======================================================================
REM
REM OPCInt.bat
REM
REM Sample startup file for the PI OPC Interface to the PI System
REM
REM======================================================================
REM
REM OSIsoft strongly recommends using PI ICU to modify startup files.
REM
REM Sample command line
REM
.\opcint ^
/ps=OPC ^
/id=1 ^
/SERVER=OSI.DA.1 ^
/host=XXXXXX:5450 ^
/f=00:00:01 ^
/f=00:00:01 ^
/f=00:00:01 ^
/f=00:00:02
REM
REM End of OPCInt.bat File
108
UniInt Failover Configuration
Introduction
To minimize data loss during a single point of failure within a system, UniInt provides two
failover schemas: (1) synchronization through the data source and (2) synchronization
through a shared file. In this manual, synchronization through the data source is Phase 1, and
synchronization through a shared file is Phase 2.
Phase 1 UniInt Failover uses the data source itself to synchronize failover operations and
provides a hot failover, no data loss solution when a single point of failure occurs. For this
option, the data source must be able to communicate with and provide data for two interfaces
simultaneously. Additionally, the failover configuration requires the interface to support
outputs.
Phase 2 UniInt Failover uses a shared file to synchronize failover operations and provides for
hot, warm, or cold failover. The Phase 2 hot failover configuration provides a no data loss
solution for a single point of failure 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.
Note: Although both failover methods successfully maintain continuous data flow
OSIsoft recommends using Phase 2 because it is supported by more interfaces.
You can also configure the UniInt interface level failover to send data to a High Availability
(HA) PI Server collective. The collective provides redundant PI Servers to allow for the
uninterrupted collection and presentation of PI time series data. In an HA configuration,
PI Servers can be taken down for maintenance or repair. The HA PI Server collective is
described in the PI Server Reference Guide.
When configured for UniInt failover, the interface routes all PI data through a state machine.
The state machine determines whether to queue data or send it directly to PI depending on the
current state of the interface. When the interface is in the active state, data sent through the
interface gets routed directly to PI. In the backup state, data from the interface gets queued
for a short period. Queued data in the backup interface ensures a no-data loss failover under
normal circumstances for Phase 1 and for the hot failover configuration of Phase 2. The same
algorithm of queuing events while in backup is used for output data.
Quick Overview
The Quick Overview below may be used to configure this Interface for failover. The
failover configuration requires the two copies of the interface participating in failover be
installed on different nodes. Users should verify non-failover interface operation as
discussed in the Installation Checklist section of this manual prior to configuring the
interface for failover operations. If you are not familiar with UniInt failover
configuration, return to this section after reading the rest of the UniInt Failover
Configuration section in detail. If a failure occurs at any step below, correct the error and
start again at the beginning of step 6 Test in the table below. For the discussion below,
the first copy of the interface configured and tested will be considered the primary
interface and the second copy of the interface configured will be the backup interface.
Configuration
One Data Source
Two Interfaces
Prerequisites
Interface 1 is the Primary interface for collection of PI data from the data source.
Interface 2 is the Backup interface for collection of PI data from the data source.
Phase 1: The data source must be configured with six failover tags (input and output
tags for three tag types): (1) Active ID, (2) Heartbeat for Interface 1, and (3)
Heartbeat for Interface 2.
Phase 2: The shared file must store data for five failover tags: (1) Active ID,
(2) Heartbeat 1, (3) Heartbeat2, (4) Device Status 1 and (5) Device Status.
You must also setup a file share.
Each interface must be configured with two required failover command line parameters:
(1) its FailoverID number (/UFO_ID); (2) the FailoverID number of its Backup interface
(/UFO_OtherID). You must also specify the name of the PI Server host for exceptions
and PI tag updates.
All other configuration parameters for the two interfaces must be identical.
110
UniInt Failover Configuration
Step Description
4. Configure the PI tags
You must configure six PI tags for the interface (input and output tags for each
of the three failover points on the data source). For more information about
configuring input and output points, refer to the PI Point Configuration section of
this manual.
You can also configure two state tags for monitoring the status of the interfaces.
Tag ExDesc digitalset
ActiveID_In [UFO_ACTIVEID]
ActiveID_Out [UFO_ACTIVEID]
IF1_HB_In
[UFO_HEARTBEAT:#]
(IF-Node1) The remaining attributes must be
IF1_HB_Out configured according to the
[UFO_HEARTBEAT:#] interface manual so the tags map
(IF-Node1)
to the correct points on the data
IF2_HB_In source. Note that "In" tags must
[UFO_HEARTBEAT:#]
(IF-Node2) be configured as inputs, and
"Out" tags must be configured as
IF2_HB_Out
[UFO_HEARTBEAT:#] outputs.
(IF-Node2)
IF1_State
[UFO_STATE:#] IF_State
(IF-Node1)
IF2_State
[UFO_STATE:#] IF_State
(IF-Node2)
A right-click on the list of Failover Tags on the UniInt Failover ICU page gives
the option to export the tag configuration. OSIsoft strongly suggests that you do
so; you will need to edit the file, or edit the tags after creating them, to assign
the Instrument Tag fields to the correct Items in your OPC server.
5. If using PI APS to synchronize the Data Source and PI points, special attention
must be paid to the failover control points and tags. Check that the failover
control points and tags are not included in the PI APS synchronization scheme.
Synchronizing the control points will cause the failover tags to be edited by PI
APS and may result in possible interface shutdown.
6. Test the configuration.
Run the interface with the six Failover Control PI tags to ensure their proper
operation.
1. Start the primary interface interactively without buffering.
2. Verify a successful interface start by reviewing the pipc.log file. The
log file will contain messages that indicate the failover state of the
interface. A successful start with only a single interface copy running
will be indicated by an informational message stating “UniInt
failover: Interface in the “Primary” state and
actively sending data to PI. Backup interface not
available.” If the interface has failed to start, an error message will
appear in the log file. For details relating to informational and error
messages, refer to the Messages section below.
3. Use the PI_OPCClient to verify the values.
The Active ID Item in the OPC Server must be set to the value of
the running copy of the interface as defined by the /UFO_ID startup
command-line parameter.
The Heartbeat Item in the OPC Server must be changing values at
112
UniInt Failover Configuration
Step Description
a rate specified by the /UFO_Interval startup command-line
parameter.
4. Verify data on the PI Server using available PI tools.
The Active ID control tag on the PI Server must be set to the value
of the running copy of the interface as defined by the /UFO_ID
startup command-line parameter.
The Heartbeat control tag on the PI Server must be changing values
at a rate specified by the /UFO_Interval startup command-line
parameter.
5. Stop the primary interface.
6. Start the backup interface interactively without buffering. Notice that this
copy will become the primary because the other copy is stopped.
7. Repeat steps 7, 8, and 9.
8. Stop the backup interface.
9. Start buffering.
10. Start the primary interface interactively.
11. Once the primary interface has successfully started and is collecting
data, start the backup interface interactively.
12. Verify that both copies of the interface are running in a failover
configuration.
Review the pipc.log file for the copy of the interface that was
started first. The log file will contain messages that indicate the
failover state of the interface. The state of this interface must have
changed as indicated with an informational message stating
“UniInt failover: Interface in the “Primary” state
and actively sending data to PI. Backup interface
available.” If the interface has not changed to this state, browse
the log file for error messages. For details relating to informational
and error messages, refer to the Messages section below.
Review the pipc.log file for the copy of the interface that was
started last. The log file will contain messages that indicate the
failover state of the interface. A successful start of the interface will
be indicated by an informational message stating “UniInt
failover: Interface in the “Backup” state.” If the
interface has failed to start, an error message will appear in the log
file. For details relating to informational and error messages, refer
to the Messages section below.
13. Verify data on the OPC Server using the PI_OPCClient.
The Active ID Item in the OPC Server must be set to the value of
the running copy of the interface that was started first as defined by
the /UFO_ID startup command-line parameter.
The Heartbeat Items for both copies of the interface in the OPC
Server must be changing values at a rate specified by the
/UFO_Interval startup command-line parameter.
14. Verify data on the PI Server using available PI tools.
The Active ID control tag on the PI Server must be set to the value
of the running copy of the interface that was started first as defined
by the /UFO_ID startup command-line parameter.
The Heartbeat control tags for both copies of the interface on the PI
Step Description
Server must be changing values at a rate specified by the
/UFO_Interval startup command-line parameter or the scan
class which the points have been built against.
15. Test Failover by stopping the primary interface.
16. Verify the backup interface has assumed the role of primary by
searching the pipc.log file for a message indicating the backup interface
has changed to the “UniInt failover: Interface in the
“Primary” state and actively sending data to PI.
Backup interface not available.” The backup interface is now
considered primary and the previous primary interface is now backup.
17. Verify no loss of data in PI. There may be an overlap of data due to the
queuing of data. However, there must be no data loss.
18. Start the backup interface. Once the primary interface detects a backup
interface, the primary interface will now change state indicating
“UniInt failover: Interface in the “Primary” state
and actively sending data to PI. Backup interface
available.” In the pipc.log file.
19. Verify the backup interface starts and assumes the role of backup. A
successful start of the backup interface will be indicated by an
informational message stating “UniInt failover: Interface in
“Backup” state.” Since this is the initial state of the interface, the
informational message will be near the beginning of the start sequence
of the pipc.log file.
20. Test failover with different failure scenarios (e.g. loss of PI connection
for a single interface copy). UniInt failover guarantees no data loss with
a single point of failure. Verify no data loss by checking the data in PI
and on the data source.
21. Stop both copies of the interface, start buffering, start each interface as
a service.
22. Verify data as stated above.
23. To designate a specific interface as primary. Set the Active ID point on
the OPC Server of the desired primary interface as defined by the
/UFO_ID startup command-line parameter.
114
UniInt Failover Configuration
Step Description
4. Configure the PI tags
Configure five PI tags for the interface: the Active ID, Heartbeat 1,
Heartbeat2, Device Status 1 and Device Status 2. You can also configure
two state tags for monitoring the status of the interfaces.
Do not confuse the failover Device status tags with the UniInt Health Device
Status tags. The information in the two tags is similar, but the failover device
status tags are integer values and the health device status tags are string
values.
Tag ExDesc digitalset UniInt does not
ActiveID [UFO2_ACTIVEID] examine the
remaining
IF1_Heartbeat attributes, but the
(IF-Node1) [UFO2_HEARTBEAT:#] pointsource and
IF2_Heartbeat location1 must
match
(IF-Node2) [UFO2_HEARTBEAT:#]
IF1_DeviceStatus
(IF-Node1) [UFO2_DEVICESTAT:#]
IF2_DeviceStatus
(IF-Node2) [UFO2_DEVICESTAT:#]
IF1_State
(IF-Node1) [UFO_STATE:#] IF_State
IF2_State
(IF-Node2) [UFO_STATE:#] IF_State
Right-clicking on the failover tag list in the ICU will give you the option to have the ICU
create the tags for you. This is highly recommended.
5. Test the configuration.
After configuring the shared file and the interface and PI tags, the interface
should be ready to run.
See Troubleshooting UniInt Failover for help resolving Failover issues.
1. Start the primary interface interactively without buffering.
2. Verify a successful interface start by reviewing the pipc.log file. The
log file will contain messages that indicate the failover state of the
interface. A successful start with only a single interface copy running will
be indicated by an informational message stating “UniInt failover:
Interface in the “Primary” state and actively sending
data to PI. Backup interface not available.” If the
interface has failed to start, an error message will appear in the log file.
For details relating to informational and error messages, refer to the
Messages section below.
3. Verify data in the OPC Server using the PI_OPCClient.
The Active ID Item in the OPC Server must be set to the value of the
running copy of the interface as defined by the /UFO_ID startup
command-line parameter.
The Heartbeat Item in the OPC Server must be changing values at a
rate specified by the /UFO_Interval startup command-line
parameter.
4. Verify data on the PI Server using available PI tools.
The Active ID control tag on the PI Server must be set to the value of
116
UniInt Failover Configuration
Step Description
the running copy of the interface as defined by the /UFO_ID startup
command-line parameter.
The Heartbeat control tag on the PI Server must be changing values
at a rate specified by the /UFO_Interval startup command-line
parameter.
Step Description
which the points have been built against.
15. Test Failover by stopping the primary interface.
16. Verify the backup interface has assumed the role of primary by searching
the pipc.log file for a message indicating the backup interface has
changed to the “UniInt failover: Interface in the
“Primary” state and actively sending data to PI.
Backup interface not available.” The backup interface is now
considered primary and the previous primary interface is now backup.
17. Verify no loss of data in PI. There may be an overlap of data due to the
queuing of data. However, there must be no data loss if using Hot
Failover. If using Warm or Cold Failover, there may be a small gap in the
data, depending on the chosen mode and the OPC server's capabilities.
18. Start the backup interface. Once the primary interface detects a backup
interface, the primary interface will now change state indicating “UniInt
failover: Interface in the “Primary” state and
actively sending data to PI. Backup interface
available.” In the pipc.log file.
19. Verify the backup interface starts and assumes the role of backup. A
successful start of the backup interface will be indicated by an
informational message stating “UniInt failover: Interface in
“Backup” state.” Since this is the initial state of the interface, the
informational message will be near the beginning of the start sequence of
the pipc.log file.
20. Test failover with different failure scenarios (e.g. loss of PI connection for
a single interface copy). UniInt Hot failover guarantees no data loss with
a single point of failure. Verify no data loss by checking the data in PI
and on the data source. For other modes, verify that the server and
backend data system are not unduly burdened by the backup interface.
21. Stop both copies of the interface, start buffering, start each interface as a
service.
22. Verify data as stated above.
23. To designate a specific interface as primary. Set the Active ID point on
the OPC Server of the desired primary interface as defined by the
/UFO_ID startup command-line parameter.
118
UniInt Failover Configuration
The following table lists the start-up parameters used by UniInt Failover. All of the
parameters are required except the /UFO_Interval startup parameter.
Parameter Required/ Description Value/Default
Optional
/UFO_ID=# Required Failover ID for IF-Node1 Any positive, non-
This value must be different from the zero integer / 1
failover ID of IF-Node2.
Required Failover ID for IF-Node2 Any positive, non-
This value must be different from the zero integer / 2
failover ID of IF-Node1.
/UFO_OtherID=# Required Other Failover ID for IF-Node1 Same value as
The value must be equal to the Failover ID Failover ID for
configured for the interface on IF-Node2. IF-Node2 / 2
Required Other Failover ID for IF-Node2 Same value as
The value must be equal to the Failover ID Failover ID for
configured for the interface on IF-Node1. IF-Node1 / 1
/UFO_Interval=# Optional This interface does not support 50 – 20000 / 1000
unsolicited input interface failover
control tags and therefore will not use
this command line parameter to
control the update interval.
120
UniInt Failover Configuration
PI Tags
The following tables list the required UniInt Failover Control PI tags, the values they will
receive, and descriptions.
Active_ID Tag Configuration
Attributes ActiveID IN AcitveID OUT
Tag <Intf>_Active_IN <Intf>_Active_OUT
ExDesc [UFO_ActiveID] [UFO_ActiveID]
Location1 Match # in /id=# Match # in /id=#
Point Source Match x in /ps=x Match x in /ps=x
Point Type Int32 Int32
Shutdown 0 0
Step 1 1
122
UniInt Failover Configuration
The following table describes the extended descriptor for the above PI tags in more detail.
PI Tag ExDesc Required / Description Value /
Optional Default
[UFO_ACTIVEID] Required The Active ID Input Tag must be 0 – highest
configured as an input PI tag for the Failover ID /
interface and it must be configured to None
(Used for both the read the ActiveID on the data source.
ActiveID IN and OUT Updated by
tags.) Consult the PI Point Configuration the
section for a description of redundant
configuring input tags. Interfaces
The ExDesc must start with the case
sensitive string: [UFO_ACTIVEID]
[UFO_HEARTBEAT:#] Required The Heartbeat 1 Output Tag must be 0 – 31 / None
(IF-Node1) configured as an output PI tag for the Updated by
interface and it must be configured to the interface
write to the Heartbeat 1 Point on the on Node 1
Data Source.
Consult the PI Point Configuration
section for a information about
configuring output tags.
The ExDesc must start with the case
sensitive string:
[UFO_HEARTBEAT:#]
The number following the colon (:)
must be the Failover ID for the
interface running on IF-Node1.
Required The Heartbeat 2 Input Tag must be 0 – 31 / None
[UFO_HEARTBEAT:#] configured as an input PI tag for the Updated by
(IF-Node2) interface and it must be configured to the interface
read the Heartbeat 2 Point on the on Node 2
Data Source.
Consult the PI Point Configuration
section for a information about
configuring input tags.
The ExDesc must start with the case
sensitive string:
[UFO_HEARTBEAT:#]
The number following the colon (:)
must be the Failover ID for the
interface running on IF-Node2.
124
UniInt Failover Configuration
Active ID
Heartbeat 1
Heartbeat 2
Data register 0
DataSource
. DCS/PLC/Data Server
.
.
Data register n
Process Network
IF-Node1 IF-Node2
PI-Interface.exe PI-Interface.exe
/host=PrimaryPI /host=SecondaryPI
/UFO_ID=1 /UFO_ID=2
/UFO_OTHERID=2 /UFO_OTHERID=1
Business Network
Synchronization through the data source uses two separate interface nodes communicating
with the data source. The failover scheme requires six tags on the PI Server and three control
points on the data source to control failover operation. The PI tags initialize the interface with
configuration information for reading and writing to the control points on the data source.
Once the interface is configured and running, the ability to read or write to the PI tags is not
required for failover operation because only the control points on the data source are
monitored. However, the PI tag values are sent to the PI Server so that you can monitor them
with standard OSIsoft client tools. You can force manual failover by changing the ActiveID
on the data source to the backup failover ID.
The figure above shows a typical network in the normal or steady state. This diagram doesn‘t
represent the myriad configurations that can be supported; it is simply an example for the
following discussions. If your hardware configuration differs from the figure, the settings for
the Primary and Backup interfaces remain the same with the exception of the /host startup
parameter. If the interfaces communicate with a stand-alone PI Server, the /host parameter
for both interfaces must be the same.
To ensure that output to the datasource continues when a PI Server in the collective becomes
unavailable, the interface running on the primary node (IF-Node1) needs the /host
parameter set to a PI Server that is part of the collective, and the interface running on the
backup node (IF-Node2) needs the /host parameter set to a different PI Server in the same
collective.
The continued operation of output when a PI Server becomes unavailable presumes the
source data for output data (that is, data read from PI and written to the data source) comes
into PI from a process that sends values to all of the PI Servers in the collective via n-way
buffering.
The solid red line in the figure shows input data flow when the interface on IF-Node1 is in
the primary state. The data is read from the data source by the interface and sent to a buffer.
Buffering sends the input data to all of the PI Servers in the collective via n-way buffering.
The solid blue line shows output data flow. Since the interface on IF-Node1 is configured
with /host=PrimaryPI, the interface signs up for exceptions with the PI Server on
PrimaryPI. Exceptions are received by the interface and sent to the data source via the
interface.
The dashed red line shows input data flow to the backup interface. The dashed line stops at
the interface because the interface does not send the data to buffering unless the interface is in
the primary state. If the backup interface transitions to the primary state for any reason, the
backup interface begins to send the input data to buffering. Buffering continues to write the
data to all of the PI Servers in the collective via n-way buffering.
The dashed blue line shows output data flow to the backup interface. The dashed line stops at
the interface because an interface does not send data to the data source unless the interface is
in the primary state. When the backup interface becomes the primary for any reason, it begins
to send output data to the data source.
In the event that the Primary PI Server becomes unavailable for any reason, the primary
interface informs the backup interface that it has lost its connection to the PI Server. The
backup interface becomes the primary interface because its status is better than the current
primary interface. However, if the entire network goes off line and both primary and backup
interfaces lose their connection to their respective PI Servers, the primary interface remains
primary because the current status of the backup interface is the same as the primary, not
better. In this case, output data cannot flow to the data source because there is no way for any
of the interfaces to get the exception data.
Steady State Operation
Steady state operation is considered the normal operating condition. In this state, the primary
interface is actively collecting data and sending its data to PI. The primary interface is also
updating its heartbeat point, monitoring the heartbeat point for the backup interface, and
checking the ActiveID every failover update interval. In this state, the backup interface is
actively collecting and queuing data but not sending the received data to PI. It too is updating
its heartbeat point, monitoring the heartbeat point for the primary interface, and checking the
ActiveID every failover update interval. As long as the heartbeat point for the primary
interface indicates that it is operating properly and the ActiveID has not changed, the
backup interface will continue in this mode of operation.
The interaction of the control points is fundamental to failover. The discussion that follows
only refers to the data written to the control points on the data source. However, every value
written to the control points on the data source is echoed to the control tags on the PI Server.
Updating of the control tags is assumed to take place unless communication with the
PI Server is interrupted. The updates to the PI Server will be buffered by bufserv or BufSS in
this case.
126
UniInt Failover Configuration
Each interface participating in the failover solution will queue two failover intervals worth of
data to prevent any data loss. When a failover occurs, there may be a period of overlapping
data for up to 2 intervals. The exact amount of overlap is determined by the timing and the
cause of the failover and may be different every time. Using the default update interval of 1
second will result in overlapping data between 0 and 2 seconds. The no data loss claim is
based on a single point of failure. If both interfaces have trouble collecting data for the same
period of time, data will be lost during that time.
As mentioned above, each interface has its own heartbeat point. In normal operation, the
value of the Heartbeat point on the data source is incremented by UniInt from 1 – 15 and then
wraps around to a value of 1 again. UniInt increments the heartbeat point on the data source
every failover update interval. The default failover update interval is 1 second. UniInt also
reads the value of the heartbeat point for the other interface copy participating in failover
every failover update interval. If the connection to the PI Server is lost, the value of the
heartbeat point will be incremented from 17 – 31 and then wrap around to a value of 17
again. Once the connection to the PI Server is restored, the heartbeat values will revert back
to the 1 – 15 range. During a normal shutdown process, the heartbeat value will be set to zero.
During steady state, the ActiveID is the failover ID of the primary interface. This value is
set by UniInt when the interface enters the primary state and is not changed by the primary
interface until it shuts down gracefully. During shutdown, the primary interface sets the
ActiveID to zero before shutting down. The backup interface can assume control as primary
even if the current primary is not experiencing a problem. You can force this transition by
setting the ActiveID control point on the data source to the failover ID of the desired
interface.
To prevent data loss during failover, the backup interface continuously queues data in
memory for the two most recent failover update intervals. As long as the backup interface
determines that the primary interface is in good status, the backup interface simply maintains
this queue with the most recent data. When the backup interface transitions to primary status,
the backup begins transmitting to PI starting with the queued data
Data register 0
. DataSource
. DCS/PLC/Data Server
.
Data register n
Process Network
FileSvr
IF-Node1 IF-Node2
.\UFO\Intf_PS_1.dat PI-Interface.exe
PI-Interface.exe
/host=PrimaryPI /host=SecondaryPI
/UFO_ID=1 /UFO_ID=2
/UFO_OTHERID=2 /UFO_OTHERID=1
/UFO_TYPE=HOT /UFO_TYPE=HOT
/UFO_SYNC=\\FileSvr\UFO\Intf_PS_1.dat /UFO_SYNC=\\FileSvr\UFO\Intf_PS_1.dat
Business Network
The Phase 2 failover architecture is shown in Figure 2 which depicts a typical network setup
including the path to the synchronization file located on a File Server (FileSvr). Other
configurations may be supported and this figure is used only as an example for the following
discussion.
For a more detailed explanation of this synchronization method, see Detailed Explanation of
Synchronization through a Shared File (Phase 2)
128
UniInt Failover Configuration
130
UniInt Failover Configuration
PI Tags
The following tables list the required UniInt Failover Control PI tags, the values they will
receive, and descriptions.
Active_ID Tag Configuration
Attributes ActiveID
Tag <Intf>_ActiveID
ExDesc [UFO2_ActiveID]
Location1 Match # in /id=#
Location5 Optional, Time in min to wait for backup
to collect data before failing over.
Point Source Match x in /ps=x
Point Type Int32
132
UniInt Failover Configuration
Shutdown 0
Step 1
The following table describes the extended descriptor for the above PI tags in more detail.
PI Tag ExDesc Require Description Value
d/
Optional
[UFO2_ACTIVEID] Required Active ID tag 0 – highest
The ExDesc must start with the Interface
case sensitive string: Failover ID
[UFO2_ACTIVEID]. Updated by the
The pointsource must match the redundant
interfaces’ point source. Interfaces
Location1 must match the ID for
the interfaces.
Location5 is the COLD failover
retry interval in minutes. This
can be used to specify how long
before an interface retries to
connect to the device in a
COLD failover configuration.
(See the description of COLD
failover retry interval for a
detailed explanation.)
[UFO2_HEARTBEAT:#] Required Heartbeat 1 Tag 0 – 31 / None
(IF-Node1) The ExDesc must start with the Updated by the
case sensitive string: Interface on
[UFO2_HEARTBEAT:#] IF-Node1
The number following the colon
( must be the Failover ID for
the interface running on
IF-Node1.
The pointsource must match the
interfaces’ point source.
Location1 must match the ID for
the interfaces.
[UFO2_HEARTBEAT:#] Required Heartbeat 2 Tag 0 – 31 / None
(IF-Node2) The ExDesc must start with the Updated by the
case sensitive string: Interface on
[UFO2_HEARTBEAT:#] IF-Node2
The number following the colon
( must be the Failover ID for
the interface running on
IF-Node2.
The pointsource must match the
interfaces’ point source.
Location1 must match the id for
the interfaces.
134
UniInt Failover Configuration
136
UniInt Failover Configuration
Data register 0
. DataSource
. DCS/PLC/Data Server
.
Data register n
Process Network
FileSvr
IF-Node1 IF-Node2
.\UFO\Intf_PS_1.dat PI-Interface.exe
PI-Interface.exe
/host=PrimaryPI /host=SecondaryPI
/UFO_ID=1 /UFO_ID=2
/UFO_OTHERID=2 /UFO_OTHERID=1
/UFO_TYPE=HOT /UFO_TYPE=HOT
/UFO_SYNC=\\FileSvr\UFO\Intf_PS_1.dat /UFO_SYNC=\\FileSvr\UFO\Intf_PS_1.dat
Business Network
The figure above shows a typical network setup in the normal or steady state. The solid
magenta lines show the data path from the interface nodes to the shared file used for failover
synchronization. The shared file can be located anywhere in the network as long as both
interface nodes can read, write, and create the necessary file on the shared file machine.
OSIsoft strongly recommends that you put the file on a dedicated file server that has no other
role in the collection of data.
The major difference between synchronizing the interfaces through the data source (Phase 1)
and synchronizing the interfaces through the shared file (Phase 2) is where the control data is
located. When synchronizing through the data source, the control data is acquired directly
from the data source. We assume that if the primary interface cannot read the failover control
points, then it cannot read any other data. There is no need for a backup communications path
between the control data and the interface.
When synchronizing through a shared file, however, we cannot assume that loss of control
information from the shared file implies that the primary interface is down. We must account
for the possible loss of the path to the shared file itself and provide an alternate control path
to determine the status of the primary interface. For this reason, if the shared file is
unreachable for any reason, the interfaces use the PI Server as an alternate path to pass
control data.
When the backup interface does not receive updates from the shared file, it cannot tell
definitively why the primary is not updating the file, whether the path to the shared file is
down, whether the path to the data source is down, or whether the interface itself is having
problems. To resolve this uncertainty, the backup interface uses the path to the PI Server to
determine the status of the primary interface. If the primary interface is still communicating
with the PI Server, than failover to the backup is not required. However, if the primary
interface is not posting data to the PI Server, then the backup must initiate failover operations.
The primary interface also monitors the connection with the shared file to maintain the
integrity of the failover configuration. If the primary interface can read and write to the
shared file with no errors but the backup control information is not changing, then the backup
is experiencing some error condition. To determine exactly where the problem exists, the
primary interface uses the path to PI to establish the status of the backup interface. For
example, if the backup interface controls indicate that it has been shutdown, it may have been
restarted and is now experiencing errors reading and writing to the shared file. Both primary
and backup interfaces must always check their status through PI to determine if one or the
other is not updating the shared file and why.
Steady State Operation
Steady state operation is considered the normal operating condition. In this state, the primary
interface is actively collecting data and sending its data to PI. The primary interface is also
updating its heartbeat value; monitoring the heartbeat value for the backup interface,
checking the active ID value, and checking the device status for the backup interface every
failover update interval on the shared file. Likewise, the backup interface is updating its
heartbeat value; monitoring the heartbeat value for the primary interface, checking the active
ID value, and checking the device status for the primary interface every failover update
interval on the shared file. As long as the heartbeat value for the primary interface indicates
that it is operating properly, the ActiveID has not changed, and the device status on the
primary interface is good, the backup interface will continue in this mode of operation.
An interface configured for hot failover will have the backup interface actively collecting and
queuing data but not sending that data to PI. An interface for warm failover in the backup role
is not actively collecting data from the data source even though it may be configured with PI
tags and may even have a good connection to the data source. An interface configured for
cold failover in the backup role is not connected to the data source and upon initial startup
will not have configured PI tags.
The interaction between the interface and the shared file is fundamental to failover. The
discussion that follows only refers to the data written to the shared file. However, every value
written to the shared file is echoed to the tags on the PI Server. Updating of the tags on the
PI Server is assumed to take place unless communication with the PI Server is interrupted.
The updates to the PI Server will be buffered by bufserv or BufSS in this case.
138
UniInt Failover Configuration
In a hot failover configuration, each interface participating in the failover solution will queue
three failover intervals worth of data to prevent any data loss. When a failover occurs, there
may be a period of overlapping data for up to 3 intervals. The exact amount of overlap is
determined by the timing and the cause of the failover and may be different every time. Using
the default update interval of 5 seconds will result in overlapping data between 0 and 15
seconds. The no data loss claim for hot failover is based on a single point of failure. If both
interfaces have trouble collecting data for the same period of time, data will be lost during
that time.
As mentioned above, each interface has its own heartbeat value. In normal operation, the
Heartbeat value on the shared file is incremented by UniInt from 1 – 15 and then wraps
around to a value of 1 again. UniInt increments the heartbeat value on the shared file every
failover update interval. The default failover update interval is 5 seconds. UniInt also reads
the heartbeat value for the other interface copy participating in failover every failover update
interval. If the connection to the PI Server is lost, the value of the heartbeat will be
incremented from 17 – 31 and then wrap around to a value of 17 again. Once the connection
to the PI Server is restored, the heartbeat values will revert back to the 1 – 15 range. During a
normal shutdown process, the heartbeat value will be set to zero.
During steady state, the ActiveID will equal the value of the failover ID of the primary
interface. This value is set by UniInt when the interface enters the primary state and is not
updated again by the primary interface until it shuts down gracefully. During shutdown, the
primary interface will set the ActiveID to zero before shutting down. The backup interface
has the ability to assume control as primary even if the current primary is not experiencing
problems. This can be accomplished by setting the ActiveID tag on the PI Server to the
ActiveID of the desired interface copy.
As previously mentioned, in a hot failover configuration the backup interface actively collects
data but does not send its data to PI. To eliminate any data loss during a failover, the backup
interface queues data in memory for three failover update intervals. The data in the queue is
continuously updated to contain the most recent data. Data older than three update intervals is
discarded if the primary interface is in a good status as determined by the backup. If the
backup interface transitions to the primary, it will have data in its queue to send to PI. This
queued data is sent to PI using the same function calls that would have been used had the
interface been in a primary state when the function call was received from UniInt. If UniInt
receives data without a timestamp, the primary copy uses the current PI time to timestamp
data sent to PI. Likewise, the backup copy timestamps data it receives without a timestamp
with the current PI time before queuing its data. This preserves the accuracy of the
timestamps.
140
UniInt Failover Configuration
Figure 4: The figure above illustrates the PI ICU failover configuration screen showing the
UniInt failover startup parameters (Phase 1). This copy of the interface defines its
Failover ID as 3 (/UFO_ID=3) and the other interfaces Failover ID as 4
(/UFO_OtherID=4). The other failover interface copy must define its Failover ID as 4
(/UFO_ID=4) and the other interface Failover ID as 3 (/UFO_OtherID=3) in its ICU
failover configuration screen.
Figure 5: The figure above illustrates the PI ICU failover configuration screen showing
the UniInt failover startup parameters (Phase 2). This copy of the interface defines its
Failover ID as 1 (/UFO_ID=1) and the other interfaces Failover ID as 2
(/UFO_OtherID=2). The other failover interface copy must define its Failover ID as 2
(/UFO_ID=2) and the other interface Failover ID as 1 (/UFO_OtherID=1) in its ICU
failover configuration screen. It also defines the location and name of the
synchronization file as well as the type of failover as HOT.
142
UniInt Failover Configuration
This choice will be grayed out if the UFO_State digital state set is already created on the
XXXXXX PI Server.
Using the PI SMT 3 Utility to create Digital State Set
Optionally the ―Export UFO_State Digital Set (.csv) can be selected to create a comma
separated file to be imported via the System Management Tools (SMT3) (version 3.0.0.7
or higher) or use the UniInt_Failover_DigitalSet_UFO_State.csv file included
in the installation kit.
The procedure below outlines the steps necessary to create a digital set on a PI Sever
using the ―Import from File‖ function found in the SMT3 application. The procedure
assumes the user has a basic understanding of the SMT3 application.
1. Open the SMT3 application.
2. Select the appropriate PI Server from the PI Servers window. If the desired server is
not listed, add it using the PI Connection Manager. A view of the SMT application is
shown in Figure 6 below.
3. From the System Management Plug-Ins window, select Points then Digital States. A
list of available digital state sets will be displayed in the main window for the
selected PI Server. Refer to Figure 6 below.
4. In the main window, right click on the desired server and select the ―Import from
File‖ option. Refer to Figure 6 below.
Figure 6: PI SMT application configured to import a digital state set file. The PI Servers
window shows the ―localhost‖ PI Server selected along with the System Management
Plug-Ins window showing the Digital States Plug-In as being selected. The digital state
set file can now be imported by selecting the Import from File option for the localhost.
144
UniInt Failover Configuration
Figure 8: The PI SMT application showing the UFO_State digital set created on the
―localhost‖ PI Server.
146
UniInt Failover Configuration
Once the failover control and failover state tags have been created the Failover page of
the ICU should look similar to the illustration below.
148
UniInt Failover Configuration
Procedure
Step Description
1. Add /ufo_sync parameter to the startup file to define the path and, optionally, the
file name of the shared synchronization file.
2. Change the Active ID, Heartbeat 1, and Heartbeat 2 tags to remove input/output
designations
OR
Create new Phase 2 tags that do not have input/output qualifiers.
3. Create DeviceStatus 1 and DeviceStatus 2 tags.
4. Create new tags for Phase 2 or change the ExDesc attribute keywords for the
tags from [UFO_tagname] to [UFO2_tagname].
5. Remove InstrumentTag attributes.
Hot Failover
Hot failover, whether Phase 1 or Phase 2, is the most resource intensive and the most
comprehensive. There is no data loss at failover. But the OPC server or servers carry the
full load of data collection, whether connected to the primary interface or the backup
interface. If there is only one OPC server, it may become overloaded. Even with more
than one OPC server, the backend system where the OPC server gets its data may itself
become overloaded, having to send the same data to more than one OPC server.
Warm Failover
Warm failover comes in three modes, from the fastest to the lightest.
Warm_3, the default if no mode is specified, will connect to the OPC server, create
groups, add Items, and activate the groups, but will not advise the groups. This means
that the OPC server is obligated to keep its cache of current values for all the items
updated, but it need not send the values to the interface. If both interfaces are connected
to the same server, and the server maintains one central cache for data, this may be
almost no additional load on the server, since the cache must be kept updated for the
primary interface anyway. But for a server that does not use a centralized cache, or where
the interfaces connect to different OPC servers, this can be a considerable load on an
OPC server or on the backend system. When the interface becomes primary, it merely
advises the groups, and data collection has begun. The command line equivalent is
(/UFO_TYPE=HOT /FM=3)
Warm_2 will connect to the OPC server, create groups inactive, and add Items to the
groups. It will not activate the groups. For most OPC servers, this will mean that there is
very little load on the OPC server or backend system, as the server does not need to
maintain the current values for inactive groups. When the interface becomes primary, it
activates the groups and then advises them. This is normally very fast. The command
line equivalent is (/UFO_TYPE=HOT /FM=2)
Warm_1 is the lightest mode. It is used when dealing with servers that cannot support
groups when they are not the active OPC server. With this mode, the backup interface
will connect to the OPC server, and will check its status every 30 seconds, but will not
create groups or add Items. Since the interface does have its tag configuration from PI,
failover is faster than Cold failover, but when it becomes primary the interface must
create groups, add Items to them, activate them, and then advise them. There may be
some data loss at failover. The command line equivalent is (/UFO_TYPE=HOT /FM=1)
150
UniInt Failover Configuration
NOTE: It should also be noted that in order to avoid a potential confusion in configuring
UniInt Failover Phase 2 for OPC DA Interface, OSIsoft strongly recommends that you use
PI ICU (version 1.4.6.0 or later) and that you should not be editing the interface .bat file
manually. A confusion may arise when one looks at the argument for the /UFO_Type
command line parameter in the interface .bat file if WARM failover is selected in PI ICU.
For the OPC DA Interface WARM Failover is designated by a combination of two
command line parameters /UFOType=HOT (not /UFOType=WARM) and /FM=#. This is
the expected behavior and a characteristic specific to OPC DA Interface for PI ICU
version 1.4.6.0 or later.
Cold Failover
Cold failover is desirable when an OPC server can only support one client, or when using
redundant OPC servers where the backup OPC server cannot accept connections. In Cold
failover, the backup interface does not make contact with the OPC server until it becomes
primary. This means that when the interface becomes primary, it must connect, create
groups, add items to groups, and advise the groups. This will almost always result in
some data loss, but there is no load at all on the OPC server or backend system.
Note: that the OPC DA Interface also supports using Watchdog Tags to control failover.
This allows the configuration of tags that will indicate to the interface when its OPC server
is unable to adequately serve data, thus triggering failover to the other interface if the
other interface is better able to collect data. This is specifically designed to deal with
OPC servers that are data aggregators, such as an OPC server collecting data from
multiple PLCs. If one tag on each PLC is designated as a watchdog tag, then the
interface can be instructed to failover is less than a specified number of those tags are
readable. This allows the benefits of redundancy to be pushed down all the way to the
data collection stage. For more on how to configure this option, see the UniInt Interface
Level Failover section under Configuring the Interface with PI ICU.
3. /DF=tagname – Debug flag tag. Debugging options can be changed while the
interface is running for only the primary interface. The backup interface can take
advantage of this option only when it becomes primary.
4. /DLL=filespec – Using post-processing DLLs. Currently, post-processing
DLLs do not support UniInt failover. If the interface is configured to use one of
those DLLs, it should not be set up for UniInt based failover.
5. /DT=tagname – Debug tag. The primary and backup interfaces can use the
same or different debug tags.
6. /NT=N – Writing I/O Timeout. I/O Timeout will NOT be written if the interface-
level failover based on UniInt is used. UniInt will suppress all I/O Timeout
messages.
7. /OPCSTOPSTAT – Stop status of the OPC Interface. This option does not work if
the interface is configured for UniInt based failover.
8. /ST=tagname – Status tag. This allows assigning a PI tag that will get the status
of the OPC Server whenever it changes. For each copy of the interface there
should be a separate tag assigned.
9. /RP=# - Required Percent. This is the percentage of OPC Items which must be
accepted by the OPC server in order for the interface to have GOOD Device
Status. If the accepted percent is less than this parameter, the interface will have
Connected/No Data status, and UniInt will attempt to fail over to the other
interface. Note that if both interfaces are connected to the same OPC server, this
will cause thrashing.
Note: SCAN OFF point attribute does not work as normal if the interface is configured for
interface-level failover based on UniInt. Having a backup interface will prevent it from
writing SCAN OFF message to appropriate tags.
152
Interface Node Clock
Windows
Make sure that the time and time zone settings on the computer are correct. To confirm,
run the Date/Time applet located in the Windows Control Panel. If the locale where the
interface node resides observes Daylight Saving Time, check the box marked
―Automatically adjust clock for daylight saving changes‖. For example,
In addition, make sure that the TZ environment variable is not defined. All of the
currently defined environment variables can be viewed by opening a Command Prompt
window and typing set. That is,
C:> set
Make sure that the TZ environment variable is not defined. All of the currently defined
environment variables can be viewed by opening a Command Prompt window and typing
set. Confirm that TZ is not in the resulting list. If it is, run the System applet of the
Control Panel, click the Environment tab, and remove TZ from the list of environment
variables.
@istr host,proxyaccount
piapimachine,piadmin
@quit
In place of piapimachine, put the name of the PI Interface node as it is seen by
PI Server.
156
Starting / Stopping the Interface on Windows
This section describes starting and stopping the interface once it has been installed as a
service. See the UniInt Interface Users Manual to run the interface interactively.
To start the interface service with PI ICU, use the button on the PI ICU toolbar.
A message will inform the user of the status of the interface service. Even if the message
indicates that the service has started successfully, double check through the Services
control panel applet. Services may terminate immediately after startup for a variety of
reasons, and one typical reason is that the service is not able to find the command-line
parameters in the associated .bat file. Verify that the root name of the .bat file and the
.exe file are the same, and that the .bat file and the .exe file are in the same
directory. Further troubleshooting of services might require consulting the pipc.log
file, Windows Event Viewer, or other sources of log messages. See the section Appendix
A: Error and Informational Messages for additional information.
To stop the interface service with PI ICU, use the button on the PI ICU toolbar.
When an interface program makes a PI API function call that writes data to the PI Server
(for example, pisn_sendexceptionqx()), the PI API checks whether buffering is
enabled. If it is, these data writing functions do not send the interface data to the PI
Server. Instead, they write the data to the shared memory storage that the buffering
application created.
The buffering application (either Bufserv or PIBufss) in turn
reads the data in shared memory, and
if a connection to the PI Server exists, sends the data to the PI Server; or
if there is no connection to the PI Server, continues to store the data in shared
memory (if shared memory storage is available) or writes the data to disk (if
shared memory storage is full).
When the buffering application re-establishes connection to the PI Server, it writes to the
PI Server the interface data contained in both shared memory storage and disk.
(Before sending data to the PI Server, PIBufss performs further tasks such data validation
and data compression, but the description of these tasks is beyond the scope of this
document.)
When PIBufss writes interface data to disk, it writes to multiple files. The names of these
buffering files are PIBUFQ_*.DAT.
When Bufserv writes interface data to disk, it writes to a single file. The name of its
buffering file is APIBUF.DAT.
As a previous paragraph indicates, PIBufss and Bufserv create shared memory storage at
startup. These memory buffers must be large enough to accommodate the data that an
interface collects during a single scan. Otherwise, the interface may fail to write all its
collected data to the memory buffers, resulting in data loss. The buffering configuration
section of this chapter provides guidelines for sizing these memory buffers.
When buffering is enabled, it affects the entire Interface Node. That is, you do not have a
scenario whereby the buffering application buffers data for one interface running on an
Interface Node but not for another interface running on the same Interface Node.
160
Buffering
To use a process name greater than 4 characters in length for a trust application name, use
the LONGAPPNAME=1 in the PIClient.ini file.
To select PIBufss as the buffering application, choose Enable buffering with PI Buffer
Subsystem.
To select Bufserv as the buffering application, choose Enable buffering with API
Buffer Server.
If a warning message such as the following appears, click Yes.
Buffering Settings
There are a number of settings that affect the operation of PIBuffss and Bufserv. The
Buffering Settings section allows you to set these parameters. If you do not enter values
for these parameters, PIBuffss and Bufserv use default values.
PIBufss
For PIBuffss, the paragraphs below describe the settings that may require user
intervention. Please contact OSIsoft Technical Support for assistance in further
optimizing these and all remaining settings.
162
Buffering
For optimal performance and reliability, OSIsoft recommends that you place the PIBufss
event queue files on a different drive/controller from the system drive and the drive with
the Windows paging file. (By default, these two drives are the same.)
Bufserv
For Bufserv, the paragraphs below describe the settings that may require user
intervention. Please contact OSIsoft Technical Support for assistance in further
optimizing these and all remaining settings.
The following screen shows that PIBufss is configured to write data to a PI Collective
named admiral. By default, PIBufss replicates data to all collective members. That is, it
provides n-way buffering.
You can override this option by not checking the Replicate data to all collective member
nodes check box. Then, uncheck (or check) the PI Server collective members as desired.
164
Buffering
Bufserv
Bufserv buffers data to a standalone PI Server, or to multiple standalone PI Servers. (If
you want to buffer to multiple PI Servers that are part of a PI Collective, you should use
PIBufss.)
If the PI Server to which you want Bufserv to buffer data is not in the Server list, enter its
name in the Add a server box and click the Add Server button. This PI Server name must
be identical to the API Hostname entry:
The following screen shows that Bufserv is configured to write to a standalone PI Server
named etamp390. You use this configuration when all the interfaces on the Interface
Node write data to etamp390.
The following screen shows that Bufserv is configured to write to two standalone PI
Servers, one named etamp390 and the other one named starlight. You use this
configuration when some of the interfaces on the Interface Node write data to etamp390
and some write to starlight.
166
Buffering
168
Interface Diagnostics Configuration
The Interface Point Configuration chapter provides information on building PI points for
collecting data from the device. This chapter describes the configuration of points related
to interface diagnostics.
The procedure for configuring interface diagnostics is not specific to this Interface. Thus,
for simplicity, the instructions and screenshots that follow refer to an interface named
Generic. In actuality, OSIsoft does not offer an interface called Generic.
Some of the points that follow refer to a ―performance summary interval‖. This interval is
8 hours by default. You can change this parameter via the Scan performance summary
box in the UniInt – Debug parameter category pane:
the number of points the Interface has added to its point list; and
the rate at which the Interface is collecting data.
OSIsoft‘s PI Performance Monitor Interface is capable of reading these performance
values and writing them to PI points. Please see the Performance Monitor Interface to the
PI System for more information.
If there is no PI Performance Monitor Interface is installed as a Service on the same
computer running this Interface, you cannot use the ICU to create this Interface‘s
Performance Counters Points:
After installing the PI Performance Monitor Interface as a service, select this Interface
from the Interface drop-down list, click Performance Counters in the parameter
categories pane, and right click on a row containing a Performance Counters Point to
bring up the context menu:
170
Interface Diagnostics Configuration
Click Create to create the Performance Counters Point for that particular row. Click
Create All to create all the Performance Counters Points.
To see the current values (snapshots) of the Performance Counters Points, right click and
select Refresh Snapshots.
The PI Performance Monitor Interface – and not this Interface – is responsible for
updating the values for the Performance Counters Points. So, make sure that the PI
Performance Monitor Interface is running correctly.
Up_time
The up_time Performance Counters Point indicates the amount of time (in seconds) that
this Interface has been running.
Io_rates
The io_rates Performance Counters Point indicates the rate (in event per second) at
which this Interface writes data to its input tags.
Log_file_msg_count
The log_file_msg_count Performance Counters Point indicates the number of messages
that the Interface has written to pipc.log.
pts_edited_in_interface
The pts_edited_in_interface Performance Counters Point indicates the number of point
edits the Interface has detected. The Interface detects edits only for those points whose
PointSource attribute matches its Point Source parameter and whose Location1
attribute matches its Interface ID parameter.
Pts_added_to_interface
The pts_added_to_interface Performance Counters Point indicates the number of point
added the Interface has added to its point list.
Pts_removed_from_interface
The pts_removed_from_interface Performance Counters Point indicates the number of
point added the Interface has removed from its point list.
Point_count
A point_count Performance Counters Point is available for each Scan Class of this
Interface. The ICU uses a naming convention such that the tag containing ―(Scan Class
1)‖ (for example, sy.perf.etamp390.E1(Scan Class 1).point_count refers to
Scan Class 1, ―(Scan Class 2)‖ refers to Scan Class 2, and so on. The tag containing
―_Total‖ refers to the sum of all Scan Classes.
This point indicates the number of tags per Scan Classes.
Scan_time
A scan_time Performance Counters Point is available for each Scan Class of this
Interface. The ICU uses a naming convention such that the tag containing ―(Scan Class
1)‖ (for example, sy.perf.etamp390.E1(Scan Class 1).scan_time refers to
Scan Class 1, ―(Scan Class 2)‖ refers to Scan Class 2, and so on.
The scan_time Performance Counters Point indicates the number of milliseconds the
Interface takes to read data from the device and fill in the values for the tags. This
point is similar to the [UI_SCINCANTIME] Health Point.
Sched_scans_%missed
A sched_scans_%missed Performance Counters Point is available for each Scan Class of
this Interface. The ICU uses a naming convention such that the tag containing ―(Scan
Class 1)‖ (for example, sy.perf.etamp390.E1(Scan Class
1).sched_scans_%missed refers to Scan Class 1, ―(Scan Class 2)‖ refers to Scan
Class 2, and so on. The tag containing ―_Total‖ refers to the sum of all Scan Classes.
The sched_scans_%missed Performance Counters Point indicates the percentage of scans
the Interface missed since startup. A missed scan occurs if the Interface performs the scan
one second later than scheduled.
Sched_scans_%skipped
A sched_scans_%skipped Performance Counters Point is available for each Scan Class of
this Interface. The ICU uses a naming convention such that the tag containing ―(Scan
Class 1)‖ (for example, sy.perf.etamp390.E1(Scan Class
1).sched_scans_%skipped refers to Scan Class 1, ―(Scan Class 2)‖ refers to Scan
Class 2, and so on. The tag containing ―_Total‖ refers to the sum of all Scan Classes.
The sched_scans_%skipped Performance Counters Point indicates the percentage of
scans the Interface skipped since startup. A skipped scan is a scan that occurs at least one
scan period after its scheduled time.
Sched_scans_this_interval
A sched_scans_this_interval Performance Counters Point is available for each Scan Class
of this Interface. The ICU uses a naming convention such that the tag containing ―(Scan
Class 1)‖ (for example, sy.perf.etamp390.E1(Scan Class
172
Interface Diagnostics Configuration
Right click the row for a particular Health Point to bring up the context menu:
Click Create to create the Health Point for that particular row. Click Create All to create
all the Health Points.
You need to restart the Interface for it to write values to the [UI_IF_INFO] Health Point
only. Other Health Points do not require an interface restart.
To see the current values (snapshots) of the Health Points, right click and select Refresh
Snapshots.
For some of the Health Points described subsequently, the Interface updates their values
at each performance summary interval (typically, 8 hours).
[UI_IF_INFO]
The [UI_IF_INFO] Health Point is the Interface Information Point. This point provides
information for all interfaces that connect to a PI Server. The value of this point is a
string that indicates:
the node name on which an interface is running;
the IP address on which an interface is running;
an interface‘s executable name;
an interface‘s Point Source parameter;
an interface‘s Interface ID parameter;
an interface‘s Scan Classes;
the number of points in an interface‘s point list;
the number of messages to pipc.log that an interface has written; and
the number of seconds that an interface has been running.
An example value for the Interface Information Point is:
etamp390 | 192.168.8.72 | ModbusE.exe | MODBUSE | ID 1 | 3 Scan
Classes: 5; 60; 120 | Points 0 | Message Count 31 | Up Time 0
This Interface updates the value of the Interface Information Point every 30 minutes.
Please consult the ―Interface Health Points‖ section of the UniInt Interface User Manual
for details on changing this update frequency.
[UI_HEARTBEAT]
The [UI_HEARTBEAT] Health Point indicates whether the Interface is currently
running. The value of this point is an integer that increments continuously from 1 to 15.
After reaching 15, the value resets to 1.
The fastest scan class frequency determines the frequency at which the Interface updates
this point:
Fastest Scan Frequency Update frequency
Less than 1 second 1 second
Between 1 and 60 Scan frequency
seconds, inclusive
More than 60 seconds 60 seconds
If the value of the [UI_HEARTBEAT] Health Point is not changing, then this Interface is
in an unresponsive state.
[UI_DEVSTAT]
[[The following is interface specific]]
174
Interface Diagnostics Configuration
indicates that the Interface is encountering problems. You should investigate the cause of
these problems by looking in pipc.log.
The Interface updates the value of this point every 60 seconds. While the Interface is
running, the value of this point never decreases.
[UI_OUTPUTRATE]
After performing an output to the device, this Interface writes the output value to the
output tag if the tag has a SourceTag. The [UI_OUTPUTRATE] Health Point tracks the
number of these values. If there are no output tags for this Interface, it writes the System
Digital State No Result to this Health Point.
The Interface updates this point at the same frequency as the [UI_HEARTBEAT] point‘s.
The Interface resets the value of this point to zero at each performance summary interval.
[UI_OUTPUTBVRATE]
The [UI_OUTPUTBVRATE] Health Point tracks the number of System Digital State
values that the Interface writes to output tags that have a SourceTag. If there are no
output tags for this Interface, it writes the System Digital State No Result to this Health
Point.
The Interface updates this point at the same frequency as the [UI_HEARTBEAT] point‘s.
The Interface resets the value of this point to zero at each performance summary interval.
[UI_TRIGGERRATE]
The [UI_TRIGGERRATE] Health Point tracks the number of values that the Interface
writes to event-based input tags. If there are no event-based input tags for this Interface, it
writes the System Digital State No Result to this Health Point.
The Interface updates this point at the same frequency as the [UI_HEARTBEAT] point‘s.
The Interface resets the value of this point to zero at each performance summary interval.
[UI_TRIGGERBVRATE]
The [UI_TRIGGERRATE] Health Point tracks the number of System Digital State
values that the Interface writes to event-based input tags. If there are no event-based input
tags for this Interface, it writes the System Digital State No Result to this Health Point.
The Interface updates this point at the same frequency as the [UI_HEARTBEAT] point‘s.
The Interface resets the value of this point to zero at each performance summary interval.
[UI_SCPOINTCOUNT]
You can create a [UI_SCPOINTCOUNT] Health Point for each Scan Class in this
Interface. The ICU uses a tag naming convention such that the suffix ―.sc1‖ (for example,
sy.st.etamp390.E1.Scan Class Point Count.sc1) refers to Scan Class 1,
―.sc2‖ refers to Scan Class 2, and so on.
This Health Point monitors the number of tags in a Scan Class.
The Interface updates a [UI_SCPOINTCOUNT] Health Point when it performs the
associated scan.
Although the ICU allows you to create the point with the suffix ―.sc0‖, this point is not
applicable to this Interface.
176
Interface Diagnostics Configuration
[UI_SCIORATE]
You can create a [UI_SCIORATE] Health Point for each Scan Class in this Interface.
The ICU uses a tag naming convention such that the suffix ―.sc1‖ (for example,
sy.st.etamp390.E1.Scan Class IO Rate.sc1) refers to Scan Class 1, ―.sc2‖
refers to Scan Class 2, and so on.
A particular Scan Class‘s [UI_SCIORATE] point indicates the number of values that the
Interface has collected. If the current value of this point is between zero and the
corresponding [UI_SCPOINTCOUNT] point, inclusive, then the Interface executed the
scan successfully. If a [UI_SCIORATE] point stops updating, then this condition
indicates that an error has occurred and the tags for the scan class are no longer receiving
new data.
The Interface updates the value of a [UI_SCIORATE] point after the completion of the
associated scan.
Although the ICU allows you to create the point with the suffix ―.sc0‖, this point is not
applicable to this Interface.
[UI_SCBVRATE]
You can create a [UI_SCBVRATE] Health Point for each Scan Class in this Interface.
The ICU uses a tag naming convention such that the suffix ―.sc1‖ (for example,
sy.st.etamp390.E1.Scan Class Bad Value Rate.sc1) refers to Scan Class 1,
―.sc2‖ refers to Scan Class 2, and so on.
A particular Scan Class‘s [UI_SCBVRATE] point indicates the number System Digital
State values that the Interface has collected.
The Interface updates the value of a [UI_SCBVRATE] point after the completion of the
associated scan.
Although the ICU allows you to create the point with the suffix ―.sc0‖, this point is not
applicable to this Interface.
[UI_SCSKIPPED]
You can create a [UI_SCSKIPPED] Health Point for each Scan Class in this Interface.
The ICU uses a tag naming convention such that the suffix ―.sc1‖ (for example,
sy.st.etamp390.E1.Scan Class Scans Skipped.sc1) refers to Scan Class 1,
―.sc2‖ refers to Scan Class 2, and so on.
A particular Scan Class‘s [UI_SCSKIPPED] point tracks the number of scans that the
Interface was not able to perform before the scan time elapsed and before the
Interface performed the next scheduled scan.
The Interface updates the value of this point each time it skips a scan. The value
represents the total number of skipped scans since the previous performance summary
interval. The Interface resets the value of this point to zero at each performance summary
interval.
Although there is no ―Scan Class 0‖, the ICU allows you to create the point with the
suffix ―.sc0‖. This point monitors the total skipped scans for all of the Interface‘s Scan
Classes.
[UI_SCSCANCOUNT]
You can create a [UI_SCSCANCOUNT] Health Point for each Scan Class in this
Interface. The ICU uses a tag naming convention such that the suffix ―.sc1‖ (for example,
sy.st.etamp390.E1.Scan Class Scan Count.sc1) refers to Scan Class 1, ―.sc2‖
refers to Scan Class 2, and so on.
A particular Scan Class‘s [UI_ SCSCANCOUNT] point tracks the number of scans
that the Interface has performed.
The Interface updates the value of this point at the completion of the associated scan. The
Interface resets the value to zero at each performance summary interval.
Although there is no ―Scan Class 0‖, the ICU allows you to create the point with the
suffix ―.sc0‖. This point indicates the total number of scans the Interface has performed
for all of its Scan Classes.
[UI_SCINSCANTIME]
You can create a [UI_SCINSCANTIME] Health Point for each Scan Class in this
Interface. The ICU uses a tag naming convention such that the suffix ―.sc1‖ (for example,
sy.st.etamp390.E1.Scan Class Scan Time.sc1) refers to Scan Class 1, ―.sc2‖
refers to Scan Class 2, and so on.
A particular Scan Class‘s [UI_ SCINSCANTIME] point represents the amount of
time (in milliseconds) the Interface takes to read data from the device, fill in the
values for the tags, and send the values to the PI Server.
The Interface updates the value of this point at the completion of the associated scan.
[UI_SCINDEVSCANTIME]
You can create a [UI_SCINDEVSCANTIME] Health Point for each Scan Class in this
Interface. The ICU uses a tag naming convention such that the suffix ―.sc1‖ (for example,
sy.st.etamp390.E1.Scan Class Device Scan Time.sc1) refers to Scan Class
1, ―.sc2‖ refers to Scan Class 2, and so on.
A particular Scan Class‘s [UI_ SCINDEVSCANTIME] point represents the amount of
time (in milliseconds) the Interface takes to read data from the device and fill in
the values for the tags.
The value of a [UI_ SCINDEVSCANTIME] point is a fraction of the corresponding
[UI_SCINSCANTIME] point value. You can use these numbers to determine the
percentage of time the Interface spends communicating with the device compared with
the percentage of time communicating with the PI Server.
If the [UI_SCSKIPPED] value is increasing, the [UI_SCINSCANTIME] points along
with the [UI_SCINSCANTIME] points can help identify where the delay is occurring:
whether the reason is communication with the device, communication with the PI Server,
or elsewhere.
The Interface updates the value of this point at the completion of the associated scan.
178
Interface Diagnostics Configuration
As the preceding picture shows, the ICU suggests an Event Counter number and a
Tagname for the I/O Rate Point. Click the Save button to save the settings and create the
I/O Rate point. Click the Apply button to apply the changes to this copy of the Interface.
You need to restart the Interface in order for it to write a value to the newly created I/O
Rate point. Restart the Interface by clicking the Restart button:
(The reason you need to restart the Interface is that the PointSource attribute of an I/O
Rate point is Lab.)
To confirm that the Interface recognizes the I/O Rate Point, look in the pipc.log for a
message such as:
PI-ModBus 1> IORATE: tag sy.io.etamp390.ModbusE1 configured.
To see the I/O Rate point‘s current value (snapshot), click the Refresh snapshot button:
180
Interface Diagnostics Configuration
Message Logs
The location of the message log depends upon the platform on which the interface is
running. See the UniInt Interface Users Manual for more information.
Messages are written to PIHOME\dat\pipc.log at the following times.
When the interface starts many informational messages are written to the log. These
include the version of the interface, the version of UniInt, the command-line
parameters used, and the number of points.
As the interface retrieves points, messages are sent to the log if there are any
problems with the configuration of the points.
If the /db is used on the command line, then various informational messages are
written to the log file.
Messages
Here is a partial list of the error messages you may find in your pipc.log file and what
they mean. They will generally either have a hexadecimal number after these phrases
(like 0x80007005) or they‘ll have another message after the phrase, if the OPC Server
gives an explanation for the error. Other error messages are produced by the standard
OSIsoft interface routines or by the PI API and those error messages are not documented
here. If any error message has a point number as well as a tag name, always use the point
number to identify the problem tag, because often the tagname field that is used is one
that only has 12 characters, so the tagname printed in the log file will not be complete.
These error messages may not exactly match the error messages in the version you‘re
running. What‘s listed here is the general part of the message. It‘s a good idea to do a
Find in this document to look for words from the error message that you see.
Out of memory:
Can‘t even allocate a list, dying
Unable to add tag
There are several formats for messages that mean the system has run out of resources.
You can use the Task Manager to check the resources being used: press the Control,
Shift, and Escape keys all together to get to the Task Manager, then select the
Processes tab. From the menu, select View\Select Columns, than check the boxes for
Memory Usage and Virtual Memory Size to see who‘s eating up all the memory. If
it‘s opcint.exe, you may have a bottleneck between the interface and your PI system
– you should see other messages in the PIPC.LOG file (see below for ―Running low
on memory, dropping data‖).
184
Appendix A:
Error and Informational Messages
186
Appendix A:
Error and Informational Messages
configuration.
GetStatus
This means the OPC Server didn‘t respond to a status query. It may be down or
disconnected.
Can‘t get PI Server time
This is actually a major error, as we‘re actually asking the API for the timestamp. If
you see this, you probably need to call for help, unless you‘ve just installed your
system. If you‘ve just installed your system, try rebooting, then making sure you can
connect to PI. Try pinging the PI machine (>ping machinename); make sure PI is
running; try using APIsnap to connect to PI (look in the API directory for
apisnap.exe).
GetStatus: Server has no current time.
This is a non-OPC-standard server that does not send the time of day. The OPC
specifications state that the server is supposed to include current time when it sends
its status. This one sent trash. The interface tries to guess at what correct timestamps
would be, but do not assume that the timestamps are highly accurate.
Cleaning up connections
Cleaned up connections
The interface will print these messages when it‘s been told to exit. The first indicates
that the interface is beginning the process of disconnecting from the OPC Server. The
second indicates that we‘re disconnected and will be dying shortly.
Interface failed to write some %s states
When the OPC Server shuts down, the interface will send a shutdown status to each
tag, if you configured the interface to do that (using the /OPCSTOPSTAT parameter
on the command line). If the interface tried, but could not send some or all of them
(because it cannot talk to the PI Server, and you are not using bufserv), you will get
this message.
Server sent shutdown notice
This is printed when we receive a shutdown notification from the OPC Server. It
may be followed by a message from the server indicating why it was going down.
The interface will wait forever, trying to reconnect to the server periodically, until it
is told to shutdown or until it is able to reconnect.
OnDataChange:Invalid group ID < 0
OnDataChange:Invalid advise group ID:
OnDataChange:Invalid group ID > 999
OnDataChange: Header status:
OnDataChange has format not Hglobal
OnDataChange:Invalid group ID for write completion
Unknown access type for group %s
These are all messages that indicate that the server is sending us trash. The only one
we can work around is ―Header status‖ – you can set a command switch (/GS=N) to
188
Appendix A:
Error and Informational Messages
since if it‘s valid ASCII printable data, it should be translatable.
Unable to initialize server object
We can‘t run. I‘ll be surprised if anything is running on your machine. Or maybe
you‘re trying to run under an account with no privileges at all.
No OPC Server specified
You did not put \SERVER=servername into the opcint.bat file. Or you ran the
interface interactively rather than as a service, but you did not edit the opcint.bat
file to put everything on one line first.
Can‘t find status tag, ignoring
Can‘t find queue tag, ignoring
Status tag is not Digital tag, ignoring
Queue tag is not Integer tag, ignoring
You specified a status/queue tag, but either it doesn‘t exist or it‘s not the correct
datatype tag, so we‘re ignoring it and going on.
Can‘t connect to OPC Server, going into slow cycle wait
We tried to connect to the server, but couldn‘t. We‘ll keep trying. There should be
another message before this one that gives more information about exactly what call
failed. Look at that message, and fix whatever it says is wrong. Otherwise, the
interface will sit here forever.
Unable to create clock drift timer
We aren‘t going to be able to keep track of clock drift, because we can‘t create a
timer. You could be really out of resources, or your system could be completely
hosed. Either way, we‘re really unhappy.
Running low on memory, dropping data
Memory load within acceptable limits, resuming data collection
If the PI system won‘t take data as fast as we want to send it, we‘ll buffer it in
memory for a while. If the situation continues, we‘ll end up eating all the memory on
this machine and it will eventually crash, so at some point we‘ll decide to cut our
losses and start dropping new data coming in. When we‘ve sent enough of the
buffered data to PI that system memory isn‘t critical anymore, we‘ll start collecting
data again. The parameters for when we start dropping data and when we resume can
be tweaked with /HQ and /LQ, but you‘re trying to push too much data through too
small a pipe. Consider giving the PI system more resources, changing the exception
parameters of your tags, or changing the scan period of your tags.
Failed to open cluster: error ####. Intf-failover will not be supported.
Failed to open cluster resource: error ####. Intf-failover will not be supported.
The error #### is Win32 Error code. The attempt to open the Cluster service and/or
the Cluster resource failed. Since the interface did not get the handle to these objects
it cannot support the interface-failover facilitated by the cluster service. An example
of this error is
5007 The cluster resource could not be found.
190
Appendix B: PI SDK Options
To access the PI SDK settings for this Interface, select this Interface from the Interface
drop-down list and click UniInt – PI SDK in the parameter category pane.
Disable PI SDK
Select Disable PI SDK to tell the Interface not to use the PI SDK. If you want to run the
Interface in Disconnected Startup mode, you must choose this option.
The command line equivalent for this option is –pisdk=0.
Use the Interface’s default setting
This selection has no effect on whether the Interface uses the PI SDK. However, you
must not choose this option if you want to run the Interface in Disconnected Startup
mode.
Enable PI SDK
Select Enable PI SDK to tell the Interface to use the PI SDK. Choose this option if the
PI Server version is earlier than 3.4.370.x or the PI API is earlier than 1.6.0.2, and you
want to use extended lengths for the Tag, Descriptor, ExDesc, InstrumentTag, or
PointSource point attributes. The maximum lengths for these attributes are:
However, if you want to run the Interface in Disconnected Startup mode, you must not
choose this option.
The command line equivalent for this option is –pisdk=1.
The OPC specification allows a great deal of flexibility in how OPC Servers are designed
and in what features they will support. This is an outline of how that may affect users of
this interface.
Browsing
Point browsing is not a requirement of the OPC specification. If the OPC Server does not
support browsing, there must be access to a list of the points which it will accept or the
format of point names it will allow to be used. If browsing is allowed, the PI OPCClient
can be used to see the points which the OPC Server recognizes.
Timestamps
There has been much discussion of what the timestamp value should be when the OPC
Server sends a timestamp with the data. Some vendors send the timestamp for the last
time the data value and quality were read from the device so the timestamp will change
even if the value does not. Others send the timestamp of the last read where the value or
quality changed so if the data remains the same, the timestamp will not change no matter
how many times, or in what way, it is read. If the OPC Server sends timestamps for
when the data last changed, the /TS=N parameter should generally be used on the startup
command line.
Disconnecting
If the interface disconnects improperly from an OPC Server (for instance, the network
connection goes down or the windows system crashes), then the server may not clean up
the connection on its side. The symptoms for this will probably be that the interface
cannot reconnect with the server. Use the PI OPCClient to verify that this is occurring
and the solution will probably be to shut down the OPC Server. Refer to the
documentation which came with the OPC server to see whether they address this issue. If
not, try shutting down the server, or, if Windows is understood and the programs running
on that machine also are understood quite well, use Task Manager to kill the thread. If in
doubt, reboot the machine. This is not a problem which can be resolved by a change in
the interface: once the connection is broken, the interface has no way to tell the OPC
server that it needs to clean up its act.
False Values
Some OPC Servers will return a value when a client connects to a point, even if the
server does not have a valid value for the point yet. When the server also sends a proper
status, this is not a problem, but some servers will send a false value and a status of
GOOD, which results in the false value being sent to the PI archive. Values will be seen
in the archive at times that correspond with the interface starting, getting reconnected to
the OPC Server, or when a point was edited while the interface was running. To prevent
these values, use the /IF=Y parameter in the startup file. This will result in the interface
dropping the first value received from the OPC Server for each point, each time the
Access Path
The Access Path is a suggestion for how the server might want to get to the data. It is not
part of the ItemID and the server is not required to pay any attention to it. However, the
server is also not allowed to require it. If the server requires it, the server does not follow
the OPC specifications.
Some servers, such as RSLinx, require the information about how to access the data, and
look for this information either in the Access Path or as part of the ItemID. For instance,
RSLinx servers use the format
[accesspath]itemid
Other servers may use other formats. The OPC standard states that it is valid for servers
to require path information in order to access a value, but not for them to require that it be
sent in the Access Path field. If the OPC server requires path information and will only
accept it in the Access Path field, contact the server vendor.
Unpack2 messages
An Unpack2 message in PIHOME\dat\pipc.log is caused by a 3rd party OPC Server.
It is not a DCOM issue.
This error is generated by the OPC Server. The PI OPC Interface simply reports the error
code that the OPC Server sends. The core problem is that the OPC Server cannot give the
interface the data that was supposed to be in the packet; there is nothing wrong with the
PI OPC Interface.
The OPC Server sends the following in the data packet: timestamp, quality, value, error
code. The number given in the pipc.log message is the error code that the OPC Server
sends to the OPC Interface. The text that follows the colon (:) is the text explanation that
the OPC server gave to explain what that error code means.
If the OPC server cannot interpret the error, the OPC Interface reports it as an "unknown
error." Often the error code itself is a well known error— for example, 80004005, which
is a generic FAILURE error code, that gives no indication of why the operation failed.
In some cases, the interface may actually be sending data to PI, but still logging the
Unpack2 error for the tag. This is because the OPC server sends good values when it can,
error codes when it cannot, and intermittent failures between the OPC server and the data
source result in a combination of errors and values.
Error signatures generated:
"In UnPack2 Tag MyPV.pv returns error 80020005: 80020005(Type mismatch)"
"In UnPack2 Tag MyPV2.pv returns error : The operation failed (80004005)"
The following unknown errors indicate that the interface received data from the OPC
server, but that data contains errors and the OPC server did not give a text explanation of
what the error means:
"In UnPack2 Tag MyPV3.pv returns error : Unknown error(800482d2)"
"In UnPack2 Tag MyPV4.pv returns error E004823E: Unknown error (e004823e)".
"In UnPack2 Tag MyPV5.pv returns error E241205C: Unknown error (e241205c)"
194
"In UnPack2 Tag MyPV6.pv returns error E2412029: Unknown error (e2412029)"
To troubleshoot this issue you should consider the following causes and solutions:
If you see Unknown errors, check with the OPC Server vendor and have them look
up the error code displayed in the pipc.log. OPC servers can generate vendor-
specific error codes, and only the OPC server vendor can say what they mean.
Restarting the OPC Server may resolve the issue.
It may be a point type mismatch between the PI Server data type and the OPC Server
point type. If you get "80020005 (Type mismatch)," that is definitely the case.
However, a point type mismatch may also be indicated by other error signatures.
Check to ensure the data types are compatible. Always restart the interface if point
types are changed to avoid caching issues.
A value "mismatch" can occur when the PI Tag is set up as a 2-byte integer if the
values are too large; you will see negative values being sent. Change the PI tag type
to float32 or int32.
You can make the PI Tag a "string" data type to see what is sent by the OPC Server
to this tag.
Make sure the data is not being read as a digital if it is actually numeric data. Verify
that location2 is set to 0 (normal processing).
This may be a data quality issue. Use the OPC Client tool to look at the quality of the
values being sent. It could be a case where the quality is not good. The interface is
getting and sending data to PI, but it is reporting the Unpack2 error for the tag.
The data sent by OPC Server may be corrupt data that it received from the
instrument. Check for network issues that could corrupt the data packets.
It may be an issue with the Group size of the OPC Server. If the scan class is larger
than the number of tags allowed in the OPC Server group, an Unpack2 error can
occur. Check with the OPC Vendor and confirm the Group size limitations.
If the tag is digital and "string" type can read the data into a PI tag, and the
underlying control system is Honeywell, you may need for the digital state strings in
PI to EXACTLY match the string reported by the DCS. Learning and verifying the
string reported by the DCS may require that you go to Honeywell Universal Station
or GUS to look at each controller block which is the data source to learn what the
digital states are.
DeltaV System
When browsing DeltaV OPC Server with PI OPCClient, use the manual browsing option.
This is because the DeltaV OPC Server considers all data items to be ItemIDs, so there
may be over 100,000 items to be listed, and the PI OPCClient may hang waiting for
server to respond for a very long time.
To enable manual browsing, you should check the ‗Manual‘ checkbox on the Server
Browsing window.
198
Appendix E:
Debugging
Debugging Options
All debugging options for the PI OPC Interface can by set using the debug parameter
(/DB parameter). The debug parameter is used to assist in understanding problematic or
unexplained behavior, such as duplicate values or invalid timestamps. Use of the debug
parameter should be limited to short periods of time, as the parameter will generally
cause the creation of large files (files larger than 200 MB would not be unusual). The
parameter itself is actually a bit mask, which means you can set more than one option at
the same time. A value of /DB=5 is the same as /DB=1 and /DB=4. Here are a few of
the possible settings and what they do:
/DB=1
This is for internal testing only and is not useful to users.
/DB=2
Log startup information, including InstrumentTag and ExDesc for each tag. This
setting will also log the activation of groups.
/DB=4
This setting causes a number of messages to be written to the pipc.log file when write
operations are performed. Since we only send one value at a time to be written per group
and wait for that write to be acknowledged before sending another one, we throttle writes
using the TransID. If a server fails to acknowledge a TransID, the symptom is that after
that write, no more writes are performed to that group. This parameter will cause the
Interface to log every time it sends a write and every time it receives an ACK, as well as
any time it stores a write into its ―pending write‖ queue. The TransID, which is printed,
is not necessarily valid, as v1.0a servers return a TransID after the interface sends the
write. The OPC Servers that support OPC DA v2.0 allow the interface to specify the
TransID. Here is an example from the log file:
21-Jun-05 15:02:06
OPCpi> 1> There are 1 writes to process.
21-Jun-05 15:02:06
OPCpi> 1> Stashing 1 writes
21-Jun-05 15:05:48
OPCpi> 1> Fetched 1 writes from stash.
21-Jun-05 15:05:48
OPCpi> 1> Sending outputs to OPC server with transid 3
21-Jun-05 15:06:51
OPCpi> 1> Received and cleared callback for output transid 3
successfully.
In addition, this debugging level can be used in conjunction with the /DT command line
option to specify a tag to monitor. Then for every write operation for the tag in question,
the following will be printed in the log file:
21-Jun-05 15:06:51
OPCpi> 1> Output tag, Output_test3, with value=98.85994, sending
output with transid 3.
/DB=8
Log timestamps when Refresh is called.
This setting will cause the interface to create three files: opcscan.log,
opcrefresh.log, and opcresponse.log. If the interface is running as a service, the
files will be in your winnt/system32 directory; otherwise they will be in the directory
from which you ran the interface. Every time the interface routine polls a group by
calling Refresh on the OPC group, the interface will open the opcscan.log file, write
the current time, the number of the scan class, and the current value of the scan flag, and
close the file. The timestamp is in UTC (Greenwich time zone and no daylight savings
time is observed), and it is a FILETIME structure written as an I64X field. That means
that the lower and upper halves of the number are transposed and the actual number is a
count of the interval since January 1, 1601, measured in 10E-7 seconds.
After logging the data, the interface will set the scan flag for the group. Then the COM
thread will take its turn: when the interface cycles around to perform the poll, it will open
the opcrefresh.log file, log the time, the scan class, and the TransID used. (Note that
the TransID logged for v1.0a servers will be the TransID that was returned from the last
poll of the group, while for v2.0 servers it will be the actual TransID returned from the
server.)
When the interface receives data from the OPC Server, the interface will open the
opcresponse.log file, and log the time, the scan class, and the TransID received. This
is virtually the first thing done upon receiving data, if this flag is set.
Note that for advise tags, no entries will be generated in the opcrefresh.log and
opcscan.log files, and therefore if only advise points are configured for the interface
then only an opcresponse.log file will be generated.
/DB=16
Log information for ExcMax processing.
/DB=32
This setting will log the timestamp with the data, the adjusted timestamp, the PI time, the
scan class, and TransID for each data value that the interface receives directly in the
opcresponse.log file. This is a *lot* of data. Do not leave this setting on for more
than a few minutes. Also, note that if you want to generate opcscan.log and
opcrefresh.log files, it is necessary to use /DB=8 in addition to /DB=32 (i.e.
/DB=40).
/DB=64
This setting will log the same items as /DB=32, but it will log them for only the tag
specified as the debug tag (/DT=tagname). If there is no tag specified, the first tag for
which a value is received will be declared the debug tag.
/DB=128
Log information for interface-level failover using MS clustering.
200
Appendix E:
Debugging
/DB=256
Log information for event tags. This will also cause the interface to print the name of
each tag into the pipc.log file as it receives data for the tag. This can create very large
files very quickly, so use it sparingly, but it can also verify that the interface is or is not
receiving data for some tags. Please note that if the interface is running interactively,
these messages will not be in the command window for the interface; they only appear in
the log file.
/DB=512
Log information for array tags.
/DB=1024
Log information for opclist pointers. This is internal and is not useful for users.
/DB=2048
This setting will cause the interface to ignore point edits after startup. This is not
normally useful to users.
/DB=4096
This setting will write timestamps, values, and qualities received from OPC server
directly in the pipc.log for a tag that is specified as the debug tag (/DT=tagname). If
there is no tag specified, the first tag for which a value is received will be declared the
debug tag. An example of the messages appearing the pipc.log is shown below:
04-Nov-04 13:50:02
OPCpi> 4> Tag crashtest_1, received data = 246.063, at 04-Nov-04
13:50:02, with quality = Good (11000000)
Care should be taken when using this option as many messages may be written to the
pipc.log file.
/DB=8192
This setting provides debugging information for the /US command line option.
not zero, then the last call made to the server has not retuned by the time the interface
decided it was time for another poll.
The COM thread sees there‘s a flag set, so it logs the time in the opcrefresh.log, file
and then makes a Refresh call (when polling) to the OPC server, and finally clears the
flag once it receives the synchronous response from the OPC server. The group number
and transaction ID for the call are also logged.
Opcrefresh.log: time group TransID
1BFD631E8FE1350 2 1db8
It is important to note that the flag is not cleared until the call is completed (i.e. until the
OPC server responds to the Refresh call).
Once the Refresh call has been, the OPC server can send data anytime in an
asynchronous manner. When data is sent to the COM thread in the interface from the
OPC server, the time is logged in opcresponse.log along with the group number and
the transaction ID.
Opcresponse.log: time group TransID
1BFD63208D4DCE0 2 1db8
The above discussion is only valid for polled points. Advise tags operate in a different
manner, and the COM thread will only receive callbacks when the data from OPC server
changes value. Therefore, Advise tags will NOT generate any entries in the
opcscan.log or opcrefresh.log file and only the data callbacks will appear as
entries in the opcresponse.log file as just described. As discussed earlier in the
manual, Advise tags have group numbers ranging from 200 to 800 and therefore the
callbacks to the opcresponse.log file are easily identifiable by noting the group
number.
The timestamps in all of these files are logged just the way they are used in the program,
so there are three programs that will translate those files. The interface does not translate
the timestamps before it writes to the log files because that would take time and the
problem is to determine how long it takes to get data. The three programs are installed
into the Tools sub-directory below the interface directory:
opcscan.exe
opcrefresh.exe
opcresponse.exe
Run these by double-clicking on them. A pop-up window will request the names of the
input and output files.
The opcrefresh.log also has an option to squeeze out duplicates, but generally that is
not needed, so enter ―n.‖
Or you can run them from a command window:
> opcscan.exe opcscan.log scan.log
> opcrefresh c:\pipc\Interfaces\OPCInt\opcrefresh.log c:\temp\refresh.log
> tools\opcresponse opcresponse.log response.log
The translated files will look like:
scan.log:
0 126054824440170000 2000/06/14 18:54:04.017 2
refresh.log
202
Appendix E:
Debugging
126054824440370000 2000/06/14 18:54:04.037 2 1db8
response.log
126054824974540000 2000/06/14 18:54:57.454 2 1db8
If /DB=64 or /DB=32 was specified, additional lines will appear in the
opcresponse.log file for individual data items that were received by the COM thread
and will look like:
response.log
126054824424850000 2000/06/14 18:54:02.485 126054680424850000
2000/06/14 14:54:02.485 960994309.485001 2 1db8
This is all on one line, and shows the UTC timestamp that came with the data, both raw
and translated, the timestamp translated into local time, both raw and translated, the PI
Time sent to the PI Server, then the group number and the TransID.
For advise tags, the group number in the opcresponse.log file may not be correct for
entries generated by /DB=32 or /DB=64, although the shorter entries generated by /DB=8
do correspond to the correct group number.
By looking at the log files, you can see when the interface decided to poll, when it made
the call, and when the data came in. A major clue is that the flag in opcscan.log
should never be anything but zero – if it‘s not zero, then the last call made to the server
has not returned by the time the interface decided it was time for another poll. This
should never happen so if you see a 1 in that flag, you‘ll need to talk to your server
vendor and have them call OSIsoft.
An alternative method to determine whether the OPC server is not responding to the
Refresh calls made by the OPC Interface is to check the pipc.log file for the following
message:
The OPC server did not respond to the last Refresh call for scanclass 2, and
has not has not responded to the previous 100 Refresh call(s).
This message indicates that the OPC server failed to respond to a Refresh call, and
typically results when the OPC server cannot keep up with the update rates or has
suspended operation due to a bug. Additionally, the above message will be repeated for
each additional 100 Refresh calls that do receive responses from the OPC server for each
scan class. If these messages appear in your pipc.log, you should immediately contact
your OPC server vendor as data loss may be occurring.
Another common use for these files is to show the timestamp returned from the OPC
Server. Remember, this is UTC time, which the interface translates into local clock time
and then adjusts for PI. UTC time is based in 1600, so if you see a date around 1600 you
can be sure the server is not sending valid timestamps and you may want to use /TS=N to
have the interface create timestamps when it gets the data.
DCOM Security
/DA Default Authentication level. This parameter is used to set the interface
specific authentication level that is necessary to verify the identity of the
OPC Server during calls. The following security levels can be used:
DEFAULT, NONE, CONNECT, CALL, PKT, PKT_INTEGRITY, or
PKT_PRIVACY.
/DI Default Impersonation level. This parameter is used to set the interface
specific impersonation level that can grant to an OPC Server to perform
processing tasks on its behalf. The following authority levels are
allowed: ANONYMOUS, IDENTIFY, IMPERSONATE, or
DELEGATE.
OPC Server
/SERVER The name or IP address and location of the OPC Server.
/TS Specifies the source of timestamps for PI tags.
/VN Version of the OPC protocol to expect.
Advanced Options
/AF Advise groups immediately. This helps when the OPC server does not
return initial data on advise. The symptom is that when creating an
advise tag for a value that doesn‘t change often, the interface does not
write a value to PI when it first starts up. This problem can be tested by
using PI OPCClient to create a group, add tags, and then Advise the
group. If an immediate value is not returned for the tags, but adding
another tag to the group gets a value for that tag, this parameter will need
to be used.
/AR Ignore the Access Rights property. If ―Invalid read/write mode
requested‖ if found in the pipc.log file, try this one.
/DC Disable Callbacks. This option is designed to reduce the load on the
OPC Server by disabling callbacks for groups that are being Polled.
Polled groups have callbacks enabled by default but are not used by the
interface. Explicitly disabling the call backs should reduce the load on
the OPC Server. For Advise groups this option has no effect.
/ES Event source determines whether event tags are read from the OPC
Server‘s CACHE or directly from the DEVICE, for v1.0a servers. For
v2.0 servers, it has no impact, because all event tag reads are from
DEVICE.
/GA For some servers, the load on the OPC server can be leveled somewhat
by having the groups activated one at a time, with a slight delay between
them. This can avoid the problem of having all scan classes with the
same scan period being read all at once, which can cause the OPC server
to be overloaded. For those servers, using the Group Activation
parameter along with specifying offsets for the scan periods will cause
the staggering of the activation of the groups. See the /f parameter for
more on offsets. Do NOT use this parameter if scan class 1 is being
used.
/GL If ―OnDataChange: Invalid group ID‖ is in the pipc.log file, this means
that the OPC server does not follow the OPC standard. Please, email
OSIsoft at [email protected] and tell us what server it is so we
can talk to the vendor.
/GS If ―OnDataChange: Header status:‖ is in the pipc.log file, the Group
status sent by the OPC server does not follow the OPC standard. Use
this switch to tell the interface to ignore it.
/HWPS Enable checking for error codes specific to the Honeywell Plantscape
system, for server-level failover. For newer Plantscape servers this is
obsolete.
/IS Ignore Status. The OPC Server should go to OPC_STATUS_RUNNING
state when it is ready to send data. If it doesn‘t, tell the interface to try to
talk to it anyway.
/MA Mass Adds. It is faster to add items to groups in a bunch, instead of one
by one. But some servers will reject the entire group if one tag is invalid,
and it can take a lot of work to figure out which tag was the problem. So
tell the interface to add tags one at a time.
206
Appendix F:
List of Startup Parameters Grouped by Usage
/RD Reconnect Delay. If the server goes away ungracefully, and the interface
can get an error code indicating the RPC server is unavailable or too
busy to answer, the interface will wait this many seconds before trying to
reconnect.
/SD Scan delay. This parameter specifies a delay before reading from or
writing to the OPC Server. If this parameter is specified, the interface
will connect to an OPC Server and wait till the delay time is expired.
/UR Update rate, if different from the scan frequency.
Data Handling
/AM Controls the number of tags for each advise group.
/AS Assigns alternate digital states for qualities
/CO Connection Output causes the interface to send all output values when
the PI Server comes back after having been unavailable. This is only
useful if when not using PI API buffering.
/CR Connection Refresh causes the interface to call Refresh on all Advise
tags when the PI Server comes back after having been unavailable. This
is only useful if when not using PI API buffering.
/ER Update rate for event classes.
/GI Makes groups inactive on startup. Once all groups are created then they
are activated.
/IF Ignore First value. If the server sends data before it actually reads data,
there may be zeros or erroneous values when the interface starts. This
parameter will tell the interface to ignore the first value it receives for
each tag.
/IT Integer Time. Use this parameter to ignore the millisecond portion of
timestamps. Storing integer seconds speeds up processing on the PI
Server.
/NT No Timeout. This parameter directs the interface to never write I/O
Timeout. This is rarely used and included for very special
circumstances.
/OPCSTOPSTAT Specifies the digital state to be written to all tags when the interface is
shut down.
/SG Send only GOOD quality data. If the /SG is set, only GOOD quality
data will be sent to PI. Questionable quality data and BAD quality data
will be ignored.
If the /SQ=I or /SQ=Y flag is also set, then Questionable Quality data
will be sent to PI as described by the /SQ flag. BAD quality data will
continue to be ignored.
The quality information will continue to be sent to tags that are
configured to store quality instead of values.
Miscellaneous
/HQ High queue limit. Do not set this unless instructed to do so by OSIsoft
Tech Support; it tells the interface when to decide it is using too much
memory and it is time to drop data instead of sending it to PI.
/LQ Low Queue limit. Do not change this either. It tells the interface when
to resume sending data to PI.
/ST Status tag. Tag to get the current state of the OPC Server.
Server-level Failover
/BACKUP The name or IP address and location of the backup OPC Server.
/CS The string tag into which should be written the name of the currently
active OPC Server.
/FT The number of seconds to try to connect before switching to the backup
server.
/NI The number of instances of the PI OPC Interface running on this node.
/SW The number of seconds to wait for OPC_STATUS_RUNNING status
before switching to the backup server.
/WS Failover if the OPC Server status leaves the OPC_STATUS_RUNNING
state.
/WD Multiple watchdog tag trigger sum.
/WD1 /WD2 Watchdog tag specifications.
/WQ Fail over if watchdog tags have bad quality or any error.
208
Appendix F:
List of Startup Parameters Grouped by Usage
Interface-level Failover
/CM Cluster Mode selects behavior for the backup interface.
/CN The string tag into which should be written the name of the currently
active interface node.
/FM Failover mode. /FM=1 is Warm_1 (chilly), /FM=2 is Warm_2 (cool),
/FM=3 is Warm_3 (warm – the default mode).
/PR Primary or backup? /PR=1 is primary, /PR=2 is backup.
/RN Resource number identifies the apionline instance that goes with this
interface instance.
/UHT_ID Specifies value for Location3 which is used for filtering UniInt health
tags
Debugging
/DB Debug level (see Appendix E: Debugging for more information)
/DF Specify the name of a PI tag that has the debug level. This should be an
Int32 tag, configured as an output tag for the interface. When the value
for the tag is changed, the interface will capture the new debug parameter
value. Nothing will be written to the OPC Server for this tag.
/DT Debug tag for some levels. See the section on Debugging.
Obsolete
/HS If set to /HS=Y makes the interface request a cache update rate of ½ of
210
Appendix G:
Troubleshooting OPC DCOM Problems
DCOM security problems are difficult to diagnose. Several policies and registry settings you can increase
the amount of information that Windows provides to solve these problems.
Security auditing
As a first step towards diagnosing DCOM communication problems, enable security
auditing on both the OPC server and client nodes. To do this, run the Local Security
Policy administrative control panel and select Security settings…Local policies…Audit
policies.
―Audit account logon events‖, ―Audit logon events‖, and ―Audit object access‖ should all
be set to log failures. Failure events appear in the Windows security log. On Windows
XP SP2 and 2003 computers, the logs also contain events generated by the Windows
Firewall, even if it is disabled; these events can provide additional clues to DCOM
failures.
Sample security log event:
Event Type: Failure Audit
Event Source: Security
Event Category: Account Logon
Event ID: 680
Date: 10/16/2007
Time: 5:20:48 PM
User: NT AUTHORITY\SYSTEM
Computer: OPCLAND
Description:
Logon attempt by: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
Logon account: opcaccount
control the amount of logging that Windows does for DCOM failures.
DWORD ActivationFailureLoggingLevel
This value controls the verbosity of event log entries about failed requests for component
launch and activation.
DWORD CallFailureLoggingLevel
Sets the verbosity of event log entries about failed calls to components once the
component has been activated.
DWORD InvalidSecurityDescriptorLoggingLevel
Sets the verbosity of event log entries about invalid security descriptors for component
launch and access permissions.
All 3 entries must be set to 1 to enable logging . You must restart running DCOM servers
before these settings take effect. After you enable logging, DCOM security errors appear
in the Windows event log. Only errors get logged, so you can leave logging enabled after
the configuration is complete.
Sample system log events
Example 1
This sample event shows a failure on a WinXP SP2 computer when the user is not in the
machine-wide limit access control list. In this case, a logon failure causes the user to
appear as ―Anonymous logon‖.
Event Type: Error
Event Source: DCOM
Event Category: None
212
Appendix G:
Troubleshooting OPC DCOM Problems
Event ID: 10014
Date: 10/16/2007
Time: 3:48:09 PM
User: NT AUTHORITY\ANONYMOUS LOGON
Computer: OPCLAND
Description:
The machine wide limit settings do not grant Remote Activation
permission for COM Server applications to the user NT
AUTHORITY\ANONYMOUS LOGON SID (S-1-5-7). This security
permission can be modified using the Component Services
administrative tool.
Example 2
This event shows a failure to activate the OPC server. The server name is not included in
the log, but can be determined by searching the registry for the CLSID.
Event Type: Error
Event Source: DCOM
Event Category: None
Event ID: 10016
Date: 10/16/2007
Time: 4:05:13 PM
User: NT AUTHORITY\ANONYMOUS LOGON
Computer: OPCLAND
Description:
The application-specific permission settings do not grant
Remote Activation permission for the COM Server application
with CLSID
{13486D51-4821-11D2-A494-3CB306C10000}
to the user NT AUTHORITY\ANONYMOUS LOGON SID (S-1-5-7). This
security permission can be modified using the Component
Services administrative tool.
Note: This error code comes from the call database that includes some versions of
RSLinx and Kepware‘s enterprise server.
8000401a The server process could not be started because the configured identity is
incorrect. Check the username and password. This indicates a problem with the OPC
server identity settings. Either there is a problem with the user account associated with
the OPC server, or the identity has be set to ―interactive user‖ and no user is logged on to
the server.
80040111 ClassFactory cannot supply requested class. Some OPC servers only will
accept remote connections. PI-ICU will treat any OPC server on the same computer as
the interface as a local server. Correct this error by manually modifying the interface
batch file so that the /server= includes the hostname or ―localhost‖ (for example,
―/server=localhost::some.opcserver.1‖)
80040112 Class is not licensed for use. This does not indicate a DCOM security
problem. Verify that the license for the OPC server is installed.
80040154 Class not registered. This error may occur if the interface cannot obtain
the OPC server information from the registry. In some cases, the problem is identical to
that described for error 80040111 (ClassFactory cannot supply requested class).
80070005 General access denied error. This is the most common DCOM security
error. Either the user account associated with the OPC interface does not have permission
to use the server, or the account cannot be authenticated by the server.
8007007e The specified module could not be found. This indicates a problem with
the installation of the OPC server. The executable for the OPC server cannot be loaded.
800706ba The RPC server is unavailable. This indicates a problem with the OPC
server, or a network problem.
80080005 Server execution failed.. Generic failure error.
Advise failed errors
80040202 Unable to open the access token of the current thread. The interface node
cannot authenticate the user account associated with the OPC server. This error may also
occur if the OPC server cannot establish a new connection to the interface because of a
network problem (in particular, a firewall that prevents incoming connections from the
OPC server).
80070005 General access denied error. Either the user account associated with the
OPC server does not have permission to call back to the interface, or the account cannot
be authenticated by the interface node.
80070008 Not enough storage is available to process this command. Out of
memory.
8007000e Server out of memory
800706ba The RPC Server is unavailable. Most often, a network problem.
214
Revision History
Date Author Comments
May-1997 LACraven Rough Draft
Jun-1997 LACraven Updated to reflect server issues, added PI OPCTool
description.
Sept-1997 LACraven Added Event Rate parameter, rewrote descriptive
sections.
Oct-1997 LACraven Updated to UniInt v2.25
May-1998 LACraven Release candidate
May-1999 LACraven Updated for v2.0
Jun-1999 LACraven Updated for v2.0.6
Oct-1999 Klee Added descriptions for failover support and
DCOMCNFG
Feb-2000 LACraven Added descriptions for arrays, DLLs, DCOM notes.
April-2000 LACraven Version 2.1 information, appendices.
May-2000 LACraven Additional options
Aug-2000 LACraven More options, clarifications
Nov-2000 LACraven Version 2.1.21, new options
Mar-2001 LACraven Version 2.1.22, new options
Jun-2001 LACraven Version 2.1.25, minor additions
Sept-2001 LACraven Version 2.1.31, new options
02-Nov-2001 Cgoodell Version 2.3.4; formatting, headers, footers
05-Nov-2001 Klee Minor wording changes to failover section
30-Nov-2001 LACraven Version 2.1.35 new options
08-May-2002 Byoung Clarification on options
26-Jul-2002 Cgoodell Added version 2.1.37; fixed some typos; fixed TCO;
fixed headers & footers
6-Aug-2002 LACraven Added version 2.1.38
2-Oct-2002 LACraven Enhancements for 2.1.39
22-Jan-2003 LACraven Enhancements for 2.1.41
28-Apr-2003 LACraven Added DCOM caution, minor clarifications, updated
version number.
24-Jun-2003 LACraven Added /SQ=I option, updated version number
16-Jul-2003 Klee Corrected DCOM Identity tab configuration instructions.
21-Jul-2003 LACraven Corrected Basic DCOM Identity info, updated version
number.
07-Oct-2003 Amaksumov Document Structure changed, Installation checklist
216
Revision History
218
Revision History