OLE For Process Control RTD Interface
OLE For Process Control RTD Interface
Release Information
Uniformance PHD
Revision 4
Revision Date: June 8, 2004
Document Number: RDI-320.4
ii • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Contents
Contents
Introducing the OPC RDI 5
RDI Description 5
Tag Capacity Limitations 5
Concurrent Interface Limitations 6
Data Throughput and Constraints 6
Required Support Files 6
Installation Checklist 9
Running RDI_Services 19
Modifying parameters after running RDI_Services -
Interfaces_CustomConfig.Dat 21
Interpreting GO File Options 22
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • iii
Contents
Troubleshooting 33
Common problems 33
RDI Status 34
Problem Diagnosis 34
Glossary 35
Index 37
iv • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Introducing the OPC RDI
RDI Description
You can run the OPC (OLE for Process Control) RDI (Real-time Data Interface) in
polled or exception mode. The OPC RDI supports the following:
• Poll mode and Exception mode for reading single values,
• Exception mode for reading element values of an array, and
• Puts (downloads) for single values (puts are NOT supported for elements of an
array).
The OPC RDI returns most data types from an OPC Server. The client application
tells the OPC server the data type that the client wishes to receive. The OPC server
allows items to be a single value or an array of values. If the item contains an array
of values, the OPC RDI collects each element of the array into one PHD tag. The
OPC RDI supports only one-dimensional arrays.
The OPC RDI supports the following OPC standards:
• DA1.0a
• DA2.04
• DA3.0
• HDA 1.1 (for history recovery)
The OPC RDI defaults to DA3.0. If the OPC Server is not DA3.0 capable, then the
RDI attempts to use DA2.04 calls to the OPC Server.
If DA1.0a is needed, you must specify the /F option in the RDI configuration to force
the RDI to use DA1.0a access.
If DA2.04 is needed, you can specify the /X2 option in the RDI configuration to force
the RDI to use DA2.04 access.
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 5
Introducing the OPC RDI
There is nothing in the OPC RDI client software that prevents multiple interfaces to a
single OPC Server. If the OPC Server supports more than one connection, you can
set multiple interfaces to a single OPC.
The data throughput and constraints vary significantly. Refer to the OPC Server
documentation on the throughput of the OPC Server.
6 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Introducing the OPC RDI
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 7
Introducing the OPC RDI
8 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Installing the OPC RDI
Installation Prerequisites
Verify that the following prerequisites have been completed before continuing to the
RDI installation procedures:
• Compatible version of the OPC Server is installed and operative.
• The network hardware is in place and operative that connects the OPC Server
node and the PHD Server.
• The appropriate PHD Server release is installed, configured, and running.
The PHD patch has been installed, if applicable.
• The OPC Server node is reachable by TCP/IP communication from the PHD
Server.
• The TotalPlant Information (TPI) application is installed on the machine you
plan to use to enter Oracle data and configure tags for the new RDI
Installation Checklist
Task Go to ! Notes
In TPI, modify the Tag Source This guide – section Defining If parameters to be historized
Configuration form, if Source System Tag Attributes by PHD are not specified in
necessary. and Data Types the standard list (such as
parameters with larger fields),
then you must add them to
this form.
In TPI, complete the RDI This guide – section Completing Add parameters to the form, if
Parameter Configuration form, the RDI Parameter Configuration necessary.
if necessary Form
In TPI, complete the RDI This guide – section Completing Add the Update Frequency
Specification form. the RDI Specification Form parameter to the OPC source
system.
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 9
Installing the OPC RDI
Task Go to ! Notes
Verify that the RDI type is This guide – section Verifying The OPC RDI type should be
present in the file RDI Type (RDI_intrf_params.Dat) present in the file, along with
RDI_intrf_params.Dat. its default RDI parameter
values. No action should be
required.
Modify the PHDParams.Dat This guide – section Increasing MAX_TAGS and
file, if necessary, to ensure that Maximum Tags MAX_TAGNO
tags to be built against the new (PHDParams.Dat)
RDI will not exceed the
specified maximum.
4. Create RDI
If appropriate, add the This guide – section Setting the Enable this option if you want
NewPolledModeStamping Polled Mode Stamping Option the RDI to defer its next scan
parameter to the registry for if it falls behind, instead of
the new RDI. starting it immediately after
the current scan.
If appropriate, add the • This guide – section Enable this option if you want
RunConditionMode parameter the RDIServer to generate
to the registry for the new RDI. • Setting the Exception exception data for a group of
Condition Option real-time tags associated with
• Exception Condition Interface this RDI, by polling them only
User Guide when data is required.
If appropriate, add the This guide – section Setting the Enable this option if you want
RDIDependency parameter to RDI Startup Option to startup RDIs in dependency
the registry for the new RDI. order.
In TPI, configure PHD tags. This guide - section Configuring TPI>Process History>Tag
PHD Tags Configuration form
10 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Installing the OPC RDI
The RDI is designed to take advantage of the OPC Foundation's OPCENUM service
in order to connect to a remote OPC Server without having to install the OPC Server
vendor’s client. If the OPC Server is a DA 1.0a, then it will probably NOT have the
OPCENUM service installed. In this case, the OPC Vendor’s client must be installed
or the OPCENUM service can be installed on the OPC Server.
4 In an empty record at the bottom of the form, add the information for
additional parameter(s), as necessary.
REFERENCE: For definitions of the PHD data types, refer to PHD System Manual,
section Understanding the Tag Source Definitions.
1 In the TPI application, under Process History, open the form RDI Parameter
Configuration.
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 11
Installing the OPC RDI
Validation Text The validation to apply when a value is entered in the RDI
Specification form.
You may choose to add any of the following options to the RDI Parameter
Configuration form, and then they will be available on the RDI Specification form.
12 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Installing the OPC RDI
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 13
Installing the OPC RDI
1 In the TPI application, under Process History, open the form RDI Specification.
Note:
For a local RDI:
The parameter Names appearing in the RDI Parameter Configuration form for an
OPC source system will populate the RDI Specification form after you select OPC
as the source system. You will use the RDI Specification form to configure the
new OPC RDI.
For a remote RDI:
You will use the RDI Specification form for a GATEWAY source system to
configure the new remote RDI. The required OPC RDI parameters (such as
GROUPSCANRATE) are represented in the RDI Specification form for a
GATEWAY source system as RDIPARAMETER1-RDIPARAMETER6. You will
use RDIPARAMETER1-RDIPARAMETER6 to enter the appropriate values for the
parameters for a remote OPC RDI.
14 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Installing the OPC RDI
Field Description
Enabled Select whether the interface is enabled. If this flag is not
set, the RDI_Services program does not process this
interface.
Source System If local RDI, select OPC.
If remote or remote peer RDI, select GATEWAY.
This specifies the program name and the parameters
required for the interface.
Remote Interface? Not used on R200 PHD.
Remote Connect String Not used on R200 PHD.
Required? This field shows a value is required for the parameter. The
value in this field is a read-only attribute of the Name field.
• You will need to specify the values for the following parameters (such as OPC SERVER)
through the names RDIPARAMETER1 - RDIPARAMETERn.
For a Remote Peer RDI, additional parameters are described in the Remote Peer RDI
Installation Guide.
*OPC SERVER OPC HDA server name (PROGID) of the OPC Server. For
more information, refer to section "OPC Server Name."
*MACHINE NAME Hostname or IP address of the machine running the OPC
Server. Defaults to local hostname. If the OPC Server is
on the same machine as the OPC RDI, you may leave this
value blank (null string).
SCANTIME /S /S Causes the RDI to retrieve the timestamp from
the OPC Server; otherwise, the RDI generates a
timestamp after collecting the value.
POLL /P /P causes the RDI to run in poll mode (OPC Read
Synchronous); otherwise, it runs in exception
mode (OPC Read Asynchronous).
DEVICEREAD /RC /RC forces use of Cache reads.
/RD /RD forces use of Device reads (Polled mode
reads) instead of Cache reads. This is the default
mode.
NOINITTAG /I /I disables the insertion of a 0 value with a -1
confidence when the RDI is started, shutdown, or
every 24 hours when the RDI resynchronizes its
time with the OPC Server. Default is disabled.
MAXITEMS /M /M<number> limits the number of items in an OPC
group, where <number> is the maximum number
of items. (Make sure there are no spaces between
the /M and the number). Some OPC servers have
a maximum number of items per group.
Default is 250.
/M0 = Unlimited group size
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 15
Installing the OPC RDI
Field Description
16 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Installing the OPC RDI
Field Description
HKEY_CLASSES_ROOT\Hci.TPNServer\CLSID = {ADF6AEBB-B0F1-11d0-8A01-00C04FC97D9D}
HKEY_CLASSES_ROOT\Hci.TPNServer\OPC
If the PROGID will be used, the OPC Server name to be used is “Hci.TPNServer”.
If the CLSID will be used, the OPC Server name to be used is
“{ADF6AEBB-B0F1-11d0-8A01-00C04FC97D9D}”.
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 17
Installing the OPC RDI
The following table defines the fields of each line in the file.
18 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Installing the OPC RDI
Step Action
4 If you modified the above parameters, then you need to Stop and Cold Start the
PHD Server in order to resize its global memory sections.
To restart the PHD Server, execute the following commands at a command
prompt:
PHDCTL STOP
PHDCTL START COLD
Running RDI_Services
Perform the following steps to run the RDI_Services interface configuration program,
which creates the files for a particular RDI.
Attention: Make sure you did NOT delete "127.0.0.1 localhost" from the Hosts file
on the PHD Server (Windows\system32\drivers\etc). The RDI_Services program
uses this entry (which was created when Windows was installed). If deleted,
RDI_Services and the RUNRDI utility will not function properly.
Note: The following steps must be performed on the PHD Server machine. You
must be logged on to the operating system as a user that is member of
PHD_MANAGER and Administrators groups.
Step Action
2 Open the backup copy of the Interfaces.dat file and keep it available on the
screen to reference.
4 If new RDI's have been previously created in error, for each RDI execute the
following at a Command prompt:
PHDMAN SHUT INT <RDI Name>
ATTENTION:
RDI_Services attempts to copy new dlls for every RDI configured for this node. If
you choose to leave existing RDIs running on this node, then when RDI_Services
attempts to copy the dll for a running RDI, the copy fails and an error message is
output.
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 19
Installing the OPC RDI
Step Action
5 At a command prompt on the PHD Server where the interface is to run, execute
the following command from the <install directory>:
RDI_SERVICES <Oracle user/password@database instance> <DB provider>
• Substitute your system's user name, password and database name. You may
use PHD_READONLY user/password as it exists by default in the database
and has access that is sufficient for rdi_services.
• Specify either OraOLEDB.Oracle or MSDAORA as the DB provider.
7 Verify that RDI_Services accomplished the following for the new RDI:
• Created a GO_<rdiname>.CMD file.
• Rewrote the Interfaces.Dat file to add commands that define the new RDI.
• Rewrote the Start_Interfaces.Dat file to add commands for starting the new
RDI.
• Copied DLL for interface type as RDI<rdiname>.DLL to the RDI directory.
20 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Installing the OPC RDI
To modify the value of any of the prompted parameters after running RDI_Services,
you may add Set commands to the file Interfaces_CustomConfig.Dat, instead of re-
running RDI_Services:
SET <rdiname>:<parametername> <value>
The file is executed automatically upon system startup, after automatic execution of
Interfaces.Dat. You may execute the file manually through PHDMAN.
Note: The above parameters are dynamic and therefore can be changed while the
PHD Server is running; however, if you change parameters for a running RDI, you
may have to restart the RDI for the changes to affect the RDI.
REFERENCE: For additional information on setting RDI parameters, refer to the
section "Set Interface Parameters." in the PHDMAN User Guide.
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 21
Installing the OPC RDI
–P<port number> (Optional) RDI_Services does not define this parameter. If this
parameter is needed, it must be entered manually into the GO
file. If the PHD Server has more than one RDIServer, then this
parameter represents the port number of the RDIServer to which
this RDI is associated.
-oRDI<rdiname>.OUT Specifies the file in the LOG FILES directory where the RDI
outputs information.
Where <rdiname>is the interface instance name as specified in
the RDI Specification form.
RDI<dllname> Present, but not actually used in PHD R2xx.
<rdiname> The interface instance name as specified in the RDI Name field
of the RDI Specification form.
(Optional) The following parameters must follow the first two required parameters, but may
be in any order.
XCOND_NOSYNCH Refer to Table 3 – RDI Specification Form – OPC
/C
/F
/G#
/H<OPC server
name>
/i
/K<keyvalue>
/L<filename>
/M<#>
/P
/RC
/RD
/S
/V
/XC Refer to Table 2 – Additional Command Line Options – OPC
/XI
/XL
22 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Installing the OPC RDI
Parameter Description
/XN
/XR
/XS
/X2
1 On the PHD Server, open a command prompt and change directories to the
<install directory>phdserver\ntsite, and then enter the following command:
PHDMAN EXECUTE Interfaces.Dat
Note: Alternatively, you can use the PHDMAN shortcut on the desktop,
which defaults to the path of the ntsite directory.
3 Enter the following command to set any RDI modifications you entered into
the Interfaces_CustomConfig.Dat file, if any:
PHDMAN EXECUTE Interfaces_CustomConfig.Dat
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 23
Installing the OPC RDI
a) Right-click>New>DWORD Value.
a) Right-click NewPolledModeStamping>Modify.
24 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Installing the OPC RDI
A registry entry (RDIDependency) can be added to enable the option that starts RDI's
in dependency order. When a request is made to start all RDIs (Start Int *), the
startup of any RDI can be delayed until other RDIs, upon which it is dependent, are
started.
For each RDI, you can specify one or more RDIs on which it is dependent.
Tag Routing is an example of an RDI function for which RDI startup dependency
may be a concern.
If needed, perform the following steps to add/configure the parameter in the registry:
Step Action
d) On separate lines, enter the name of each RDI upon which this RDI
is dependent.
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 25
Installing the OPC RDI
Step Action
e) Click OK.
Windows 2000:
d) Click OK.
e) On separate lines, enter the name of each RDI upon which this RDI
is dependent.
f) Click OK.
26 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Configuring PHD Tags
Note: If tags are already built, but are not yet associated with the RDI, enter the RDI
assignment for the tags, and then enter the following command to cause PHD to re-
query Oracle for the tags: PHDMAN UPDATE TAG FULL
ATTENTION: Executing UPDATE TAG FULL may result in a gap in data
collection.
After the interface is defined and started, perform the following steps to configure
PHD tags for the RDI through TPI.
Step Action
1 In the TPI application, under Process History, open the form Tag
Configuration.
3 Verify that the new RDI collects tag values by entering the following
command at a command prompt or through the PHDMAN shortcut on the
desktop.
PHDMAN MON QUE <Tag name>
The OPC interface uses PHD tag fields as described in the following table.
Field Description
• 45,shorttag.pv
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 27
Configuring PHD Tags
Field Description
Source tagtype OPC Data type (See the section "OPC Source Tag Types")
Source attribute This field must be equal to VALUE, VALUExx, ARRAY or ARRAYxx
Where xx is the number of characters in the ASCII string to be
collected.
VALUE or VALUExx causes the RDI to convert the value associated to
the OPC item into the appropriate PHD tag value.
ARRAY or ARRAYxx causes the RDI to convert an element of the
array associated to the OPC item into the appropriate PHD tag value.
− Source Indexb will specify the element to be saved.
• -3 PHD Tag Value is the Array Lower Bounds (tagtype must be I4)
28 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Configuring PHD Tags
The PHD source tagtype field indicates the OPC data type requested and how this tag
stores the requested value in PHD. The following table shows the PHD tag settings
required to collect the OPC data types that can be translated to OPC RDI data types.
Note: Other OPC data types can be collected, but they will be converted into one of
the OPC data types listed in the table below.
Source Source PHD tag OPC data type Input Output
tagtype attribute datatype from to
OPC OPC
Server Server
F4 VALUE F VT_R4 ! !
D8 VALUE D VT_R8 ! !
I4 VALUE I VT_I4 ! !
L8 VALUE L VT_CY ! !
AS VALUE C VT_BSTR ! !
AS VALUE80 C VT_BSTR ! !
US VALUE U VT_BSTR ! !
US VALUE80 U VT_BSTR ! !
BO VALUE I VT_BOOL ! !
TI VALUE I VT_DATE ! !
TD VALUE I, L, F, or D VT_DATE ! !
TL VALUE L VT_DATE ! !
F4 ARRAY F VT_R4 | VT_ARRAY !
D8 ARRAY D VT_R8 | VT_ARRAY !
I4 ARRAY I VT_I4 | VT_ARRAY !
L8 ARRAY L VT_CY | VT_ARRAY !
AS ARRAY C VT_BSTR | VT_ARRAY !
AS ARRAY80 C VT_BSTR | VT_ARRAY !
US ARRAY U VT_BSTR | VT_ARRAY !
US ARRAY80 U VT_BSTR | VT_ARRAY !
BO ARRAY I VT_BOOL | VT_ARRAY !
TI ARRAY I VT_DATE | VT_ARRAY !
TD ARRAY D VT_DATE | VT_ARRAY !
TL ARRAY L VT_DATE | VT_ARRAY !
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 29
Configuring PHD Tags
Note: Time data type is stored as an integer value as the number of seconds since
midnight of January 1, 1970, with the time based on UTC.
• TD – Date
Note: Date data type is stored as a double value as the number of days since
midnight of January 1, 1900, similar to date formats used in Excel.
Tag type Format
30 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Configuring PHD Tags
VT_R4 F4 F
VT_R8 D8 D
VT_I1 I4 I
VT_I2 I4 I
VT_I4 I4 I
VT_I8 L8 L
VT_UI1 I4 I
VT_UI2 I4 I
VT_UI4 I4 I
VT_UI8 L8 L
VT_CY L8 L
VT_INT I4 I
VT_DATE I4 I
VT_DATE D8 D
VT_UINT I4 I
VT_BSTR AS C
VT_BSTR US U
VT_BOOL BO I
If the OPC Data canonical (native) data type does not translate into one of the Source
Tag Types directly, the OPC RDI will use standard operating system conversion
routines to convert the OPC value into one of the VARIANT data types that can be
translated into a Source Tag Type. For example: A variant of VT_R8 will be
converted to a VT_I4 if the Source Tag Type requested is I4.
VARIANTS return any of its known data types as an array of values. The OPC RDI
stores the individual elements of the array. The translation of the element values is
the same as the table described above. The OPC RDI collects the dimension, size
and lower bounds of the array. When collecting these values, the Source Tag Type
must be I4. The dimension of the array must be collected to collect any other value
associated with the array.
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 31
Configuring PHD Tags
32 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Troubleshooting
Common problems
The following problems may occur:
• The startup parameters from PHD are incorrectly defined.
• The interface has not been defined to PHD (or incorrectly defined).
• The name of the OPC server is incorrect.
• RDI stuck in INIT/INACTIVE state.
− Attempting to start an RDI when the RDI Server is not running will result in
the RDI being stuck in the Init/Inactive state.
− If this occurs, it is necessary to restart the RDI Server, and then Kill the RDI
before issuing the Start command again.
REFERENCE: For further problem diagnosis, refer to the Uniformance PHD -
Process History Database System Manual or refer to the OPC Server documentation.
DA or HDA BAD –1
interfaces
UNCERTAIN 0
GOOD 100
OPC RDI If the PHD And OPC Then the RDI downloads
Confidence is… Quality is… this value…
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 33
Troubleshooting
RDI Status
Retrieval Tag RDI Status
Problem Diagnosis
In many cases, looking at the RDI log file can be very useful. The log file gives
information about the following:
• Initialization of tags, poll groups, and errors during these actions
• Outgoing and incoming data packages
The RDI log file can be found in <install directory>\PHDServer\Log Files.
For further problem diagnosis, refer to the PHD system log files.
34 • Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide
Glossary
OPC
OLE for Process Control (OPC) is a standard developed to communicate with
numerous data sources related to the process control industry.
RDI
PHD Real-time Data Interface. One RDI is used for each type of DCS, PLC,
SCADA, and other real-time sources of data that are included in PHD.
Source System
The source system is the system that provides the real-time data to the PHD systems.
This can be another PHD system, or a DCS system.
Tag
A distinct value residing in the source system and collected by an RDI.
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 35
Glossary
36 • Glossary Uniformance PHD - OLE for Process Control RDI Installaation Guide
four byte float data type 30
four byte integer data type 30
Index I
I4. See four byte integer.
implementing OPC RDI 5
installing the interface 9–34
A
included files list 6
architecture troubleshooting 33
understanding 8 Integer 30
AS. See ASCII data type. interface installation
ASCII data type 30 included files list 6
attribute mapping interface, installing 9–34
understanding 29 introducing
OLE for Process Control RDI 5–8
B items, using instead of tags 8
BO. See Boolean (logical) data type.. See Boolean
(logical) data type. O
Boolean (logical) data type 30
OLE for Process Control RDI
architecture 8
C
implementing 5
configuration forms installing the interface 9–34
Tag Source Configuration 11 introducing 5–8
providing common communications 8
D using DCOM technology 8
data types OPC. See OLE for Process Control.
AS or ASCII 30 open technology in OLE for Process Control RDI
BO or Boolean (logical) 30 8
F4 or four byte float 30
P
I4 or four byte integer 30
requesting specific types 29 PHD tag definitions
TI or time 30 tag source type/attribute mapping 29
US or Unicode 30 polled values, reporting 8
process control systems
E the architecture 8
exception values
T
reporting 8
Tag Source Configuration
F configuration forms 11
F4. See four byte float.. See four byte float. tag source type/attribute mapping: 29
Uniformance PHD OLE for Process Control Real-Time Data Interface Installation Guide • 37
Index
tags
defining as items 8
TI. See time data type.
time data type 30
U
Unicode data type 30
US. See Unicode data type.
V
values
reporting 8
38 • Uniformance PHD - OLE for Process Control Real-Time Data Interface Functional Specification