Measurex Davinci Plug-In DLL

Total Page:16

File Type:pdf, Size:1020Kb

Measurex Davinci Plug-In DLL

Measurex DaVinci Plug-In DLL for OPC Interface to the PI System

Version 1.04 28 October 2000

OSI Software, Inc. How to Contact Us

Phone (510) 297-5800 (main number) (510) 297-5828 (technical support) Fax (510) 357-8136 Internet [email protected] World Wide http://www.osisoft.com 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. Mx DaVinci Plug-In to OPC Interface

 2000 OSI Software, Inc. All rights reserved 777 Davis Street, Suite 250, San Leandro, CA 94577

Measurex Da Vinci Plug-In DLL for OPC Interface to the PI System ii Table of Contents

Introduction...... 1 Principles of Operation...... 3 Plug-In Installation and Administration...... 5 Plug-In Directory...... 5 Installation Procedures...... 5 Upgrading the Plug-In...... 7 Moving the Plug-In to a New Directory...... 7 Uninstalling the Plug-In...... 7 Error and Informational Messages...... 9 Message Logs...... 9 Troubleshooting...... 9 System Errors and PI Errors...... 9 Appendix A: Use of AddOpcPluginStates.bat...... 11 Appendix B: Use of Configuration File...... 13 Revision History...... 15

Measurex Da Vinci Plug-In DLL for OPC Interface to the PI System iii 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 the Honeywell-DaVinci system, this plug-in is called “PIOpcMxDaVinci.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.

Measurex Da Vinci Plug-In DLL for OPC Interface to the PI System 1 Principles of Operation

The PI-OPC interface connects OPC variables (which are defined by OPC symbols for the specific device) to a PI tag. The OPC symbol for any PI tag is saved in that tag’s ‘instrument tag’ field or ‘extended descriptor’ (see the PI-OPC interface manual for exact tag configuration details). The primary type of data retrieved from paper machines is profile data. These data are configured as array data (please see the PI-OPC interface manual for proper configuration of array tags). Data is also available which indicates various statuses of the paper machine as well as the starting and ending boxes for valid profile data. Every time array data is read, the plug-in, PIOpcMxDaVinci.DLL, examines the statuses associated with that data. If a given status condition is in effect, the plug-in will set the values for some or all of the array data with the system digital state associated with the error condition. If no status condition exists, the array data is sent to PI with no modifications. Profile data is the only data for which special statuses will be applied. No other tags are affected. The status conditions which may invalidate a profile tag, and the digital state value which that tag acquires in that error condition are as follows:  OffSheetEdge: Scanner does not normally reach that data box position. The plug-in will write the digital state, OffSheetEdge, to the profile tags that are in positions less than the start box and which are in positions greater than the end box. Tags specifying the minimum and maximum valid data boxes for each profile are required for the plug-in to perform this function. Note: The PI-OPC interface requires that array numbering start with 1. The Measurex DaVinci profiles start with 0. Therefore, a start box of 6 will result in array positions 1–6 having OffSheetEdge written to them. An end box of 995 will result in array positions 996-1000 having OffSheetEdge written to them.  SheetBreak: Sheet-break has been detected on the frame. All profile tags associated with that scanner will have the status SheetBreak written to them.  Standardize: Frame is in standardize mode. All profile tags associated with that scanner will have the status Standardize written to them.  FrameOffline: Frame is in a state which does not produce data, such as ‘Dead’, ‘Unavailable’, ‘Emergency Stop’, ‘Manual’, ‘Console Offsheet’, etc., which is not covered by the specific conditions described by other PI states.  BadProfile: Any problem with the specific gauge, such as 80% of input values out of range, gauge disabled, etc.  SinglePoint: Gauge on the same scanner has gone into single-point mode, which disables all gauges on the scanner from normal profile sampling. The results of single-point (or

Measurex Da Vinci Plug-In DLL for OPC Interface to the PI System 2 ‘buffered single-point’) sampling may be accessed through other (non-profile) Measurex OPC variables (instrument tags).

Measurex DaVinci Plug-In DLL for OPC Interface to the PI System 3 Plug-In Installation and Administration

Plug-In Directory The PIOpcMxDaVinci.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 PIOpcMxDaVinci.DLL is included with the PI-OPC interface installation, one must configure some things before the DLL will be activated.

Define Required Digital States OffSheetEdge,SheetBreak, SinglePoint, FrameOffline, BadProfile, and Standardize digital states must be predefined 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. 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. There is a program in the Plug-Ins directory supplied to add these states automatically. See appendix: Use of AddOpcPluginStates.bat. PI 2 Home Node For a PI 2 home node, the expected digital states may be anywhere in the digital state table. You need to add these manually.

Modify OPCINT.BAT The plug-in, PIOpcMxDaVinci.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\PIOpcMxDaVinci.dll ^ /dllconfig=c:\pipc\interfaces\opcint\plug-ins\PIOpcMxDaVinci.txt

After adding the last two lines, the PI-OPC interface will automatically load the plug-in at startup, and manifest DaVinci-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.

Measurex Da Vinci Plug-In DLL for OPC Interface to the PI System 4 Configure PI Tags The plug-in needs extra information from Mx-DaVinci to adjust the profile tags’ status. This is accomplished by creating a few more PI tags. The scanner information is in the instrument tag field. Starting and Ending Data Boxes Configure these two tags for each profile, not each profile tag, but each profile.  scanner /measurements//last scan/trend/minimum valid index This is used by the plug-in to determine valid starting data box. The OffSheetEdge digital state will get written to each tag in the profile array positions of one to the number sent to this tag.  scanner /measurements//last scan/trend/maximum valid index This is used by the plug-in to determine valid ending data box. The OffSheetEdge digital state will get written to each tag in the profile array positions of the number sent to this tag plus 1 to the end of the array. Note: The PI-OPC interface requires that array numbering start with 1. The Measurex DaVinci profiles start with 0. Therefore, a start box of 6 will result in array positions 1–6 having OffSheetEdge written to them. An end box of 995 will result in array positions 996-1000 having OffSheetEdge written to them. Standardize Only one PI tag with the OPC item number listed below needs to be configured for the interface to apply the Standardize digital state to all related profile tags. For example, if you have subscribed to several profiles from a single scanner, only one ‘scanner in standardize’ tag needs be configured.  scanner /mss/status/scanner in standardize The Standardize digital state will get written to each profile tag in all profiles associated with scanner . SheetBreak Only one PI tag with the OPC item number listed below needs to be configured for the interface to apply the SheetBreak digital state to all related profile tags. For example, if you have subscribed to several profiles from a single scanner, only one ‘scanner in standardize’ tag needs be configured.  scanner /mss/status/scanner in break The SheetBreak digital state will get written to each profile tag in all profiles associated with scanner . SinglePoint and BufferedSinglePoint Two tags need to be configured to apply the SinglePoint digital state to all related profile tags.  /scanner /status/single point  /scanner /status/buffered single point Offline Three tags need to be configured to apply the Offline digital state to all related profile tags.

Measurex DaVinci Plug-In DLL for OPC Interface to the PI System 5 Plug-In Installation and Administration

 /scanner /status/OffLine  /scanner /status/OffSheet  /scanner /status/Maintenance BadProfile Configure this tag for each profile, not each profile tag, but each profile.  /scanner /measurements//validity/valid status

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 /DLLconfig 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.

6 OSI Software Inc. 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. Note: No messages are written to the command window when the interface is run interactively. All messages are written to pipc.log.

Troubleshooting Restarts: The Da Vinci 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 datacollector node starts up without user action.  Caution: restarting the Da Vinci while the interface is running will result in a state where no data may be connected indefinitely. The PI-API node must be restarted in this case. (Planned modifications in future Da Vinci servers should remove this restriction.)

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

Measurex Da Vinci Plug-In DLL for OPC Interface to the PI System 7 Appendix A: Use of AddOpcPluginStates.bat

This option is only available when the PI Home Node is PI 3. The plug-in requires several new digital states in the PI System Digital State Set that can be built automatically using an application called AddOpcPluginStates. The application consists of the following four files that are located in the plug-ins directory underneath the OPC interface directory:  AddOpcPluginStates.bat  NewStates.bat  AddStates.exe  MakeDumpSet.exe All of these files must be moved to the PI/adm directory of your PI 3 home node. They will not function unless moved to the PI home node, in the PI/adm directory. Log in as an administrator, go to a DOS prompt, and move to the PI/adm directory. Make sure PI is running. Invoke: D:\PI\adm\> AddOpcPluginStates The required digital states will be added at the end of your PI System Digital State Set.

Measurex Da Vinci Plug-In DLL for OPC Interface to the PI System 8 Appendix B: Use of 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: /dllconfig=c:\pipc\interfaces\opcint\plug-ins\PIOpcMxDaVinci.txt This file defines how the interface recognizes profile tags and the status tags which are applied to them. For instance, tags exist on the DaVinci system to indicate that a scanner is in sheet-break condition. In PI, this condition is represented by a digital state called “SheetBreak”. A line in the configuration file: “SheetBreak = scanner, /mss/status/scanner in break” determines which PI tag will be used to set a profile to the digital state “SheetBreak”. In the above case, a PI tag with “/scanner 3/mss/status/scanner in break” in its instrument tag field will be watched by the plug-in. Whenever that tag becomes non-zero, all PI profile tags for scanner 3 will be set to the digital state “SheetBreak”. Note: The configuration file must be in unicode. The Windows “Notepad” accessory has a checkbox option to save in unicode. This is the way the configuration file was originally created and tested. The syntax of the file is a series of equates, which are expressed by a hard-coded keyword, followed by either an equals-sign or a colon, followed by a comma-separated list of string values. String values may have embedded spaces, although spaces at the end or beginning of a string will be ignored, unless quotation marks are used. A semicolon in column one causes the line to be ignored as a comment. The following are valid equates: ;several ways to define keyword “measurementNames” measurementNames : basis weight measurementNames = basis weight measurementNames = basis weight ;define keyword “scannerIDs”=strings { “1”, “2“, “3” } scannerIDs = 1, 2, 3

;keyword with leading or trailing space ; “scannerKeyString” = “scanner ” scannerKeyString = “scanner ” Here are the actual keywords which may be defined in the configuration file. The keywords are in two categories; those which define scanner and measurement symbols, and those which define input tags types. Keywords are hardcoded. Note; except for “measurementNames” and “scannerIDs”, which are specific to each site’s installed set of gauges, most of the settings shown below work as they are, and should not be changed.

; example file “DaVinciConfiguration.txt” separatorChar = / scannerKeyString = "scanner " inbetweenScannerAndMeas = /measurements/

Measurex Da Vinci Plug-In DLL for OPC Interface to the PI System 9 Appendix B: Use of Configuration File

; what are this installations valid scanner numbers? scannerIDs= 1,2,3,4

; what gauges does this installation have installed? measurementNames = basis weight measurementNames = sheet temp measurementNames = air gap temp measurementNames = whiteness

; you can put several on one line measurementNames = dry weight,caliper,density,ash

; this determines how the plug-in recognizes a PI profile tag profile = measurement, /last scan/now/array

; these variables are zero origin ; for each profile, determine which PI tags are ; set to digital state “OffSheetEdge” firstBox = measurement, /last scan/now/minimum valid index lastBox= measurement, /last scan/now/maximum valid index

; for each profile, zero value causes PI state “BadProfile” validity = measurement, /validity/valid status

; this DaVinci variable determines PI state “SheetBreak” SheetBreak = scanner, /mss/status/scanner in break

; this DaVinci variable causes PI state “Standardize” Standardize = scanner, /mss/status/scanner in standardize

; these cause PI state “SinglePoint” SinglePoint = scanner, /status/single point BufferedSinglePoint = scanner, /status/buffered single point

; these cause PI state “OffLine” OffLine = scanner, /status/offline OffSheet = scanner, /status/offsheet Maintenance = scanner, /status/maintenance

10 OSI Software Inc. Revision History

Date Editor Comments 29-Sep-00 CG Reformatted and incorporated JZ’s and JL’s suggestions 28 Oct 00 DS, WI Vers. 1.04 05-12-00 JML Format changes

Measurex Da Vinci Plug-In DLL for OPC Interface to the PI System 11

Recommended publications