PI Interface For OPC DA 2.6. User Guide
PI Interface For OPC DA 2.6. User Guide
PI Interface For OPC DA 2.6. User Guide
User Guide
OSIsoft, LLC
777 Davis St., Suite 250
San Leandro, CA 94577 USA
Tel: (01) 510-297-5800
Fax: (01) 510-357-8136
Web: http://www.osisoft.com
The following configuration places the OPC server on its own computer:
• Interface logging
For more information about reading message logs, see the OSIsoft Knowledge Base article
How to read new UniInt 4.5.0.x and later Interface message logs (http://
techsupport.osisoft.com/techsupport/nontemplates/KB/article.aspx?id=KB00401).
• opcscan.exe
• opcrefresh.exe
• opcresponse.exe
Used for translating time stamps from refresh logs for the OPC server and run from the
command line.
Note:
OSIsoft recommends that security updates from Microsoft are regularly installed. OSIsoft
recommends using the newest versions of Windows for latest security features. For more
information about security, see Security best practices for PI Interface for OPC DA.
No 64-bit builds of the PI OPC DA interface are available.
Feature Support
OPC Data Access Standard 1.0a / 2.0 / 2.05
Auto creates PI points APS Connector
Point Builder utility Yes
ICU control Yes
PI point types Int16 Int32 Float16 Float32 Float64 Digital String
Timestamp
Sub-second time stamps Yes
Sub-second scan classes Yes
Automatically incorporates PI point attribute Yes
changes
Exception reporting Interface: PI exceptions
OPC server: Deadband
Feature Support
Disconnected startup Yes
SetDeviceStatus Yes
Failover options OPC server-level failover and UniInt Phase 2
Interface-level failover
Vendor software required on PI interface node No
Vendor software required on data source Yes
Vendor hardware required No
Additional PI software included with interface Yes
Device point types VT_I2
VT_I4
VT_R4
VT_R8
VT_BSTR
VT_DATE
Serial-based interface No
Installation prerequisites
Before installing and configuring the interface, ensure that the following system prerequisites
are met:
• Supported operating system and vendor hardware and software.
For more information, see Features supported by PI Interface for OPC DA.
• Connection to a running PI Data Archive node.
Use PI System Management Tools (PI SMT) to view PI Data Archive status.
• Connection to a running OPC server that is populated with points.
Use PI OPC Client Tool to view the OPC server connection and contents.
• Correct time zone setting for the interface node.
• You are installing the interface using an administrator account.
For more information about security requirements for the interface, see Security
configuration for PI Interface for OPC DA.
libraries, provided by the OPC Foundation and installed with the interface, are installed in the
same directory as OPCEnum.
Procedure
1. On the interface node, run the PI Interface for OPC DA setup program.
2. Test the connection to PI Data Archive from the interface node.
◦ For PI API connections, open a command prompt, navigate to the %PIPC%\bin directory,
and issue the apisnap PISERVERNODE command.
◦ For PI SDK connections, from the Windows Start menu, click All Programs > PI System >
About PI-SDK, and then click File > Connections to connect.
• Startup parameters
• Security
• Windows service
• PI points
• Buffering
Additional configuration options include failover, disconnected startup, and interface
performance and status points. For details about configuration for common UniInt interface
features, refer to the PI Universal Interface (UniInt) User Guide.
Copies of the interface software, called interface instances, can be made on one or more
interface nodes. Each interface instance requires its own startup (.bat) file. The .bat file
contains parameters, sometimes called flags, which are configured to create the startup and
runtime settings of the interface.
Use PI ICU to configure interface settings to ensure a correctly-formatted .bat file. Once the
first interface instance is configured, you can use a copy of the configured .bat file and replace
instance-specific parameters for each interface instance. The .bat files are located in the
installation directory for the interface, which also includes a template batch file
(opcint.bat_new) that you can use for reference and testing.
The .bat file parameters can also be run from the command line for testing and
troubleshooting. For a complete list of parameters, open a command window, navigate to the
interface installation directory, and issue the following command: opcint -help.
Procedure
1. Create the interface instance on the interface node.
2. Configure security.
a. Configure the Windows service.
b. Restrict access for service accounts.
c. Create and configure a PI identity, PI trust, and mappings for the interface (application
name: OPCpE), the buffering subsystem, and the PI ICU applications.
d. Configure DCOM settings.
3. Configure interface startup batch (.bat) file parameters with the minimal settings:
◦ Point source
Use OPC or an unused point source of your choice.
◦ Scan classes
Set as desired. Scan class 1 is reserved for advise points.
◦ Interface ID
Use 1 or any unused numeric ID.
4. Configure the connection to an OPC server. From the OPC Server tab in the OPCInt tab in PI
ICU, click the List Available Servers button, then select the server. If the server is on another
machine, specify that machine or IP address in the Server Node field.
5. Use the PI OPC Client tool to verify that the OPC server is connected, running, and populated
with points.
6. Verify interface startup.
7. Define the digital state sets for digital PI points.
8. Build input points and (optional) output points for the interface, and verify that data
appears in PI Data Archive.
For details on point attributes, see PI point configuration for PI Interface for OPC DA.
9. Configure buffering.
Stop the interface, then configure and start buffering. Restart the interface and confirm that
the service and buffering restart.
10. Configure the following optional features:
◦ Disconnected startup
Disconnected startup allows the interface to start even if PI Data Archive is not available.
◦ UniInt failover
UniInt failover minimizes data loss by enabling a backup interface instance to collect
data if the primary interface instance fails.
Procedure
1. Launch PI ICU and click Interface > New from BAT file.
2. Browse to the interface installation directory (default %PIPC%\Interfaces\OPCInt),
select OPCInt.bat_new, and then click Open.
The Select PI Host Server window opens.
3. Specify the PI Data Archive and click OK.
PI ICU displays the settings of the new instance of the interface.
4. Configure the basic settings as follows:
◦ General tab
▪ Point source
Use OPC or a point source not already in use.
▪ ID
Use 1 or a numeric ID not already in use by another instance of the interface.
▪ Scan Class
Set to desired scan frequency. Scan class 1 is reserved for advise tags. When defining
multiple scan classes, you can spread the server workload using offsets.
◦ OPCInt page
Click the List Available Servers button, then select your OPC server from the drop-down
list of servers. If the server resides on another machine, specify the node name or IP
address in the Server Node field before listing the available servers.
Note:
Certain OPC servers may refuse “remote" connection attempts. If the Server Node
field is blank or set to LocalHost (case insensitive), the interface will treat the server
as though it is local. If anything else is used in the Server Node field, the connection
will be treated as remote.
security, enable OPC security and select NT security or Private OPC security, then enter
the user ID and password.
Note:
OSIsoft recommends using NT security to encrypt user ID and password information.
Private OPC security stores and transmits this information in clear text. For more
information, see Security configuration for PI Interface for OPC DA.
Note:
In some cases, the interface service account privileges can be restricted to limit file,
folder, and registry key access. Virtual service accounts, managed service accounts, non-
administrator domain service accounts, and non-administrator local service accounts are
the best options for limiting service account permissions.
For more information about managing PI Data Archive security and trusts, see the PI Server
System Management Guide.
DCOM security
OPC server and client applications are based on Mocrosoft's COM/DCOM communication
model. For an overview, see DCOM configuration for PI Interface for OPC DA.
For more information about DCOM security for PI OPC products, see the DCOM Security and
Configuration Guide.
Create trusts
When creating trusts, you have many options. Following is a simple and secure approach,
creating a trust for the following applications:
Procedure
1. Click Security and choose Mappings & Trusts.
2. On the Trusts tab, right-click and choose New Trust.
The Add Trust wizard opens.
3. Specify a meaningful name and description for the trust.
4. Configure settings as follows:
Trust Type Application Name Network Path PI User
PI Interface for PI API application OPCpE Name of the Identity with
OPC DA interface node or access rights to
IP address plus the PI points for
netmask the interface.
255.255.255.255 Enabled by the
datasecurity
attribute.
PI ICU PI API application PI-ICU.exe Name of the Dedicated PI
interface node or identity with the
IP address plus precise
netmask permissions
255.255.255.255 required
(database read
access, read
ptsecurity and
read-write
permission for
OPC points)
Buffering PI API application Bufserv: APIBE Name of the Buffering service
interface node or identity with
PIBufss:
IP address, plus necessary access
Pibufss.exe
netmask rights for the PI
255.255.255.255 points for all
interfaces on the
interface node.
Procedure
1. Launch PI ICU and click the Service tab.
2. Set the fields as described in the following table.
Field Description
Service name Descriptive name for the interface service.
ID Numeric ID of the interface instance. Must be unique for each instance.
Display name The service name displayed in the Windows Services control panel.
The default display name is the service name with a PI- prefix. You can override the
default. To ensure that OSIsoft-related services are sorted together in the Services
control panel, retain the PI- prefix.
Procedure
• To verify that the service is running, run services.msc from the Windows Start menu.
• To start and stop the service, use PI ICU.
• Custom ACLs and security levels can be specified for individual DCOM servers using the
Windows dcomcnfg utility.
• Custom security can be implemented in code by the DCOM server
(CoInitializeSecurity).
For the OPC server, the user is the account specified in the Identity tab in the DCOM
configuration for the server. Windows provides several options for the identity used by a
DCOM server:
• Interactive user
The account that is logged on to the console of the computer where the server is running.
This setting is problematic for OPC communications: if no one is logged on to the console or
the user logged on does not have DCOM permissions, the client cannot connect to the OPC
server.
• Launching user
The server process runs under the same account as the calling client. Do not use this setting
if multiple clients running under different accounts need to access the same OPC server,
because a new instance of the OPC server is launched for each user. Note that the user ID of
the calling client might not have permission to connect to the server, because many servers
implement their own user authentication aside from DCOM permissions.
• This user
Recommended, unless the OPC server vendor specifies a different setting. Include the
specified user in the default DCOM ACLs on the interface node. If the OPC server runs as a
Windows service, use the same account as the logon account for the service.
Procedure
1. Start PI OPC Client tool and connect to your OPC server.
2. To select the OPC items you want to export, create a group (click ) and add the desired
items to it.
3. Choose File > Save As and specify the name and location of the export file.
4. Click Save.
PI OPC Client tool creates a .csv file containing the OPC items you selected.
5. In PI SMT, start Microsoft Excel by choosing Tools > Tag Configurator.
6. In Microsoft Excel, open the .csv file that contains the exported OPC items.
7. Examine the generated entries to ensure that the desired points are listed. If any entries
have Unknown in the PointType column, specify the desired data type for the point.
8. To generate the PI points, choose PI SMT > Export Tags. The Export PI Tags window opens.
9. Choose the target PI Data Archive node and click OK.
10. Examine the list of results to verify that the PI points are created.
Procedure
1. Ensure the following PI point attributes are configured:
◦ pointsource
Identifies all points that belong to this instance of the PI OPC interface. Specify the same
Point source entered on the PI ICU General tab .
◦ location2
To enable handling for OPC servers that do not return certain numeric types in their
native format, set location2 to 1. Numeric data is returned as a string.
◦ location3
Point type. Options are:0 (polled), 1 (advise), or 2 (output).
◦ location4
Specifies the scan class.
◦ location5
Optional deadband value for advise points.
◦ exdesc
Specifies event points, Long ItemID, Dzero for scaled points, or ItemID to get the time
stamp for an output value.
◦ instrumenttag
OPC ItemID that corresponds to the PI point you are defining. Case-sensitive. To display
OPC server items, use PI OPC Client Tool.
◦ datasecurity
For every PI point that the interface instance services, the access control list in the
datasecurity attribute must grant read access to the PI identity in the PI trust that
authenticates the interface instance. If the interface is used without a buffering
application, write access also must be granted. If the interface is used with a buffering
application, the buffering application requires write access but the interface does not.
Note:
When buffering is configured, the datasecurity attribute must permit write access
for the buffering application's PI trust or mapping. The datasecurity write
permission for the interface's PI trust is required only when buffering is not
configured.
◦ ptsecurity
The access control list in the ptsecurity attribute of every PI point that the interface
instance services must grant read access to the PI identity in the PI trust that
authenticates the interface instance.
Tag
The Tag attribute (or tag name) 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 System
documentation uses the terms "tag" and "point" interchangeably.
Follow these rules for naming PI points:
Length
Depending on the version of the PI API and the PI Data Archive, this interface supports Tag
attributes 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 Data
Archive versions.
PI API PI Data Archive Maximum Length
6.0.2 or later 4.370.x or later 4.370.x or later 1023
6.0.2 or later Earlier than 3.4.370.x 255
Earlier than 1.6.0.2 4.370.x or later 255
Earlier than 1.6.0.2 Earlier than 3.4.370.x 255
If the PI Data Archive 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
*** SDK options*** for information.
PointSource
The PointSource attribute contains a unique, single or multi-character string that is used to
identify the PI point as a point that belongs to a particular interface.
If the point type defined in PI Data Archive does not match the required data type defined in
the OPC server, the interface attempts to translate the data. To determine whether the point
can be read as the required type, use PI OPC Client Tool to try to read the point directly from
the OPC server. For more information on data type compatibility, see Data type compatibility.
Location1
Location1 indicates to which copy of the interface the point belongs. The value of this attribute
must match the /id command-line parameter.
2 Read value as a Boolean. Boolean values are either zero and nonzero.
For numeric points, any value but 0 (False) is set to -1 (True). Use this option to
correctly convert an OPC server Boolean value into the PI System digital state,
which prevents the PI point from receiving Bad quality values for a Boolean value
that is True.
6 Read time stamps from the OPC server as strings and transform them into seconds.
The PI point can be an int or a float. The format of the time stamp string is specified
in the interface batch file using the tf parameter.
Value Description
8 Directs the OPC server to send the canonical data type.
The interface tries to transform the value into the proper data type for the PI point.
Use with caution, because the transformation can fail if the source data type is not
compatible with the PI point data type, or if the value cannot be represented using
the PI point data type.
>= 1024 When a post-processing DLL is used with PI Interface for OPC DA, directs the data to
be processed by the DLL.
Adding any of the above settings (1-8) to 1024 enables those options to be used
during processing. For more information, see the TimeArray Plug-in User Manual.
For an advise point, PI Interface for OPC DA registers for updates with the OPC server, and the
OPC server sends new values to the interface. The update rate from the server does not exceed
the update rate for the group.
The OPC standard does not guarantee that it can scan data at the rate that you specify for a
scan class. If the OPC server does not support the requested scan frequency, the frequency
assigned to the class is logged in the pipc.log file. If the interface workload is heavy, scans
can occur late or be skipped. For more information on skipped scans, see the PI Universal
Interface (UniInt) User Guide.
For more information about setting the scan class, scan offset, and update rate, see Scan class
settings and update rates.
• OPC ItemID
Because of limitations to the maximum length of the instrumenttag attribute, you might
need to specify the OPC ItemID in the exdesc attribute.
Use the syntax instr=ItemID, where ItemID exactly matches the ItemID defined on the
OPC server. If the ItemID contains a comma or space, enclose it in double quotes.
If PI API is version 1.6.0.2 or later and PI Data Archive is 3.4.370.x or later, the maximum
length of the instrumenttag attribute is 1023 characters. For all earlier versions, the
maximum is 32. If you are running earlier versions and require more than 32 characters to
specify the ItemID, you must enable the PI SDK or use the exdesc attribute to specify the
OPC ItemID.
If these values need to be processed as different data types, use the location2 attribute for
the PI point with userint1=1 and the settings for scaling and transformation for each
individual point to configure how PI Interface for OPC DA handles the individual value.
PI Interface for OPC DA receives the data using the data type specified by the location2 value
for the point with userint1=1, then processes the value according to how the individual point
is configured. Note that some servers cannot provide array data using any data type other than
the canonical, or native, data type (the one displayed in the PI OPC Client tool if you omit data
type). For those servers, you must either use a PI point with the correct data type, or set
location2 to 8 to configure the interface to ask for the canonical data type. For maximum
efficiency, always request the canonical data type.
Scan
By default, the Scan attribute has a value of 1, which means that scanning is turned on for the
point. Setting the Scan attribute to 0 turns scanning off. If the Scan attribute is 0 when the
interface starts, a message is written to the log and the point is not loaded by the interface.
There is one exception to the previous statement.
If any PI point is removed from the interface while the interface is running (including setting
the Scan attribute to 0), SCAN OFF will be written to the PI point regardless of the value of the
Scan attribute. Two examples of actions that would remove a PI point from an interface are to
change the point source or set the Scan attribute to 0. If an interface-specific attribute is
changed that causes the point to be rejected by the interface, SCAN OFF will be written to the
PI point.
Shutdown
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 Data
Archive 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.
To configure PI Shutdown Subsystem to write SHUTDOWN events only for PI points that have
their shutdown attribute set to 1, edit the \PI\dat\Shutdown.dat file, as described in the PI
Server System Management Guide (https://techsupport.osisoft.com/Downloads/File/
b481399c-463e-4bcb-a93f-6ef85295263e).
SHUTDOWN events can be disabled from being written to PI points when the PI Data Archive
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
Shutdown.dat file, as discussed in the PI Data Archive manuals.
Scan class time and offset time values use the following format: HH:MM:SS.##, where:
• HH is hours
• MM is minutes
• SS is seconds
• ## is hundredths of seconds (01 to 99)
If you omit HH and MM, the scan period is assumed to be in seconds. For example, /
f=00:01:00,00:00:05 is equivalent to /f=60,5.
The L value associates the time unit value with the local computer time-of-day settings. Time-
of-day scans use a 24-hour clock and are automatically adjusted for daylight saving time. This
is also known as wall clock scheduling. The following example uses a scan frequency of 24
hours (once a day), an offset of eight hours from midnight (8 AM), and enables time-of-day
scanning by specifying the L value: /f=24:00:00,08:00:00,L
The scan class frequency determines how often to scan for data. The offset specifies how long
after the frequency's time value to scan for data. To balance the scanning workload, specify an
offset for scan classes that have the same interval so that they are not scanned simultaneously.
For each scan class that you want to define, specify the f parameter. Scan classes are
numbered by the order in which you define them. Scan class 1 is the first defined f parameter,
and scan class 2 is the second f parameter you define.
Examples:
• Scan class 1 has a scanning frequency of one minute with an offset of five seconds, and scan
class 2 has a scanning frequency of seven seconds with no offset:
/f=00:01:00,00:00:05 /f=00:00:07
• Two scan classes, defined using only seconds:
/f=60,5 /f=7
• Sub-second scan classes defined as decimal values:
/f=0.5 /f=00:00:00.1
Note:
Deleting scan classes or changing their order can adversely affect the operation of
existing PI points, which are closely related to scan rates. Scan classes should be adjusted
only by PI System administrators who are fully aware of the PI System configuration and
the effects of any such changes.
For more information about scan classes, see the PI Interface Configuration Utility (PI ICU) User
Guide.
Scanning offsets
To mitigate the interface and OPC server workload, you can use the offset to stagger scanning.
If an offset is specified, scan time is calculated from midnight on the day that the interface was
started, applying any offset specified. In the first scan class in the above example, if the
interface was started at 05:06:06, the first scan occurs at 05:07:05, the second scan at
05:08:05, and so on. If offset is omitted, scanning is performed at the specified interval,
regardless of clock time.
Offsets determine when the interface asks the OPC server for the current values for polled
classes. They do not control the behavior of the OPC server, and have no effect on advise
classes unless the ga parameter is specified to stagger the activation of groups. In this case, the
offsets are used to time the activation of all groups except for scan class 1, which is reserved
for advise tags.
Update rates
The OPC server reads data from the device according to the update rate for the group in which
the item resides. By default, the update rate is the same as the scan rate.
To override the default using PI ICU, browse to the OPCInt > OPC Server > Advanced Options
page and enter your update rate value for the ur parameter in the Update Rates area.
For polled groups, configuring an update rate that is shorter than the scan period ensures that
the interface is receiving current data. For example, if the scan period is five seconds but the
update rate is two seconds, the data is no more than two seconds old when it is read. However,
note that a faster update rate increases the OPC server workload.
For advise groups, assign identical update and scan rates, except in cases where phase 1 UniInt
failover is configured for the interface. In this case, to ensure that the interface sees new values
for failover heartbeat tags as soon as possible, set the update rate to half the scan period. This
configuration reduces the risk of control needlessly switching back and forth. Dedicate a scan
class with faster update rate to the failover heartbeat points.
Note:
OSIsoft recommends using phase 2 UniInt failover. For more information about
converting from phase 1 to phase 2 UniInt failover, see the PI Universal Interface (UniInt)
User Guide.
• Advise points
Input is collected and stored in PI points when the OPC server updates item values in the
server cache, based on the scan class configured for the PI point. The interface updates PI
points when advised that a value changed.
• Event points
Input is stored in PI points when the interface is notified of an updated trigger point. The
interface reads the event points, which can be associated with an event group, from the OPC
server.
• Polled points
Input is collected and stored in PI points based on the scan class configured for the point
and the update rate of the OPC server. The interface polls the OPC server at a regular rate.
All three types of points are received asynchronously by the interface.
Advise points
Advise points are sent to PI Interface for OPC DA by the OPC server only when a new value is
read into the OPC server cache.
Scan class 1 is reserved for advise points, and you can create additional scan classes for advise
points as required. Ensure that the scan class rate is fast enough to capture all the changes
from the data source.
The default maximum number of PI points in scan class 1 is 800. Up to 800 points with the
same deadband can reside in the same group. If there are more than 800 points with the same
deadband in scan class 1, the interface creates as many groups as needed. To ensure best
performance, ensure that groups size does not exceed 800 items.
Note:
Your server might perform better with smaller group sizes; a limit of 200 points per
group has proven effective with a number of OPC servers.
To change the default limit for advise-based PI points in a scan class, use PI ICU to set the
Number of Tags in the advise group field on the OPCInt > Data Handling page.
Configure the following PI point attributes to create polled points:
• location3
Set to 1 for advise points.
• location4
Assigns the scan class for a point.
Note:
Do not assign the same scan class to both advise and polled points. Use a separate
class for each point type.
Event points
Event points are read by the PI OPC interface when it receives notification that a trigger point
has a new event. Event PI points are configured with a trigger PI point. When the trigger point
receives a value, the event point is read.
Frequent device reads can impair the performance of the OPC server. By default, the server is
requested to update its cache every second for every event point defined. You can set reads to
different update rates depending on the OPC server version:
• OPC v2.0 servers always read event points from the device, not the cache. To reduce system
resource overhead from cache updates to the OPC server, set the event rate (er) parameter
to a high value, such as eight hours.
• For OPC v1.0a servers, asynchronous reads come from the cache. The internal cache update
interval needs to be fast enough to ensure that data in the cache is not stale.
For any asynchronous read, the OPC server is required to return all of the values together,
which can delay the return of new values to PI Data Archive if the OPC server encounters a
delay in reading the values. To improve performance in this case, group points according to the
device where the data originates.
• location3
Set to 2 for event points.
• location4
Assigns the scan class for a point. Set to 0 for event points.
• userint2
For each OPC event group, configure this attribute as the same integer for each PI point in
the group. Assigning PI points to OPC event groups ensures that the points are read
together.
For example, a plug-in DLL that post-processes data might require the data to be sent in a
single group.
• exdesc
For each OPC event group, configure the exdesc attribute using the same name of the
triggering point. Use the syntax TRIG='trigger_point_name’ event_condition. Use
single quotes. To treat all changes as triggering events, omit event_condition.
See the following table for a list of event descriptions:
Event Condition Description
Anychange Trigger on any change as long as the value of the
current event is different than the value of the
previous event. System digital states also trigger
events. For example, an event will be triggered
on a value change from 0 to "Bad Input," and an
event will be triggered on a value change from
"Bad Input" to 0.
Increment Trigger on any increase in value. System digital
states do not trigger events. For example, an
event will be triggered on a value change from 0
to 1, but an event will not be triggered on a value
change from "Pt Created" to 0. Likewise, an event
will not be triggered on a value change from 0 to
"Bad Input."
Decrement Trigger on any decrease in value. System digital
states do not trigger events. For example, an
event will be triggered on a value change from 1
to 0, but an event will not be triggered on a value
change from "Pt Created" to 0. Likewise, an event
will not be triggered on a value change from 0 to
"Bad Input."
Nonzero Trigger on any non-zero value. Events are not
triggered when a system digital state is written
to the trigger tag. For example, an event is
triggered on a value change from "Pt Created" to
1, but an event is not triggered on a value change
from 1 to "Bad Input."
The PI point that triggers the read is a separate input point than the event points. When a
new event for a trigger point is sent to the PI Snapshot, the PI System notifies the interface,
which then reads the values for all the associated event points from the OPC server.
For v1.0a servers, an asynchronous read is sent to the server’s cache. For v2.0 servers, the
interface performs an asynchronous read from the device.
For more information about configuring input trigger points, see the PI Universal Interface
(UniInt) User Guide.
For efficiency with v1.0a servers, separate event points into groups based on the triggering
event. For OPC v2.0 servers, separate event points according to the data source. The OPC v2.0
standard requires that all asynchronous reads originate from the device rather than from the
server’s cache, so set the cache update rate high and do not group values that come from
different devices.
The following table illustrates PI points configured for separate event points.
Tag ExDesc Instrum Locatio Locatio Locatio Locatio Locatio UserInt1 UserInt2
entTag n1 n2 n3 n4 n5
PM1_Te TRIG=P ItemID1 1 0 0 0 0 0 1
mp.PV M1_Trig
ger
PM1_Rat TRIG=P ItemID2 1 0 0 0 0 0 1
e.PV M1_Trig
ger
PM2_Te TRIG=P ItemID3 1 0 0 0 0 0 2
mp.PV M2_Trig
ger
In the preceding example, PM1_Trigger and PM2_Trigger are points that are updated either
by this interface instance, another interface, or by manual entry. When PM1_Trigger gets a
new event in the snapshot, the interface sends the OPC server a read command that requests
data for both PM1_Temp.PV and PM1_Rate.PV. Both values are returned in a single call.
Likewise, when PM2_Trigger gets an event in the snapshot, the interface requests a value for
PM2_Temp.PV.
Polled points
Polled PI points are grouped by scan class. If possible, the interface reads groups using the scan
class rate configured for the point. Configure scan class rates using PI ICU.
Note:
The OPC server does not guarantee that scan rates match between the OPC server and
the interface. PI Interface for OPC DA sends a request to the OPC server to use an update
rate that matches the scan class, but the OPC server determines its own update rate for
scanning its data sources. The scan class offset has no effect on the OPC server, unless the
interface is configured for staggered group activation and the OPC server uses the
activation of the group to initiate the scanning cycle.
For more information about polled points, see the OPC Foundation document Data Access
Custom Interface Standard v2.05a.
Configure the following PI point attributes to create polled points:
• location3
Set to 0 for polled points.
• location4
Assigns the scan class for a point.
Note:
Do not assign the same scan class to both advise and polled points. Use a separate
class for each point type.
The pointsource attribute of the output point must match the point source (ps) value of
the interface instance, but the source point can be associated with any point source. The
data type of the source point must be compatible with that of the output point.
You can specify how long to wait for the OPC server to acknowledge a write. If no
acknowledgement is received in the specified period, the interface cancels the write and
reissues it.
If your OPC server does not acknowledge writes, you can create an alert using the Device
Status health point. Configure the alert to detect a desired number of queued writes. When the
specified level is reached, the alert sets an alarm state and drops a specified number of values,
oldest or newest.
If your OPC server does not permit clients to specify a data type, set location2 to 8 for all
your OPC-based PI points to configure the interface to request the canonical, or native, data
type from the OPC server.
Note:
PI Interface for OPC DA might receive data for which no reasonable conversion is
possible. Where possible, always specify the OPC data type that matches the PI point.
Boolean values
Some OPC servers send Boolean values as 0 and -1 when read as integers. This approach
creates a problem when reading that data into a digital PI point, because "-1" is not the value
that must be stored. To handle the data from such servers, the interface uses the absolute value
of any integer or real values read for digital points. Because digital point values are actually
offsets into the digital set for the point, and a negative offset has no functional meaning, this
issue does not cause problems for properly-written servers.
PI Interface for OPC DA can also request the item as a Boolean (VT_BOOL). This approach only
works for items that have two possible states, because any non-zero value is interpreted as 1.
To have items read and written as though they were Boolean values, set location2 to 2.
Four-byte integers
If your OPC server does not support the two-byte integer (VT_I2) data type, you can configure
PI Interface for OPC DA to request the data as a four-byte integer (VT_I4) by setting
location2 to 3.
Float64 values
To handle eight-byte floating-point numbers (VT_R8), set the location2 of the target point to
5. PI Data Archive stores the value as a four-byte floating-point number, with possible loss of
precision. If the number is too large to fit in the point, a status of BAD INPUT is stored.
The position of the tokens and delimiters must specify the format of the time stamp string
precisely. Examples:
Format String Result
ccyy/mn/dd hh:mm:ss.000 1998/11/29 15:32:19.391
dd mon, ccyy hr:mm:ss XM 29 Nov, 1998 03:32:19 PM
mn-dd-ccyy hh:mm:ss 11-29-1998 15:32:19
hh:mm:ss.000 15:32:19.482
Only one format string can be specified for each instance of PI Interface for OPC DA. If more
than one format of time stamp needs to be processed, configure additional instances of the
interface with the required time stamp format string.
If you omit elements of the format strings, the defaults are as follows ("current" values are
UTC)::
Omitted format string element Default
Day Current day
Month Current month
Year Current year
Century Current century
Note:
If you specify only hours, minutes and seconds, the date defaults to January 1, 1970. To
ensure accurate time stamps, be sure to specify all the elements of the time stamp format.
If the OPC server returns a zero value for the day, month or year element, the interface
applies the defaults described above, regardless of the format string you specify.
Scaling
To configure scaling for an OPC-based PI point, set the totalcode and squareroot attributes
of the point. The convers attribute specifies the span of the device, and the exdesc specifies
the device zero (Dzero). Using these values, the interface can translate a value from the scale of
the device to the scale of the PI point. Scaling is only supported for numeric points.
For simple square/square root scaling, set totalcode and convers to zero. To configure how
the value is stored, set squareroot as follows:
• To square a value before sending it to PI Data Archive, set squareroot to 1. For output
values, the square root is calculated before it is written to the device.
• To send the square root to PI Data Archive and the square to the device, set squareroot to
2.
Transformation
To transform the value to another scale of measurement, to apply an offset or conversion
factor, or to perform bit masking, configure the settings as shown in the following table. If
squareroot is set to 1 or 2, the square root or square of the value is calculated first, then the
formula is applied.
Conver TotalCo SquareRo Dzero Operation Input points Operation Output points
s de ot
0 0 1 No (Value)2 (Value)0.5
effect
2 No (Value)0.5 (Value)2
effect
Non- 1 0 Define [ (Value – Dzero) / Convers ] [ (Value – Zero) / Span] *
zero d * Span + Zero Convers + Dzero
1 Define [ ((Value)2 – Dzero) / [ ((Value)0.5 – Zero) / Span] *
d Convers ] * Span + Zero Convers + Dzero
2 Define [ ((Value)0.5 – Dzero) / [ ((Value)2 – Zero) / Span] *
d Convers ] * Span + Zero Convers + Dzero
2 0 No Value * Convers Value / Convers
effect
1 No (Value)2 * Convers (Value)0.5 / Convers
effect
2 No (Value)0.5 * Convers (Value)2 / Convers
effect
3 0 Define (Value / Convers) – Dzero (Value + Dzero) * Convers
d
1 Define ((Value)2 / Convers) – Dzero ((Value)0.5 + Dzero) * Convers
d
2 Define ((Value)0.5 / Convers) – ((Value)2 + Dzero) * Convers
d Dzero
4 0 Define (Value – Dzero) / Convers (Value * Convers) + Dzero
d
1 Define ((Value)2 – Dzero)/ Convers ((Value)0.5 * Convers) + Dzero
d
2 Define ((Value)0.5 – Dzero)/ ((Value)2 * Convers) + Dzero
d Convers
5 0 No Value + Convers Value – Convers
effect
1 No (Value)2 + Convers (Value)0.5 – Convers
effect
2 No (Value)0.5 + Convers (Value)2 – Convers
effect
6 No effect No Value AND Convers Value AND Convers
effect
7 No effect No Value OR Convers Value OR Convers
effect
8 No effect No Value = Value XOR Convers Value = Value XOR Convers
effect
Quality states
Quality data is composed of three sub-fields. The following tables list the values that are
returned.
Good quality
Quality OPC Definition PI System Status
11SSSSLL Non-specific Good
Except: Local Override _SUBStituted*
110110LL
* These values will be marked as questionable, unless you use the following switches to ignore
questionable values.
• If you use /SG=S, then "Local Override" is treated as good. However, it also suppresses bad
and questionable values.
• /SQ=I writes questionable values but suppresses the questionable flag, so that they appear
in PI as if they were good.
Not used by OPC
Quality OPC Definition PI System Status
10SSSSLL Invalid Bad Input
Questionable quality
Quality OPC Definition PI System Status
010110 LL Sub-Normal Bad_Quality
010101LL Engineering Units Exceeded
LL=01 Low Limited Under LCL
LL=10 High Limited Over UCL
Otherwise Inp OutRange
010100LL Sensor Not Accurate
LL=01 Low Limited Under Range
LL=10 High Limited Over Range
Otherwise Out of calibration (if not under or Invalid Data
over range)
010011LL Invalid Bad Input
010010LL Invalid Bad Input
010001LL Last Usable Value No_Sample
010000LL Non-specific Doubtful
To replace the default PI System digital states with custom states using PI ICU, go to the
OPCInt > Data Handling page and set the Alternate Digital State for Questionable/Bad
Qualities field. To override the default states, you must specify the full set of replacements, and
the numeric values must be contiguous.
The following table lists the digital states and PI statuses that you can override.
Custom digital states
Order After Marker State Default PI status
1 Bad_Quality
2 Under LCL
3 Over UCL
4 Inp OutRange
5 Under Range
6 Over Range
7 Invalid Data
8 Bad Input
9 No_Sample
10 Doubtful
11 Out of Service
12 Comm Fail
13 Scan Timeout
14 Equip Fail
15 Unit Down
16 Not Connect
17 Configure
18 Bad
Because each range has the same size (decimal 64), you can use a simple conversion to obtain
the corresponding digital state, as follows:
• You must define a point that reads the first array element.
• Assign the points to the same scan class.
• To optimize CPU usage, do not use the same scan class to read more than one OPC array.
• If you need to read the same OPC array element into more than one point, you must assign
the points to different scan classes.
Because all the tags in an 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 be configured to be in the same event group.
• UniInt failover
If one instance of PI Interface for OPC DA fails, another instance can take over data
collection.
Note:
UniInt failover is a feature common to UniInt-based interfaces. For more information
about configuring UniInt failover, see the PI Universal Interface (UniInt) User Guide.
Hot failover
Hot failover is the most resource-intensive mode. Both the primary and backup interface
instances are collecting data, possibly from the same OPC server. No data is lost during
failover, but the OPC server carries a double workload, or, if two servers are used, the back-end
system must support both OPC servers.
Warm failover
There are three options for warm failover:
Cold failover
Cold failover is required if an OPC server can support only one client, or if you are using
redundant OPC servers and the backup OPC server cannot accept connections. The backup
instance does not connect with the OPC server until it becomes primary. At that time, it must
create groups, add items to groups, and advise the groups. This delay almost always causes
some data loss, but imposes no load at all on the OPC server or data source system.
Note:
PI Interface for OPC DA supports using OPC watchdog points to control failover.
Watchdog points enable the interface to detect when its OPC server is unable to
adequately serve data and failover to the other interface if the other interface is better
able to collect data. This approach is intended for OPC servers that are data aggregators,
collecting data from multiple PLCs. If one point on each PLC is designated as a watchdog
point, the interface can be instructed to failover if less than a specified number of those
points are readable. This approach enables the benefits of redundancy to be applied at
the data collection level. For more on how to configure OPC watchdog points, see Server
status and OPC watchdog points.
Procedure
1. In PI ICU, go to the OPCInt Failover > Server Level page and enter the node and name of the
other OPC server.
This basic configuration triggers failover only when PI Interface for OPC DA loses
connectivity to the OPC server.
2. Optionally, create a string PI point to track the active OPC server. Assign the PI point to an
unused point source.
In PI ICU, go to the OPCInt > Failover > Server Level page and enter the PI point name in the
Current Active Server Tag field. To display the value of the point, launch PI SMT and use the
Data > Current Values feature.
When failover occurs, the value of this point changes to the name of the currently connected
OPC server. The archive of these changes enables you to view failover history.
3. To verify that failover occurs when connectivity is lost:
Procedure
1. Create a PI point. Map the point to an OPC item that you consider a reliable indicator of
server status.
The OPC item to which the point is mapped must be defined identically in both the primary
and backup OPC servers, while possibly having different values on the two servers.
2. Indicate the watchdog point for the primary and backup OPC servers: Using PI ICU, go to the
OPCInt > Failover > Server Level page and configure the Primary Server Watchdog Tag and
Backup Server Watchdog Tag fields.
3. Verify that the OPC item triggers failover:
a. Start the OPC servers and verify that the watchdog item is non-zero on at least one of the
servers. Start the interface.
b. Manually set the OPC item to 0 on the currently-connected server.
c. Examine the PI SDK log or check the Active Server point to determine whether the
interface failed over to the other OPC server.
Procedure
1. Create PI points and map them to the OPC items that you consider reliable indicators of OPC
server status. For each point, set location3 to 3 for polled points or 4 for advise points.
2. Using PI ICU, go to the OPCInt > Failover > Server Level page and set the Multiple Watchdog
Tags Trigger Sum field to the minimum acceptable total of the values of the watchdog
points.
3. Verify that failover is triggered if the total of the values drops below the specified minimum:
a. Start the OPC servers and the interface.
b. Manually set the values of the OPC items.
c. Examine the PI SDK log or check the Active Server point to determine whether the
interface failed over to the backup OPC server.
Procedure
1. In both OPC servers, create identical items that track the status of each server.
If an OPC server is active, the OPC item must contain a positive value. If an OPC server is
unable to serve data, the item value must be zero. Implement any logic required to ensure
that both servers correctly detect and maintain the status of the other server and that, in
both OPC servers, the values are identical.
2. Configure the OPC servers so that, during normal operation, one server sends data to PI
Interface for OPC DA and the other waits until the primary server fails.
Status for the primary server must be positive, and for the backup server, status can be
zero. If failover occurs, the primary server status must be set to zero and the backup server
status to a positive value.
3. In PI Data Archive, create a watchdog PI point for each OPC server, mapped to the OPC
items that track server status.
4. Using PI ICU, go to the OPCInt > Failover > Server Level page and set the Primary Server
Watchdog Tag and Backup Server Watchdog Tag fields to the names of the watchdog PI
points you created in the previous step.
In the interface batch startup file, these settings are specified by the wd1 and wd2
parameters.
Results
If both watchdog points are zero, data collection stops until one watchdog point becomes
positive. If both watchdog points are positive, the interface remains connected to the server
that is currently serving data to it.
Failover timing
When failover is triggered, PI Interface for OPC DA must quickly recognize that the current
OPC server is no longer available and determine whether the backup OPC server is available.
To configure failover efficiency in the PI ICU, you can adjust the following settings on the
OPCInt > Failover > Server Level page:
Buffering services
The PI System offers two services to implement buffering at interfaces:
• PI Buffer Subsystem (PIBufss)
• API Buffer Server (Bufserv)
PI Buffer Subsystem is the best option for most environments.
Use API Buffer Server only if one or more of the following conditions is true:
• The version of PI Data Archive receiving the buffered data is earlier than 3.4.375
• Your interfaces run on a non-Windows platform
If any of the above conditions apply to you, see the PI Buffering Manager Help (PIPC/HELP/
BufferManager.chm) documentation for PI Server. Otherwise, use PI Buffer Subsystem.
Buffering configuration
Use PI Interface Configuration Utility (PI ICU) to configure interface buffering.
The Tools > Buffering option helps you configure buffering. Depending on your current
configuration, this option does one of the following:
• If this computer is configured to buffer data using PI Buffer Subsystem 4.3 or later, the
Buffering Manager window opens and shows a buffering dashboard. The dashboard shows
information about the status of buffering on this computer.
• If this computer is not currently configured to buffer data, and PI Buffer Subsystem 4.3 or
later is installed, you are prompted to configure PI Buffer Subsystem. If you click Yes, the
Buffering Manager window opens and shows the installation wizard, which helps you
configure PI Buffer Subsystem.
• If this computer is configured to buffer data using API Buffer Server (Bufserv), and PI Buffer
Subsystem 4.3 or later is installed, you are prompted to convert to and configure PI Buffer
Subsystem. If you click Yes at both prompts, the Buffering Manager window opens and
shows the upgrade wizard, which helps you upgrade from API Buffer Server to PI Buffer
Subsystem.
• If PI Buffer Subsystem 4.3 is not yet installed, the Buffering window opens for API Buffering
or the earlier version of PI Buffer Subsystem.
For PI Buffer Subsystem 4.3, when configuring an interface to buffer data to a PI Data Archive
server which has not been added to the buffered server list you must enable buffering. Click
the Enable button in the Buffering Status box on the interface General page. To verify that the
buffering status is On, exit PI ICU, then restart and select the interface.
You can use Buffering Manager to configure, monitor, and troubleshoot buffering using PI
Buffer Subsystem. PI Buffer Subsystem is recommended for applications connecting to PI Data
Archive 3.4.375 or later. Older versions of PI Data Archive require API Buffer Server, as do
some sites with custom solutions. See Buffering Manager help (PIPC/HELP/
BufferManager.chm) for more information.
Enable buffering
Procedure
1. In PI ICU, choose Tools > Buffering. The Buffering window opens.
2. Click Enable buffering with PI Buffer Subsystem.
3. Start the buffering service. Click PI Buffer Subsystem Service, then click .
4. Verify that buffering starts successfully. Check the message log for messages that indicate
that the buffering application is connected to PI Data Archive.
5. Verify that buffering is working as intended. Reboot the interface node and confirm that the
interface service and the buffering application restart.
Procedure
1. Display the message log. Open PI System Management Tools and click Operation > Message
Logs.
2. Start the interface. Open PI ICU, navigate to the interface instance, and then click Interface >
Start Interactive.
PI ICU opens a command window and runs the startup batch (.bat) file. The interface logs
messages as it attempts to initialize and run.
3. Watch log for messages indicating success or errors.
4. To stop the interface, close the command window.
Timestamps
Interface Provides Timestamp: The OPC interface provides a time stamp when the data is
received (/ts=N).
OPC server Provides Timestamp: The OPC interface uses the data time stamps provided by the
OPC server and accounts for the offset between the OPC server and the PI Data Archive node (/
ts=Y).
Timestamp for Advise Tags Only: The OPC server provides time stamps only for advise tags,
and the interface accounts for the offset between the OPC server and the PI Data Archive node.
For all other tags, the interface provides a time stamp when the data is received (/ts=A).
OPC Server Provides Timestamp (no offset): The OPC server provides the time stamps for all
data, and the interface will not apply any time offset to these values. Data loss will occur if a
value is received from OPC with timestamp 10 minutes or more past current time of the PI
Data Archive node. (/ts=U).
Questionable Quality
Store Quality Only: If data has other than GOOD quality, store the quality information rather
than the value (/sq=Y).
Store Value Only: The interface treats “questionable” quality as “good” (/sq=I). Bad quality
data is stored as a system digital state.
specifications. In this case, e-mail details (including OPC server vendor and version) to
[email protected]. This flag is only meaningful for version 1.0a OPC DA. (/gl=N).
Update Rates
Specifies the requested update rate, if different from the scan period. Select a scan class from
the drop down list, enter the desired rate in the box to the right of the scan class, and click .
The scan class, scan rate, and update rate appear in the box below the period. Only scan classes
that have update rates are listed.
This option is useful when the server must have a recent value for the items but the interface
does not read it very often, for example, if PI Interface for OPC DA polls for the value every 30
minutes, but the value itself must be no more than one minute old. This situation imposes
more load on the OPC server than if the update rate and the scan period are the same, but it
can reduce latency of values for items that need to be read less frequently. (/ur=period).
Update Snapshot
If the current snapshot is a system digital state (such as I/O timeout, Shutdown, and so
forth) and the interface reads in a new value that is older than the snapshot, the interface
sends the new value one second after the snapshot time stamp of the system digital state. This
check is omitted if the current snapshot is a good value. This is useful for setpoints that rarely
change. (/us).
No Timeout
Direct PI Interface for OPC DA never to write I/O timeout errors, even if it loses its
connection with the OPC server. Set this when configuring failover. (/nt=Y).
Disable Callbacks
Reduce the load on the OPC server by disabling call backs for polled groups. By default, polled
groups have call backs enabled, but these call backs are not used by the interface. This option
has no effect on advise groups. (/dc).
Time Offset
If the OPC server node is set to a time zone other than the local time zone, this option directs
the interface to adjust all the time stamps by the specified amount. To specify the offset, use
the format [-]HH:MM:SS. (/to=offset).
Trend Advise
For advise PI points, send the value from the preceding scan if the new value's timestamp is
greater than the number of scan periods (configured by the ta parameter). Enabling this
setting causes advise tags to behave as if the step attribute is enabled.
• DEFAULT
• NONE
• CONNECT (default)
• CALL
• PKT
• PKT_INTEGRITY
• PKT_PRIVACY
• ANONYMOUS
• IDENTIFY (default)
• IMPERSONATE
• DELEGATE
Failover settings
UniInt-Interface Level Failover
The following three options are enabled only if warm failover is enabled on the UniInt >
Failover page:
• Maximum number of Watchdog Tags which can have Bad Quality or Any Error
without triggering Failover
Specify the maximum number of watchdog PI points that can have an error or bad quality
before failover is triggered failover. You can configure watchdog PI points to control
failover when the interface is unable to read some or all of the items, or when the items
have bad quality. This feature enables you to trigger failover when a data source loses the
connection to one OPC server, but is able to serve data to the other. To configure watchdog
PI points, set location3. For a watchdog point that is in an advise group, set location3 to
4. For a watchdog point that is in a polled group, set location3 to 3. (/uwq).
Setting Description
Cluster Mode Configure behavior of the backup interface.
Primary Bias: This node is the preferred
primary. (/cm=0).
No Bias: No node is preferred. The active PI OPC
interface stays active until the cluster resource
fails over, either as the result of a failure or
through human intervention. (/cm=1).
Resource Number for APIOnline Identify the apionline instance that goes with this
interface instance. For example, to configure the
interface to depend on an instance named
apionline2, set this field to 2. To configure the
interface to depend on an instance named
apionline (no resource number), set this field to
-1. (/rn=#).
Active Interface Node Tag Specify the string point that contains the name of
the currently active OPC interface node. (/cn).
Health Tag ID This parameter is used to filter UniInt health
points by location3. The parameter must be
unique for each interface – failover member
parameter. If this parameter has an invalid value
or is not set, the default value of 0 is used for the
location3 attribute when creating UniInt health
points. (/uht_id).
Setting Description
Maximum number of Watchdog Tags which can Default=0 if only one watchdog point. Cannot
have Bad Quality or Any Error without triggering exceed the number of watchdog points defined.
Failover (/wq=#).
Failover if Server Leaves RUNNING State Triggers failover if the server state changes to
anything other than RUNNING.(/ws=1).
Plug-In settings
• Post-Processing DLL
Enter the DLL name and path to the post-processing DLL, for example, /DLL=”
\Interfaces\OPCInt\plug-ins\exampledll.dll”
Miscellaneous settings
Caution:
Do not modify these settings unless directed to do so by OSIsoft Technical Support.
Debug settings
To enable debugging options using PI ICU, go to the UniInt > Debug tab. In general, enable
debug options for a short period of time, as they can bloat log files and reduce performance.
For options marked "Technical Support only," enable only at the direction of OSIsoft Technical
Support. For details about other command-line parameters, refer to the PI Universal Interface
(UniInt) User Guide.
Option Description Value
Internal Testing Only For OSIsoft internal testing only. /db=1
Log of Startup Logs startup information for /db=2
each PI point, including
instrumenttag and exdesc
Log Write Op’s and Acks for Tag Logs PI Interface for OPC DA /db=4
writes, ACKs from the OPC
server, and writes queued to the
“pending write” queue. Can be
configured to log values sent for
a specific point if the Debug Tag
field is specified.
Enter any additional parameters that are not available through PI ICU, (for example, /
dbuniint=0x0400). Separate parameters with one or more spaces. If a parameter argument
contains embedded spaces, enclose the argument in double quotes.
Time stamp for Advise Tags For polled reads, some OPC servers For advise data, difference
Only return the time that the value last between PI Data Archive node
changed rather than the time of the and OPC server node. For all
(/TS=A)
read. This option configures the other data, difference between
interface to use the advise time PI Data Archive node and
stamps but provides time stamps for interface node.
the polled values. For more details
about advise and polled points, see
Input points for PI Interface for OPC
DA.
OPC Server Provides The interface uses the UTC None.
Timestamp, no Offset timestamp provided by the OPC
server and does not apply any offset
(/ts=U)
to the time stamps.
Caution:
Use this setting with extreme
caution, as data loss occurs if
the OPC server sends a value
with a timestamp that is 10
minutes or more later than the
current time of PI Data
Archive.
For details about reading and writing time stamps from a PI point when the time stamp is the
value of the point, see Time stamp adjustments.
Parameters by function
The parameters are grouped by how they are used, and are specific to PI Interface for OPC DA,
except for the UniInt parameters that are common to all OSIsoft UniInt-based interfaces.
Parameters are not case-sensitive.
/F /DC /HOST
/MA /TF
/OC /TO
/OD /UR
/OG /US
/OT
/OUTPUTACKTIME
/OUTPUTSNAPTIME
/OW
/RD
/SD
/DT
/WD /RP
/WD1 /RT
/WD2
/WQ
/WS
/TS /SEC
/VN /ST
Procedure
1. Open PI OPC Client Tool in one of two ways:
◦ Locate and double-click the OPCClient.exe executable file.
◦ From the Windows Start menu, click All Programs > PI System > PI OPCClient.
Item browsing
To be able to map PI points to OPC items, you must have access to OPC item names. However,
OPC servers are not required to support item browsing. If browsing is supported, you can use
the PI OPC Client tool to display the points that the OPC server recognizes.
• Send the time stamp for the last time that the data value and quality were read from the
device. In this case, the time stamp changes even if the value does not.
• Send the time stamp of the last change to the data value or quality. In this case, if the data
remains the same, the time stamp does not change.
You must set the way time stamps are recorded by configuring the time stamp (ts)
parameter using PI ICU.
Unreliable values
Some OPC servers return a value when a client connects to a point, even if the server does not
yet have a valid value for the point. Some servers send an unreliable value with a status of
GOOD, which results in this value being sent to PI Data Archive.
To screen out these unreliable values, use PI ICU to enable the Ignore First Value option on the
Data Handling page (/if=Y).
Access path
In OPC items, the access path suggests how the server can access the data. The OPC standard
states that it is valid for servers to require path information to access a value, but not for them
to require that it be sent in the access path field. According to the standard, the OPC server can
ignore it, but some non-compliant OPC servers require the access path.
For example, RSLinx requires path information in the access path or as part of the ItemID, in
the following format: [accesspath]itemid.
If your OPC server requires an access path, contact your OPC server vendor to determine how
best to configure the server with PI Interface for OPC DA.
The following error messages indicate that the data received from the OPC server contained
errors and the OPC server did not return a text explanation of the error:
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)
In UnPack2 Tag MyPV6.pv returns error E2412029: Unknown error (e2412029)
To troubleshoot such data-related issues, 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 error message. OPC servers can generate vendor-specific error
codes, and only the OPC server vendor can explain what they mean.
• Restarting the OPC server might resolve the issue.
• Type mismatch errors indicate incompatible data types. Check for a mismatch between
the PI Data Archive data type and the OPC item type. Check location2 settings. To avoid
cache issues after data types are changed, restart the interface.
• Verify that the data type of the PI point can accommodate the range of values being sent by
the OPC server. For example, if a PI point is defined as a two-byte integer and the OPC
server sends values that are too large for it to accommodate, the point overflows.
• Make sure the data type of the OPC item and PI point are compatible.
• The data source might be sending corrupt data to the OPC server. Check for network issues
that might corrupt the data packets.
• Check the size of the OPC server group. If the scan class contains more points than
permitted in the OPC server group, Unpack2 errors might result. Consult the OPC server
documentation for group size limits.
• If the point is digital, and the data can be read into a string PI point, and the underlying
control system is Honeywell, the digital state strings in PI Data Archive might need to
exactly match the string reported by the DCS. To determine the digital states, go to
Honeywell Universal Station or GUS to look at each controller block (data source).
• PI thread
Interacts with PI Data Archive.
• COM thread
Interacts with the OPC server.
Polled PI points
For polled PI points, the interface notifies the PI thread when it’s time to scan. The PI thread
starts the data collection process and logs the time, group number, and current flag value in
opcscan.log, then sets the flag. (If the flag in opcscan.log is non-zero, the last call made to
the server did not return before the interface initiated another poll, and data might have been
missed as a result.)
When the COM thread detects that the flag is set, it logs the time, group number and
transaction ID in the opcrefresh.log file and makes a refresh call to the OPC server. When it
receives the synchronous response from the OPC server, it clears the flag.
Now the OPC server can send data at any time, in an asynchronous manner. When the OPC
server sends data to the interface COM thread, the time, group number and transaction ID are
logged in opcresponse.log.
Advise PI points
For advise PI points, the COM thread receives callbacks only when the data from OPC server
changes value. Therefore, advise points do not generate entries in the opcscan.log or
opcrefresh.log files, and only the data callbacks are logged in the opcresponse.log file.
Advise points can be identified in the opcresponse.log file by group numbers that range
from 200 to 800.
OPC refreshes
Logging refreshes
To log OPC refreshes, enable debug option 8, which causes PI Interface for OPC DA to create
three log files: opcscan.log, opcrefresh.log, and opcresponse.log. If the interface is
running as a service, the files are located in the %windows%/system32 directory (%windows%/
sysWOW64 for 64-bit systems). Otherwise, the files reside in the working directory for the
interface process. The working directory does not need to be the same as the directory
containing the .exe file.
When the interface sets the flag for a scan, it logs the current time, the number of the scan
class, and the current value of the scan flag in the opcscan.log file. The time stamp is in UTC
(Greenwich time zone, daylight savings time is not observed), structured as a FILETIME
structure written as an 64-bit hexadecimal field. 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 sets the scan flag for the group, then the COM thread takes
its turn. When the interface cycles around to perform the poll, it logs the time, the scan class,
and the TransID used in the opcrefresh.log file. For v1.0a server, the TransID logged is the
TransID that was returned from the last poll of the group. For v2.0 servers, it is the actual
TransID returned from the server.
When the interface receives data from the OPC server, it logs the time, the scan class, and the
TransID received in the opcresponse.log file. For advise points, no entries are logged in the
opcrefresh.log and opcscan.log files. Only the opcresponse.log file is updated.
Time stamps in PI Interface for OPC DA logs are stored in their native format, which is hard to
read. To translate the time stamps to a readily readable format, use the following programs,
which are installed into the Tools sub-directory below the interface directory:
• opcscan.exe
• opcrefresh.exe
• opcresponse.exe
To run one of these programs from the command line, specify the input and output file names.
Examples:
> opcscan.exe opcscan.log scan.log
> opcrefresh c:\pipc\Interfaces\OPCInt\opcrefresh.log c:\temp\refresh.log
> tools\opcresponse opcresponse.log response.log
The utilities display the UTC time stamp that came with the data, both raw and translated, the
time stamp translated into local time, both raw and translated, and the PI time sent to PI Data
Archive. For example:
response.log 126054824424850000 2000/06/14 18:54:02.485 126054680424850000
2000/06/14 14:54:02.485 960994309.485001 2 1db8
To check the time stamp returned from the OPC server, consult these log files. The time stamp
is based on 1 January 1600 UTC, so if you see a date around 1600, it indicates that the server is
not sending valid time stamps. To configure the interface to create time stamps when it gets
the data, use PI ICU to enable the Interface Provides Timestamp option on the OPCInt page (or
edit the batch file and specify the /ts=N parameter).
If the interface is running with debugging options 32 or 64 enabled, the log file contains entries
for individual data items that were received by the COM thread. For advise points, the group
number in the opcresponse.log file might not be correct for entries generated by debugging
options 32 or 64, although the shorter entries generated by debugging option 8 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. If the flag in opcscan.log is non- zero, the last call made to the
server did not return by the time the interface started another poll. If you find non-zero flags in
the log file, contact your server vendor and have them contact OSIsoft.
This message indicates that the OPC server failed to respond to a refresh call. This problem
occurs when the OPC server cannot keep up with the update rates or has suspended operation
due to a bug. The message is repeated for each additional 100 refresh calls that receive
responses from the OPC server for each scan class. If these messages appear in your local PI
Message Log, data loss might be occurring. Contact your OPC server vendor immediately, and
consider the following adjustments to reduce load on the OPC server:
• Move points into the Advise scan class 1.
• Reduce the total number of scan classes for the interface.
Logging
PI Interface for OPC DA logs messages about its operation in the local PI Message Log file.
The following information is logged:
• Startup and shutdown status messages
• The scan rate configured for each scan class and the actual update rate provided by the OPC
server
• The number of PI points in each scan class, output points, and advise and event tags
• Misconfigured points
• Points rejected by the OPC server (and other error messages from the OPC server)
• OPC server connection attempts and results, including loss of connectivity
Messages
The log contains messages from PI Interface for OPC DA, the UniInt framework, and the PI API.
This list describes only messages from the interface. If any error message has a PI point
number as well as a point name, use the point number to identify the problem point, because
long point names are truncated to 12 characters.
Informational
Message No ConnectionPoint for OPCShutdown
Shutdown Advise Failed
Meaning The OPC server does not implement the Shutdown
interface or does not implement it properly. Does
not prevent proper operation of the interface.
Message QueryInterface:IID_IconnectionPointCont
ainer failed, using v1.0a protocol
Meaning The OPC server does not support OPC DA v2.0.
Errors
Message Out of Memory.
Cannot allocate a list; fails.
Unable to add tag.
Message CLSIDFromProgID
Cause OPC Server Registry entries are not valid.
Resolution Check your server installation instructions.
Message CoCreateInstanceEx
Cause Indicates a problem with your DCOM
configuration.
Resolution Check your DCOM settings.
Message IOPCServer
Cause The proxy stub files are not registered.
Resolution To register the opcproxy.dll and
opccomn_ps.dll files, you must use an
administrator account. Open a command prompt
window, change to the directory where the DLLs
are installed, and issue the following commands:
>regsvr32 opcproxy.dll
>regsvr32 opccomn_ps.dll
Message AddRef
Cause Indicates that the OPC server does not let the
interface perform the simplest function.
Resolution If you can read and write points using PI OPCClient
but this error is logged, check your DCOM settings,
check what user account the interface is running
under, and try running the interface interactively.
Message GetStatus
Cause The OPC server did not respond to a status query.
It might be down or disconnected.
Resolution Use PI OPCClient to check the status.
Critical errors
Message Error from CoInitialize:
Error from CoInitializeSecurity:
Meaning While in this state, the interface sends data to PI Data Archive as it is received. This
message also states that the other copy of the interface appears to be ready to take
over the role of primary.
Errors (Phase 1)
Message 17-May-06 09:06:03 OPCInt 1> UniInt failover: Interface in an
“Error” state. Could not read failover control points.
Cause The failover control points on the data source are returning an erroneous value to
the interface. This error can be caused by creating a non-initialized control point on
the data source. This message will only be received if the interface is configured to
be synchronized through the data source (Phase 1).
Resolution Check validity of the value of the control points on the data source.
Message 17-May-06 09:05:39 OPCInt 1> Error reading Active ID point from
Data source Active_IN (Point 29600) status = -255
Cause The Active ID point value on the data source caused an error when read by the
interface. The value read from the data source must be valid. Upon receiving this
error, the interface enters the “Backup in Error state.”
Resolution Check validity of the value of the Active ID point on the data source.
Message 17-May-06 09:06:03 OPCInt 1> Error reading the value for the
other copy’s Heartbeat point from Data source HB2_IN (Point
29604) status = -255
Cause The heartbeat point value on the data source caused an error when read by the
interface. The value read from the data source must be valid. Upon receiving this
error, the interface enters the “Backup in Error state.”
Resolution Check validity of the value of the heartbeat point on the data source
Message Sun Jun 29 17:18:51 2008 PI Eight Track 1 2> WARNING> Failover
Warning: Error = 64 Unable to open Failover Control File ‘\
\georgiaking\GeorgiaKingStorage\Eight\PIEightTrack_eight_1.dat’
The interface will not be able to change state if PI is not
available
Cause The interface is unable to open the failover synchronization file. The interface
failover continues to operate correctly if communication to PI Data Archive is not
interrupted. If communication to PI Data Archive is interrupted while one or both
interfaces cannot access the synchronization file, the interfaces remain in the state
they were in at the time of the second failure: the primary interface remains
primary and the backup interface remains backup.
Resolution Ensure the account that the interface is running under has read and write
permissions for the directory. Set the access control list on the directory to read/
write/create access to the account that runs the interface.