Uniint End User - OSIsoft



Generic Plug-In DLL

for OPC

Interface to the PI System

Version 1.01 - 1.03

How to Contact Us

|Phone |(510) 297-5800 (main number) |

| |(510) 297-5828 (technical support) |

|Fax |(510) 357-8136 |

|Internet |techsupport@ |

|World Wide Web | |

|Mail |OSI Software, Inc. | |

| |P.O. Box 727 | |

| |San Leandro, CA 94577-0427 | |

| |USA | |

| | | |

| |OSI Software GmbH |OSI Software, Ltd |

| |Hauptstra(e 30 |P. O. Box 8256 |

| |D-63674 Altenstadt 1 |Level One, 6-8 Nugent Street |

| |Deutschland |Auckland 3, New Zealand |

Unpublished -- rights reserved under the copyright laws of the United States.

RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)

of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013

Trademark statement—PI is a registered trademark of OSI Software, Inc. Microsoft Windows, Microsoft Windows for Workgroups, and Microsoft NT are registered trademarks of Microsoft Corporation. Solaris is a registered trademark of Sun Microsystems. HP-UX is a registered trademark of Hewlett Packard Corp.. IBM AIX RS/6000 is a registered trademark of the IBM Corporation. DUX, DEC VAX and DEC Alpha are registered trademarks of the Digital Equipment Corporation.

PI_OPCPluginGeneric.doc

( 2000 - 2002 OSI Software, Inc. All rights reserved

777 Davis Street, Suite 250, San Leandro, CA 94577

Table of Contents

Introduction 1

Principles of Operation 3

Plug-In Installation and Administration 5

Plug-In Directory 5

Installation Procedures 5

Define Required Digital States 5

Modify OPCINT.BAT 5

Configure PI Tags 6

Upgrading the Plug-In 6

Moving the Plug-In to a New Directory 6

Uninstalling the Plug-In 6

Error and Informational Messages 7

Message Logs 7

Troubleshooting 7

System Errors and PI Errors 7

Appendix A: Configuration File 9

Revision History 11

Introduction

The PI-OPC interface will retrieve all data from an OPC server, but when data stops flowing because of an emergency, the operator needs to know that there is a problem. Without modification, an OPC interface simply shows data when it is available, and ignores the reason it has stopped flowing. PI users need information about a datum’s specific error condition. PI data tags may become invalid for several reasons. A paper machine, for instance, may have a sheet break. In order to get complete information from the sensor gauge (through OPC), a plug-in DLL for the PI-OPC interface has been created by OSI. For systems in which the status condition for a particular data item may be determined by a single input tag, the plug-in is called “OpcPluginGeneric.DLL”.

Note: Neither this manual nor the plug-in are stand-alone products; they are to be used in conjunction with the PI-OPC interface.

Principles of Operation

The PI-OPC interface connects OPC variables (which are defined by OPC symbols for the specific device) to a PI tag. Various configuration options are stored in the PI tag’s ‘extended descriptor’. The Generic plugin DLL requires an additional equate in the extended descriptor, indicating that PI tag belongs to a data-group, which is defined in a configuration file on the interface machine.

For example, you have a fabrication line with many data inputs all flowing into PI. The fabrication line occasionally goes down for maintenance. You wish to have all data tags reflect MAINTENANCE status while the line is down. There is a DCS variable called SYS-STAT_01 available to OPC whose value is usually zero, but which becomes 77 during maintenance mode.

To reflect this in Generic.INI, you declare a group (as an ini-file section) called [FAB01]. Under this section, you declare two equates; one for the error input condition, and another to indicate the PI status to use when this occurs. The ini-file equates would be:

[FAB01]

inputErrXX = 77

digStateXX = MAINTENANCE

Any number of status condition/digital states may be defined for a status tag, as long as XX is unique for each pair. All ini-file symbols are case-INsensitive.

Note that this example is one of three logical ways for a status tag to be used. The other two are:

1. A status tag may have one unique value which indicates good, anything else being an error. From the above example, a flag value of zero is good, whereas any other value indicates some problem. The special equate-pair: inputErrGood=0, and digStateBad=INVALID, may be added to the list above.

2. A tag which simply changes periodically, as long as the system is operational may be used as a watchdog. The equate-pair to define a watchdog status tag is: timeoutSeconds = , and digStateTimeout = TIMEOUT, where is the time in seconds indicating failure. The watchdog status may not be combined with any other status tags or definitions.

In the extended descriptor of each data tag, the equate “… ,Grp=fab01, …” is added. The status tag which receives data from SYS-STAT_01 requires the equate “… GrpStat=fab01 …”, to identify it as the status tag for group FAB01.

Every time data is read, the plug-in, OpcPluginGeneric.DLL, examines the status tag associated with that data group. If a given status condition is in effect, the plug-in will set the values for the data with the system digital state associated with the error condition. If no status condition exists, the data is sent to PI with no modifications.

Any data flowing into PI through OPC may belong to a data-group, and thus be modified by a status condition. If the tag does not belong to a data-group, then its status will never be affected.

Status conditions which may invalidate a tag, and the digital state value which that tag acquires in that error condition are defined in the configuration file as described in Appendix A: “The Configuration File”.

Plug-In Installation and Administration

Plug-In Directory

The OpcPluginGeneric.DLL is installed as part of the PI-OPC interface installation into the Plug-in subdirectory. For instance, if the interface is installed in

D:\pipc\interfaces\opcint

then the DLL will be installed in

D:\pipc\interfaces\opcint\Plug-ins

Installation Procedures

Although the OpcPluginGeneric.DLL is included with the PI-OPC interface installation, one must configure some things before the DLL will be activated.

Define Required Digital States

The PI administrator may define various error conditions, and the digital states which result from those conditions, in the initialization file (see Appendix A). The digital states thus defined must be present in the PI archive’s state table before the PI-OPC interface can run with the plug-in. The states are not case sensitive, but they must be spelled exactly as shown in the ini-file.

PI 3 Home Node

For a PI 3 home node, the DLL expects these digital states to be somewhere in the System Digital State Set.

PI 2 Home Node

For a PI 2 home node, the expected digital states may be anywhere in the digital state table.

Modify OPCINT.BAT

The plug-in, OpcPluginGeneric.DLL, is installed as part of the PI-OPC interface installation into the subdirectory called plug-ins underneath the OPC interface directory. The installer must activate the DLL by adding two commands to the batch file, opcint.bat, which specify its location. For example:

Opcint.exe /ps=O … ^

/DLL=c:\pipc\interfaces\opcint\plug-ins\OpcPluginGeneric.dll ^

/DLL_ini=c:\pipc\interfaces\opcint\plug-ins\Generic.INI

After adding the last two lines, the PI-OPC interface will automatically load the plug-in at startup, and manifest plug-in-specific behavior. If the interface is already running, you will need to restart the interface for the DLL to be activated.

Note: The “^” shown at the end of all lines in the command file, except for the last line, is a continuation character indicating that more command lines follow.

Configure PI Tags

The plug-in needs to know which PI tags will be modified, and which tags will serve as status inputs. Note: all OPC symbols are case-sensitive.

Upgrading the Plug-In

If the plug-in is upgraded independent of the PI-OPC interface, install the plug-in in the appropriate directory. Then stop and restart the PI-OPC interface according to the instructions in the PI-OPC interface manual.

Moving the Plug-In to a New Directory

Although it is not recommended, it is possible to move the plug-in to a new directory. You will need to change opcint.bat to reflect the name of the new directory and then stop and restart the interface as described in the PI-OPC interface manual.

Uninstalling the Plug-In

If for some reason you want to run the interface without the plug-in, delete the /DLL and /DLL_ini command line parameters from the batch file, opcint.bat, and stop and restart the PI-OPC interface according to the instructions in the PI-OPC interface manual.

Error and Informational Messages

Error messages that are written to the message log are pre-pended by a string NameID. Name is a non-configurable identifier that is no longer than 9 characters. ID is a configurable identifier that is no longer than 9 characters and is specified using the /id flag on the startup command line.

Message Logs

Error and informational messages are written to the pipc.log file. The location of the pipc.log file is determined by the PIHOME entry in the pipc.ini file. The pipc.ini file should always be in the WinNT directory. For example, if the PIHOME entry is:

C:\PIPC

then the pipc.log file will be located in the c:\PIPC\dat directory.

For version 1.3 and greater of the PI-API, a process called pilogsrv may be installed to run as a service. After the pipc.log file exceeds a user-defined maximum size, the pilogsrv process renames the pipc.log file to pipcxxxx.log, where xxxx ranges from 0000 to the maximum number of allowed log files. Both the maximum file size and the maximum number of allowed log files are configured in the pipc.ini file. Configuration of the pilogsrv process is discussed in detail in the PI-API Installation Instructions manual.

Troubleshooting

Restarts: The OPC server must be operational before starting the PI-OPCINT interface.

• Removing the Ethernet cable and reconnecting it while the interface is operating recovers within about one minute and no user action is required.

• Powercycling the API data collector node starts up without user action.

System Errors and PI Errors

System errors are associated with positive error numbers. Errors related to PI are associated with negative error numbers.

Error Descriptions on NT

On NT, descriptions of system and PI errors can be obtained with the pidiag utility:

\PI\adm\pidiag –e error_number

Appendix A:

Configuration File

The plug-in requires a configuration file, which is supplied as a command-line parameter in the startup batch file for the PI-OPC interface; for example:

/DLL_ini=c:\pipc\interfaces\opcint\plug-ins\Generic.ini

This file defines how the interface recognizes data tags and the status tags which are applied to them.

Here is an example Generic.ini file, for an interface taking OPC data from two machines, M1, and M4. Both machines have an associated status tag.

Machine M1 has specific error conditions, and a single good status.

Data from Machine M4 is assumed good as long as its status tag updates at least every five minutes.

[M1]

;

; normal data group

;

; data tags will have .. ,Grp=m1, .. in the ex_desc

; the status tag will have .. , GrpStat=m1 , ..

;

; In this example, only the status value

; 3267 (decimal) yields a good status in PI.

;

; Status input 299 will result in all PI tags

; with ‘Grp=M1’ in their extended descriptors

; showing a status of “OFFLINE”.

;

; Status input 0xfe will result in all PI tags

; with ‘Grp=M1’ in their extended descriptors

; showing a status of “MAINTENANCE”.

;

; Any other status input will result in PI tags

; with ‘Grp=M1’ in their extended descriptors

; showing a status of “OTHER_PROBLEM”.

;

inputErr_0 = 299

digState_0 = OFFLINE

inputErr_32 = 0xfe

digState_32 = MAINTENANCE

inputGood = 3267

digStateBad = OTHER_PROBLEM

;

;

;

[M2]

;

; If the status tag (e.g. the tag with

; ‘GrpStat=M2’ in its extended descriptor)

; does not change within 10 minutes

; (multiple inputs of the same value are

; ignored), then all data tags will be

; marked with the status “WATCHDOG TIMEOUT”.

;

; a watchdog group

;

; data tags ex_desc: "... ,Grp=m2 .."

; status tag ex_desc: "... ,GrpStat=m2 ..."

;

; ten minutes

timeoutSeconds = 600

digStateTimeout = WATCHDOG TIMEOUT

The numeric values returned from a status tag may be given in decimal, hexadecimal, or octal bases. Octal is determined by a number beginning with zero, and containing only octal numerals (e.g. 0-7). Thus, “77” will convert to 7*10 + 7 = decimal 77, whereas “077” converts to 7*8+7 = decimal 63. Hexadecimal is determined either by any uniquely hexadecimal numerals (e.g. “A” through “F”), or any number beginning with “x”, or “0x”. For example, “x77” converts to 7*16+7 = decimal 119.

Any strings may be used for PI digital states. Spaces will be preserved without the use of quotes. If a digital state named in this file is not found in the PI digital state table, then the interface will terminate with an error, and all missing states will be shown in PIPC.LOG.

All equates must appear in matched pairs, associating an OPC input value with a particular PI digital state. If either equate statement of the matched pair is missing, then that error condition will not function. The matching pairs are:

InputErr matches digState, where may be any unique string except for Bad or Timeout, because those strings conflict with the following types.

InputGood matches digStateBad

TimeoutSeconds matches digStateTimeout

Revision History

|Date |Author |Comments |

|12 Mar 01 |WI |Version 1.00 |

|19 Feb 02 |BY |Version 1.0.2 |

|9-Jul-02 |CG |Version 1.03; formatting; headers & footers |

| | | |

| | | |

| | | |

| | | |

| | | |

| | | |

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download