Home > PI-Foxboro Interface

PI-Foxboro Interface

 

 

Introduction 

 

Installation Checklist

 

 

Interface Installation on Windows NT

 

Interface Installation on Solaris

 

FoxAPI Test Program

 

PointSource

 

Interface Point Configuration

 

Performance Point Configuration

 

I/O Rate Point Configuration

 

Startup Command File

Starting / Stopping the Interface on Windows NT

 

Security

 

Starting / Stopping the Interface on Windows NT

 

Starting / Stopping the Interface on Solaris

 

Buffering

 

Appendix A Error / Informational Messages, and Troubleshooting

 

Appendix B Failover Support

 

Migration from v1.16.x

 

 
Foxboro I/A 51 and 70 Series Interface to the PI System 
 

Version 2.2.5 
 
 

 

    How to Contact Us

    Phone (510) 297-5800    (main number) 
    (510) 297-5828    (technical support)
    Fax (510) 357-8136
    E-mail techsupport@osisoft.com
    World Wide Web http://www.osisoft.com
    Mail OSIsoft 
    P.O. Box 727 
    San Leandro, CA  94577-0427 
    USA 
     
    OSI Software GmbH  
    Hauptstrae 30  
    D-63674 Altenstadt 1 
    Deutschland
    OSI Software, Ltd 
    P O Box 8256 
    Symonds Street 
    Auckland 1035  New Zealand 
     
    OSI Software, Asia Pte Ltd 
    152 Beach Road 
    #09-06 Gateway East 
    Singapore, 189721

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_fxbais.doc

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

 

Table of Contents 

 

Introduction

      The PI-Foxboro data collection interface program provides for the bi-directional transfer of data between OSIsoft’s PI Universal Server and Foxboro’s I/A Series system.   The PI Universal Data Server runs on Windows NT/2000/XP, Unix, or OpenVMS machines.  Foxboro’s I/A Series system runs on either Solaris 2.x (51 Series) or Windows NT (70 Series) computers.

      In the rest of this document, versions of PI Universal Data Server running on Windows NT/2000 or Unix are also referred to as PI 3.x.  Versions running on OpenVMS are referred to as PI 2.x.  In addition, the terms “PI Server” and “PI” represent an abbreviated nomenclature for PI Universal Data Server.

      In order to run the PI-Foxboro Interface, a computer must have the following software installed:

      • PI-API version 1.3.x or higher; v1.3.4 is highly recommended
      • local FoxAPI version 4.x.x if the Interface is to run on an I/A Series AW/AP, or
      • netFoxAPI version 4.x.x if the Interface is to run on a generic Solaris machine

      The first of these products comes from OSIsoft.  Foxboro supplies the others.  Foxboro recommends the use of FoxAPI v4.2.5.

      The choice of the FoxAPI version (i.e., whether local or networked) depends on the type of machine on which PI-Foxboro runs.  If this machine is:

      • an I/A Series AW/AP, local FoxAPI is required.  Local FoxAPI ships on all I/A Series AW/APs sold to date.
      • a generic Solaris machine, netFoxAPI must be purchased and installed on this generic Solaris machine.  In addition, netFoxAPI software must also be licensed at the netFoxAPI server machine. The standard FoxAPI manuals describe this operation.
 

      The following table summarizes these scenarios: 

      Platform Description Software on PI-Foxboro machine
          PI-Foxboro Local FoxAPI netFoxAPI
      50-Series AW/AP PI-Foxboro loaded on an I/A Series AW/AP uses local FoxAPI to acquire data. Yes Yes No
      70-Series AW PI-Foxboro loaded on an I/A Series AW uses local FoxAPI to acquire data. Yes Yes No
      Generic Solaris PI-Foxboro loaded on a generic Solaris machine uses netFoxAPI to acquire data from an I/A Series AW/AP over a customer supplied TCP/IP based network. Yes No

      But, local FoxAPI is required on the AW/AP feeding the data to the PI-Foxboro machine

      Yes
      Generic Windows NT This configuration is not supported. N/A N/A N/A
 

      The remainder of this document uses the term “FoxAPI” to refer to FoxAPI and netFoxAPI in general.  When an issue or feature specific to one or the other arises, it will be so noted.  For example, the version of the Interface that specifically uses the netFoxAPI is called "PI-FoxboroNet".

FoxAPI compatability

      Customers have reported compatibility between the Interface and the following versions of FoxAPI software and I/A software:

  • FoxAPI version 4.2.0, I/A version 4.3
  • FoxAPI version 4.2.2, I/A version 4.3
  • FoxAPI version 4.2.2, I/A version 6.0.0
  • FoxAPI version 4.2.2, I/A version 6.2
  • FoxAPI version 4.2.4, I/A version 4.3
  • FoxAPI version 4.2.4, I/A version 6.1
  • FoxAPI version 4.2.5, I/A version 6.2

      Foxboro recommends the use of FoxAPI v4.2.5. 

      Please note that on Solaris, FoxAPI v5.x is NOT compatible with PI-Foxboro.

FoxAPI version 5 incompatability

      FoxAPI v5.0 is no longer supported by Foxboro.  Its primary purpose was to support Foxboro's PIMS suite, which they no longer sell.

Windows NT

      Customers have reported compatibility between the PI-Foxboro Interface and FoxAPI version 5.0.0 running on Windows NT (70-Series AW).

Solaris

      The following information comes from Foxboro:

      Simply stated, certain programs do not work with V5.x of FoxAPI installed on the same box. V5.x of FoxAPI is shipped with the PIMS 2.0 package.  V4.x is the default version of FoxAPI..

      FoxAPI V5.x has been withdrawn and replaced by AIM*API for applications that require the V5.x functionality and by FoxAPI V4.2.4 or later for programs that do not require the functionality of FoxAPI Version 5.x.

      In general, FoxAPI Version 5.x is found only on those systems that have applied the PIMS 2.0 package.  PIMS 2.0 changed libfoxapi.so such that all programs linked against the previous FoxAPI release will break.

      The PIMS 2.0 package has been superceded by AIM* V3.x. If possible, the system should be upgraded to use AIM* V3.x instead of FoxHistory and PIMS 2.0 and the latest version of FoxAPI V4.x should be installed.

      If the upgrade is not possible, there are several possible fixes/workarounds, each with its own problems.  Please contact Foxboro for more information.

Reference Manuals

      OSIsoft
  • UniInt End User document
  • PI Universal Data Server manual
  • PI-API Installation Instructions
  • PI-API manual
  • PI-ICU User Manual
      Foxboro
      • Foxboro AIS System Manager’s Guide For Unix Computers
      • Foxboro AIS Programmer’s Guides
      • Foxboro INI documentation
      • Foxboro IA Series documentation
      • I/A Series FoxAPI User’s Guide
      • I/A Series FoxAPI Installation Guide

 

Supported Features

      Feature Support
      Part Numbers PI-IN-FX-IA-SOL  (Solaris)

      PI-IN-FX-IA-NT  (Windows NT)

      Platforms Windows NT (Intel) / Solaris 2
      PI Point Types PI 2.x ( real / integer / digital )

      PI 3.x ( float16 / float 32 / float 64 / int16 / int32 / digital / string )

      Sub-Second Timestamps No
      Sub-Second Scan Classes No
      Automatically Incorporates PI Point Attribute Changes Yes
      Exception Reporting Yes; performed by the Interface
      Outputs from PI Yes
      Inputs to PI: Scan-Based / Unsolicited / Event Tags Scan-based / event tags
      Maximum Point Count Unlimited
      Uses PI-SDK No
      PINet to PI 3.x String Support Not applicable
      * Source of  Timestamps PI Universal Data Server machine
      History Recovery No
      * Failover Yes
      * UniInt-based Yes
      * Vendor software required on PI-API node Yes
      Vendor software required on Foreign Device No
      Vendor Hardware Required No
      Additional PI software included with the Interface No
      *Device Point Types char / short integer / float / string / Boolean / long integer / short integer / packed Boolean / long packed Boolean

      * See paragraphs below for further explanation.

      Source of Timestamps

      Because the Foxboro I/A series workstation always has its time zone set to GMT and its clock set to wall clock time, the time as indicated on this machine is technically incorrect.  Therefore, PI-Foxboro uses the PI-API routine pitm_fastservertime to determine the PI Server’s local time.  The Interface then applies an additional time offset to obtain the correct Coordinated Universal Time (UTC).  The pitm_fastservertime routine keeps track of the offset time between the PI Server and the Foxboro I/A series workstation.  This offset is recalculated every 10 minutes. The time offset for the correct UTC is also recalculated every 10 minutes.

      Data sent by the Interface to the PI Server normally contain the PI Server’s timestamp as represented in UTC.  Profile data points have a timestamp that corresponds to the value of the I/A object associated with the Profile Trigger tag.  See the section on Profile Points for more information.

      The PI-Foxboro Interface must run on a workstation whose time zone is set to GMT and whose clock is set to wall clock time.

      Failover

      The user may simultaneously run two copies of PI-Foxboro in a failover configuration.  In this manner, if one copy of the Interface fails, the other automatically assumes responsibility for data collection.  See the Failover section of this manual for details. 

      PI-FoxboroNet does not run in a failover configuration.

      UniInt-Based

      UniInt stands for Universal Interface. UniInt is not a separate product or file; it is an OSIsoft-developed template used by developers, and is integrated into many interfaces, such as the PI-Foxboro Interface.  The purpose of UniInt is to keep a consistent feature set and behavior across as many of our interfaces as possible.  It also allows for the very rapid development of new interfaces.  In any UniInt-based interface, the Interface uses some of the UniInt-supplied configuration parameters and some interface-specific parameters.  UniInt is constantly being upgraded with new options and features.

      The UniInt End User Document is a supplement to this manual.

      Vendor Software Required

      The PI-Foxboro Interface program requires software from Foxboro, Inc.  This software is either

      • FoxAPI, version 4.x.x, or
      • netFoxAPI, version 4.x.x.

      However, on Windows NT, customers have reported success with using FoxAPI version 5.0.0.

      Device Point Types

      The PI-Foxboro Interface supports the following Foxboro I/A point types:

      • char (I/A type 1)
      • short integer (I/A type 2)
      • float (I/A type 3)
      • string (I/A type 4)
      • Boolean (I/A type 5)
      • long integer (I/A type 6)
      • short integer (I/A type 8)
      • packed Boolean (I/A type 9)
      • long packed Boolean (I/A type 10)

      The Interface does not support the reading of I/A Series Messages.  For example, messages such as

            Control Station Generated:

              Process Alarms

              Sequence of Events

              Sequence Block

            System Monitor

            Operator Action Journal

      are not supported.

Diagram of Hardware Connections

      The following diagrams indicate the connectivity between the various hardware and software components.  Note that the Interface must run on a machine that is separate from the PI Universal Data Server.  That is, you must install the Interface on a machine known in OSIsoft’s terminology as a “PI-API node”. 
       
       
       

      Please note that PI-FoxboroNet connects to a single netFoxAPI server only.  If you wish to connect to multiple netFoxAPI servers, run multiple copies of PI-FoxboroNet.  For example, 
       
       
       

 

Principles of Operation

      The following description of the PI-Foxboro program assumes that the user is familiar with running OSIsoft interface programs in general.  First-time users of the PI System may wish to skim this section and return at a later time.

      Before PI-Foxboro can start up, the FoxAPI processes must already be running.  On Solaris, these processes are launched by Foxboro’s aisstart command.  On Windows NT, the service control manager starts up Fox Apps, Fox Monitor, Fox NTApp Service, and Fox Shm Service.

      Upon startup, PI-Foxboro reads the PI point database and determines which PI points it services by looking at the Point Source and Location1 point attribute fields.  The Instrument Tag field should contain the name of the Foxboro I/A object.  Otherwise, the Extended Descriptor must have the name of the Foxboro I/A object.

      PI-Foxboro makes calls to FoxAPI functions in order to retrieve data from the I/A system.  The Location2 value determines whether the Interface utilizes unbuffered or buffered FoxAPI access routines.  Values written from PI to the I/A are also via either buffered or unbuffered FoxAPI function calls.  Buffered access involves reading from (or writing to) I/A object values in the I/A shared memory. 

      Values that are retrieved from the I/A shared memory have already gone through Foxboro’s exception reporting mechanism.  In addition, unless the user specifies the –sn paramter during Interface startup, the Interface program itself also performs exception reporting on these values before sending them to PI.

      For a value received from an I/A object that has its “bad” bit set, the user may choose to send to PI Universal Data Server

      • the value, or
      • Bad Input, or
      • the value with the PI questionable bit set (PI 3.x only)

      Bit 8 of the I/A object status indicates whether an object is “bad”.

      Outputs from the PI System to the Foxboro I/A are performed via OSIsoft’s standard event-based mechanism.  That is, when the Interface determines that a PI point has received a new value, it sends this value to the corresponding I/A object. 

 

Installation Checklist

      For those users who are familiar with running PI data collection interface programs, this checklist helps you get the PI-Foxboro Interface running. If you are not familiar with PI interfaces, you should return to this section after reading the rest of the manual in detail.

      You should follow the steps in the order listed below.

      1. If the Interface will run on a 70-Series AW and PI Universal Data Server is version 3.3.361.43 or higher, install the PI-ICU.
      2. The PI-Foxboro Interface runs only on a PI-API node.  This PI-API node is the same machine as the Foxboro workstation.
      3. On the Foxboro workstation, install the PI-API.  (Installation of the PI-ICU automatically installs the PI-API.)  Confirm connectivity between this machine and the PI Server by running the apisnap program.
      4. Confirm the correct operation of the FoxAPI.  Run Foxboro’s foxtst program.  If you are using netFoxAPI, make sure that the netFoxAPI client machine (the machine running the Interface) has permission to create, name, and read objects on the netFoxAPI server machine.
      5. Install the PI-Foxboro Interface program files.  On Solaris, “untar” the compressed tar interface distribution file.  On Windows NT, run the installation program. 
      6. If you will be using PI digital tags, define digital states.  For PI 3.x, you must also define digital state sets.
      7. Choose a point source for use by the Interface.  For PI 2.x, put this point source into the Point Source table.
      8. Configure PI points to be used by the Interface.

        The InstrumentTag specifies the Foxboro I/A object.

        Location1 is the interface identification number multiplied by 100.

        Location2 is the PI list number for buffered access to I/A objects.

        Location3 indicates input to or output from PI.

        Location4 specifies the scan class (and hence the scan frequency).

      1. If desired, configure PI interface performance points.
      2. If desired, configure I/O Rate points.
      3. Edit the Interface startup command file.  If you are using netFoxAPI, specify the netFoxAPI server machine.
      4. Modify the security of the PI Server.  For PI 3.x, edit the PI Trust or PI Proxy table as appropriate.  For PI 2.x, edit the PISysDat:PIServer.Dat file.
      5. Stop the PI Buffer Server.
      6. Interactively start the Interface. 
      7. Verify that data are correctly being written to the PI Universal Data Server.
      8. Stop the Interface and start the PI Buffer Server.
      9. Confirm that the Interface re-starts after a complete machine shutdown and restart.  You may need to edit Solaris and/or FoxAPI startup/shutdown files.

 

Interface Installation on Windows NT

      You should install the PI-Foxboro Interface on a PI-API node only, and not on a PI Server node.  A PI Server node is a computer on which the PI Universal Data Server runs.  A PI-API node is any computer that has the PI Application Programming Interface (PI-API) installed and which is not a PI Server node.  (Of course, the PI-API node on which PI-Foxboro runs must also have the FoxAPI present.)

      After you have installed and tested the Interface, you should enable the PI Buffer Server application.  PI Buffer Server (also known as Bufserv) is a utility program distributed with the PI-API.  It provides the capability to store and forward events to the PI Universal Data Server.  The primary purpose of Bufserv is to allow continuous data collection when communications between the PI-API node and the PI Universal Data Server is lost.  Communications will be lost when network problems exist, or when the PI Universal Data Server is shut down because of maintenance, upgrades, backups, or unexpected failures.

      Please see the PI-API Installation manual for instructions on installing the PI-API and PI Buffer Server.

      After confirming that the Interface and PI points have been configured properly to collect data, you should install the Interface as an automatic service under Windows NT.  A Windows NT service keeps running even after the user has logged off.  An automatic service automatically restarts when the computer itself restarts.  This feature is useful in the event of an interruption in electrical power to the computer.

PI-Interface Configuration Utility

      The PI-Interface Configuration Utility (PI-ICU) is an application that aids in PI System management by consolidating the setup and configuration options required for new and existing PI Interfaces.  Although PI-ICU itself runs only on Windows NT/2000/XP machines, it is compatible with all PI Universal Data Server versions 3.3.361.43 or higher.

      You install and run PI-ICU on the computer which contains the interface that PI-ICU will manage.  So, for the case of the PI-Foxboro Interface, you would run PI-ICU on the 70-Series AW.   If you choose to use the PI-ICU, you should install this program before installing PI-Foxboro.

      OSIsoft strongly recommends that you install the PI-ICU if your version of PI Universal Data Server is capable of supporting it.

Interface Directories

The PIHOME Directory Tree

      Installation of the PI-API (or any other OSIsoft product that runs on Microsoft Windows) creates the PIHOME directory tree.  In particular, it creates a PIHOME entry in the pipc.ini configuration file.  The pipc.ini file is an ASCII text file located in the WinNT directory where Windows NT itself is installed (commonly, C:\WinNT).

      A typical pipc.ini file contains the following lines:

        [PIPC]

        PIHOME=C:\program files\pipc

      The above entry defines the C:\program files\pipc directory as the root of the PIHOME directory tree on the C: drive.  The PIHOME directory does not need to be on the C: drive.

Interface Installation Directory

      The PI-Foxboro Interface is installed typically under the PIHOME directory in a subdirectory named \interfaces\fxbais.  For example,

        C:\program files\pipc\interfaces\fxbais

Interface Installation Procedure

      The PI-Foxboro Interface program and its associated files are distributed as a self-extracting WinZip file; for example, fxbais_2.2.5.exe.  This setup program uses the services of the Microsoft Windows Installer.  If necessary, the setup program will install Windows Installer itself.

      After you run the setup program, a directory structure and files such as the following result:

        C:\program files\pipc\interfaces\fxbais\fxbais.exe

        C:\program files\pipc\interfaces\fxbais\fxbais.bat.new

        C:\program files\pipc\interfaces\fxbais\pi_fxbais.doc

Naming Conventions and Requirements

      If you run multiple copies of the Interface, it is customary for you to copy and rename the executable and the startup command files.  For example, you would typically have fxbais1.exe and fxbais1.bat for interface instance number 1, fxbais2.exe and fxbais2.bat for interface instance number 2, and so on.  The reason is that when an interface runs as a service (e.g., fxbais1), it looks for a command file (e.g., fxbais1.bat) that has the same root name as the executable (e.g., fxbais1.exe).

      So, for the above example, you should have the following files:

        C:\program files\pipc\interfaces\fxbais\fxbais1.exe

        C:\program files\pipc\interfaces\fxbais\fxbais1.bat

        C:\program files\pipc\interfaces\fxbais\fxbais2.exe

        C:\program files\pipc\interfaces\fxbais\fxbais2.bat 

        However, if you are using the PI-ICU, then the above renaming requirements do not apply because the PI-ICU manages multiple copies of interfaces without your having to copy and rename files.

    Installing the Interface as a Windows NT Service

        To install the Interface as a Windows NT service, you can

        • use the PI-Interface Configuration Utility, or
        • manually enter commands yourself. 

        The next two sections describe these procedures.

    Installing the Interface Service with PI-Interface Configuration Utility

        The PI-Interface Configuration Utility provides a graphical user interface for creating, editing, and deleting the Interface as a Windows NT service.  However, before you can create the PI-Foxboro Interface service, you first have to configure PI-ICU to recognize the Interface.

        From the PI-ICU menu, select Interface, New, and then Browse to the fxbais.exe executable file.  Then, enter values for Point Source and Interface ID#.  A window such as the following results: 

        Click on Add.   

        You should then see a display such as the following: 
         

        Near the top of the main PI-ICU screen, the Interface Type should be fxbais.  If not, use the drop-down box to change the Interface Type to be fxbais.

        Also, add an entry for the Scan Classes.

        Click on Apply to enable PI-ICU to manage this copy of the PI-Foxboro Interface. 
         
         

        To install the Interface as a service, click on the Service tab.  Then, enter the appropriate information into the Log on as and Password fields.  For example, 
         
         

        For this example, notice that the entry for Log on as is Fox.  You must enter a username that has permission to use the FoxAPI.

        Also, the above shows that this fxbais1 service is dependent on the bufserv (PI-Buffer Server) service.  However, because the PI-Foxboro Interface requires the FoxAPI, you should set the interface service to depend also on those services that compose the FoxAPI.  For example, the FoxAPI may consist of services such as

        • Fox Apps
        • Fox Monitor
        • Fox NTApp Service
        • Fox Shm Service

        Please consult your 70-Series AW documentation for more information.

        Finally, click on Create to create the interface service.

        If you wish to remove the interface service, click on Remove.

        To start the PI-Foxboro Interface service, click on the start button () located on the PI-ICU toolbar.

        When the PI-Foxboro Interface service is currently running, you can click on the stop button () to stop it.

        You can determine the current status of the Interface service by looking at the lower portion of the PI-ICU screen.  For example, 

        shows that the Interface service is currently installed, but it is stopped.

    Installing the Interface Service Manually

        You can get help for installing the interface as a Windows NT service by using the -help command line parameter.  For example,

          C:\program files\pipc\interfaces\fxbais\fxbais.exe –help  

          To manually install the Interface service, open a Windows NT command prompt window and go to the directory where the fxbais.exe executable is located.  Then, consult the following table to determine the appropriate service installation command.

          Windows NT Service Installation Commands on a PI-API node with Bufserv implemented
          Manual service fxbais.exe –install –depend “bufserv foxapps” –display “PI-fxbais”
          Automatic service fxbais.exe –install –auto –depend “bufserv foxapps” –display “PI-fxbais”
          NT Service Installation Commands on a PI-API node without Bufserv implemented
          Manual service fxbais.exe –install –depend “foxapps” –display “PI-fxbais”
          Automatic service fxbais.exe –install –auto –depend “foxapps” –display “PI-fxbais”
       

          Note: You will have to change “foxapps” to the name of the actual executable programs that compose the FoxAPI on your system.  Please consult your 70-Series AW documentation for more information.

       

          Check the Microsoft Windows NT services control panel to verify that the service was added successfully.  You can use the services control panel at any time to change the interface from an automatic service to a manual service, or vice versa.

       
       

      Interface Installation on Solaris

          You should install the PI-Foxboro Interface on a PI-API node only, and not on a PI Server node.  A PI Server node is a computer on which the PI Universal Data Server runs.  A PI-API node is any computer that has the PI Application Programming Interface (PI-API) installed and which is not a PI Server node.  (Of course, the PI-API node on which PI-Foxboro runs must also have the FoxAPI present.)

          After you have installed and tested the Interface, you should enable the PI Buffer Server application.  PI Buffer Server (also known as Bufserv) is a utility program distributed with the PI-API.  It provides the capability to store and forward events to the PI Universal Data Server.  The primary purpose of Bufserv is to allow continuous data collection when communications between the PI-API node and the PI Universal Data Server is lost.  Communications will be lost when network problems exist, or when the PI Universal Data Server is shut down because of maintenance, upgrades, backups, or unexpected failures.

          Please see the PI-API Installation manual for instructions on installing the PI-API and PI Buffer Server.

      PI-API Verification

          PI-Foxboro requires an existing copy of OSIsoft’s PI-API.  Please install and configure the PI-API prior to installing the Interface.

          Also, before attempting to install the Interface, be sure that the PI-API test program, apisnap, is functional.  That is, confirm it is able to retrieve information from the PI Universal Data Server. 

          For example,

            $ PIHOME=/opt/piapi

            $ export PIHOME

            $ LD_LIBRARY_PATH=$PIHOME/lib

            $ export LD_LIBRARY_PATH

            $ $PIHOME/bin/apisnap piserver:5450

          In the example above, piserver is the name of the PI Universal Data Server machine.  The number 5450 represents the communications port number for PI 3.x.  For PI 2.x, use 545 instead.  If apisnap fails to retrieve data, PI-Foxboro will not function properly.

          Note: The timestamp of the value retrieved from the apisnap program will most likely be incorrect.  The reason is that the I/A workstation has its time zone set (probably incorrectly) to GMT.  In general, you should not trust the timestamp of PI programs that run on machines whose time zone setting is incorrect.  (Of course, the PI-Foxboro Interface is an exception to this rule because it was written based on the fact that it always runs on a workstation with an incorrect time zone setting.)

       

          An additional verification of the functionality of the PI-API is to run the apiverify script.

          On a Solaris machine, Bourne or Korn shell:

            $ PIHOME=/opt/piapi

            $ export PIHOME

            $ $PIHOME/bin/apiverify

          The output should look similar to the following:

            NAME            PID     TIME            %CPU    %MEM

            mqmgr           23760   0:01            0.0     1.5    

            mqsrv           23755   0:09            0.0     1.5    

            ioshmsrv        23766   0:00            0.0     1.2    

            iorates         23771   0:09            0.0     2.2

          The above processes (mqmgr, mqsrv, ioshmsrv, and iorates) must all be running.  If they are not, PI-Foxboro may not function properly.

      Interface Directories

      The PIHOME Directory

          PIHOME is an environment variable that points to the base directory where the PI-API is installed.  The setting of environment variables is discussed in the PI-API Installation Instructions manual.  PIHOME is typically /opt/piapi.

      Interface Installation Directory

          The PI-Foxboro Interface is installed typically under the PIHOME directory in a subdirectory named /interfaces/fxbais.  For example,

            /opt/piapi/interfaces/fxbais

      Interface Installation Procedure

          Installation of the Interface may be done under either the root or the piadmin account.  OSIsoft recommends the latter.

          Extraction of Files

          The PI-Foxboro Interface consists of the executables fxbais and fxbaisnet, the startup script fxbais.sh.new, and supporting files.  All of these files are distributed as a compressed tar package typically called fxbais_tar.Z.  (Remember that Solaris is case sensitive.  Thus, if you used FTP to transfer this package, be sure to rename the file so that it has a capital Z in its name.)

          Installation involves moving this package to the PIHOME directory (such as /opt/piapi) and then extracting the files from the package.  For example,

            $ cd /opt/piapi

            $ zcat fxbais_tar.Z | tar –xvf –

          The directory structure and files such as the following result:

            /opt/piapi/interfaces/fxbais/fxbais

            /opt/piapi/interfaces/fxbais/fxbaisnet

            /opt/piapi/interfaces/fxbais/fxbais.sh.new

       

          Startup Command File

          For a first time installation of the Interface, make a copy of the startup script file that ends with .new:

            $ cp fxbais.sh.new fxbais.sh

          Then, edit the fxbais.sh file and customize it with your starting parameters.  A later section of this manually describes these parameters in detail.  If you are using netFoxAPI, be sure to change the PROG_NAME to fxbaisnet.

          If you are upgrading from a previous version of the Interface, visually compare the fxbais.sh.new file from the current release to your existing fxbais.sh file to determine whether any startup parameters have changed.  If so, make the appropriate corrections to your existing fxbais.sh file.

          Manual Interface Startup

          To start up the Interface manually, run the fxbais.sh file:

            $ ./fxbais.sh

       

          Manual Interface Shutdown

          To shut down the Interface manually, run the fxastop file:

            $ ./fxastop

       

          Automatic Interface Startup

          To set up the Interface for automatic startup after the PI-API processes have initialized, add the appropriate commands to the $PIHOME/bin/sitestart file.  For example, add the following to the sitestart file:

            cd ../interfaces/fxbais

            ./fxbais.sh

       

          Automatic Interface Shutdown

          To set up the Interface so that it terminates when the PI-API shuts down, add the following commands to the $PIHOME/bin/sitestop file:

            cd $PIHOME/interfaces/fxbais

            csh ./fxastop

       

          Automatic Startup of the PI-API

          If you want to configure the Foxboro workstation so that the FoxAPI startup script automatically calls the PI-API startup script, you should edit the file /etc/fox/user_apps.dat.  In this file, place the full path to the supplied go_pistart file (for example, /opt/piapi/interfaces/fxbais/go_pistart).  Be sure that go_pistart has the correct permission needed for file execution.  Also, check the setting for the PIHOME environment variable in this file.

          Alternatively, you may use the supplied PIAPI, PIAPIstart, and PIAPIstop scripts.  Copy these files as follows:

            cp PIAPI /etc/rc3.d/S95PIAPI

            cp PIAPI /etc/rc2.d/K05PIAPI

            cp PIAPIstart /etc/init.d/PIAPIstart

            cp PIAPIstop /etc/init.d/PIAPIstop

       

          Again, be sure these files have the correct permission needed for file execution.  Check the PIHOME and LD_LIBRARY_PATH settings in these files.  Also, make sure that the number 95 in the filename S95PIAPI is greater than the number in filename of the Sxx script that starts up the FoxAPI.  Finally, make sure that the number 5 in the filename K05PIAPI is smaller than the number in the filename of the Kxx script that terminates the FoxAPI.

       

          Startup summary

          In summary, the following is the order in which various processes should be started:

          • FoxAPI processes (i.e., om_poll)
          • PI-API processes (i.e., mqmgr, mqsrv, ioshmsrv, iorates, bufserv)
          • PI-Foxboro Interface (i.e., fxbais)

          You must understand the relationship among all of the above.  For example, the FoxAPI startup script calls

                /etc/fox/user_apps.dat

          which calls

                /opt/piapi/interfaces/fxbais/go_pistart

          which calls

                /opt/piapi/bin/pistart

          which calls

                /opt/piapi/bin/sitestart

          which calls

                /opt/piapi/interfaces/fxbais/fxbais.sh

          which executes the Interface.

      Naming Conventions and Requirements

          If you want to run multiple copies of the Interface, you will need to copy and rename the executable and startup command files.  For example,

          $ cp fxbais fxbais1

          $ cp fxbais fxbais2

          $ cp fxbais.sh fxbais2.sh

          $ cp fxbais.sh fxbais2.sh

          There are two conventions for the installation directory.  The first convention is to place all copies of the interface into a single directory.  If you follow this convention, place fxbais1, fxbais1.sh, fxbais2, fxbais2.sh, and so on in the directory:

               $PIHOME/interfaces/fxbais

           
          The second convention is to create a separate interface directory for each copy of the interface. If you follow this convention, place fxbais1 and fxbais1.sh into the directory:

               $PIHOME/interfaces/fxbais1

           
          Place fxbais2 and fxbais2.sh into the directory:

               $PIHOME/interfaces/fxbais2

          And so on.  Create the installation directories as necessary. 

          Regardless of the convention that you choose, you will need to change the contents of the PI-API site-specific startup script (e.g., /opt/piapi/bin/sitestart) as appropriate.

       

      FoxAPI Test Program

          The PI-Foxboro Interface relies on the services provided by the FoxAPI.  To verify that the FoxAPI is currently functional, use the foxtst program supplied by Foxboro. 

          On Solaris, you run this program via a command such as

               $ /opt/fox/ais/bin/foxtst

          On Windows NT, you would use a command such as

               C:> \opt\fox\ais\bin\foxtst.exe

       

          For example, to use the FoxAPI uread() function to read the current value for the I/A object CMPD:BLKA.BI0004, you would do the following (input that you would type are in bold below):

       

            Foxboro Fox API Test Program

       

            -------------------------------------------------------------------

            Menu (1)      Fox API Test Program    Hostid = 80fe6962 System Type = 51

             

            Test Program        Quick Tests            Sub Menus

            -1 Exit          10-FoxAPI Status    100 -(Menu 1)  Main Menu

            0-Repeat Last   11-Block Info       200 -(Menu 2)  Block Info

            1-Help          12-Objects          300 -(Menu 3)  Objects

            2-Menu On/Off   13-CDX              400 -(Menu 4)  CDX

            3-Echo On/Off   14-File             500 -(Menu 5)  File

            3-Echo On/Off   15-Historian        600 -(Menu 6)  Historian

            4-Save Settings 16-FoxHistory       700 -(Menu 7)  FoxHistory

            5-an_error      17-Counters         800 -(Menu 8)  Counters

                             18-Trouble Shooting 900 -(Menu 9)  Trouble Shooting

                            19-OM               1000-(Menu 10) OM Functions

                                                 1100-(Menu 11) Old Functions

       

            function[ 0]: 300

       

            -------------------------------------------------------------------

            Menu (3)      Object Access     Hostid = 80fe6962 System Type = 51

            Test Program        Functions       Functions     Functions

            -1 Main Menu     10-scopen       30-getidx     40-uread

            1-Help          11-sqopen       31-getmidx    41-uwrite

            2-Menu On/Off   12-bread        32-readval    42-sread

            3-Echo On/Off   13-bwrite       33-mreaidx    43-swrite

            4-Save Settings 14-qread        34-readnam    44-an_nam2val

            5-Save Set Info                 35-readsta    45-wrtval

                             16-clsset       36-mreawidx   46-an_write_valstat

                             17-get_set_name 37-all_read

                             18-get_set_num

                             19-put_set_name

                             20-gsinfo

                             21-getnam

                             22-gsnent

       

            function[ 0]: 40

       

            ---- uread ----

            compound    [ point1         ]: CMPD

            block       [ .            ]: BLKA

            parameter   [ .            ]: BI0004

            value type  [            3 ]: 3

            multiples   [            1 ]:

            ok to add?  [              ]: Y

            end of set? [            N ]: Y

       

            num entries [            1 ]:

            reterr = 0 - ( Success )

       

            entry name                    error       value status

            ----- ----                    -----       ----- ------

                1 CMPD:BLKA.BI0004            0        1.24 0023x ActOffUns_OkFlt

       

          In the above example, the value of the I/A object CMPD:BLKA.BI0004 as returned by the FoxAPI uread() function is 1.24.

       

          Here is another example:

          At the program’s main menu, type:

            300

          When prompted, type:

            30

          When prompted, enter the compound, block, and parameter names, e.g.,

            function[ 0]: 30

            ---- getidx ----

            compound    [ UC01_LEAD:SINE.MEAS ]: READ

            block       [ .            ]: P_SINK

            parameter   [ .            ]: VAL_2

       

          The program will respond with something like:

            name                             index

            ----                             -----

            READ:P_SINK.VAL_2                    1

          The number in the index column is the FoxAPI index for the object.

          At the prompt, type:

            35

          The result should resemble:

            function[ 30]: 35

            ---- readsta ----

            index       [            1 ]:

            index       status

            -----       ------

                1        0022x ActOffUns_OkInt

           

          Because the foxtst program and PI-Foxboro both use the same underlying FoxAPI functions, foxtst provides an easy way to verify values that are read by the PI-Foxboro Interface and subsequently sent to PI Universal Data Server.  Similarly, if foxtst experiences problems with reading a particular I/A object, then the PI-Foxboro Interface likewise will have difficulties.

           

       
       

      PointSource

          The PI point is the basic building block for controlling data flow to and from the PI Universal Data Server.  The PointSource attribute is a single character that is used to identify a PI point as one that belongs to a particular interface.  For example, you may choose the letter F to identify points that belong to the PI-Foxboro Interface.  To implement this identification, configure PI points such that their PointSource attribute is F.  Then, if you use  -ps=F on the Interface’s startup command line (described later) and start the Interface, PI-Foxboro receives from PI Universal Data Server a list of every point that has its PointSource set to F

          However, before the Interface begins data transfer for a point from this list, it examines additional PI point attributes.  This examination further determines the validity of a PI point for use with the Interface.  For additional information, see the section on Point Configuration and the description of the -ps parameter in Startup Commands.

      PI Universal Data Server 2.x

          PI Universal Data Server version 2.x comes pre-configured with applications that use some of the otherwise available point source characters.  For example, the Totalizer program uses the point source character T.  Also, the default point source character for PI points is L.  Accordingly, you should not use any of the following point source characters to associate PI points with the PI-Foxboro Interface:

          • C
          • ?
          • L
          • Q
          • T
          • @

          Of course, you also should not use any point source character that is already associated with another one of your interface programs.

          Before you create a PI point with a given point source, you must first add the point source character to the PI 2.x point source table.  That is, if point source F is not currently defined in the PI 2.x point source table, you cannot create a point with a point source of F.

          Defining a Point Source Character in the PI 2.x Point Source Table
          1. Enter PI by typing the following command from an OpenVMS command prompt:  
            @pisysexe:pi
          2. Select the PointSrc option from the menu.
          3. Select New from the menu.
          4. Assign a point source next to the Code: field.  Also, assign the following minimum and maximum values for the Location1 to Location5 attributes.
            Location1 Location2 Location3 Location4 Location5
          Minimum 100 0 -10 0 -86400
          Maximum 9900 210000000 10 1000 86400
          1. Select “Save” from the menu. 

      PI Universal Data Server 3.x

          PI Universal Data Server version 3.x comes pre-configured with applications that use some of the otherwise available point source characters.  In particular, the Totalizer program uses the point source character T; the Alarm program uses G and @; and the Performance Equations scheduler uses C.  In addition, the Random Interface Simulator uses R and the RampSoak Simulator uses 9.  Finally, the default point source character for PI points is L.  Accordingly, you should not use any of the following point source characters to associate PI points with the PI-Foxboro Interface:

          • 9
          • C
          • G
          • L
          • R
          • T
          • @

          Of course, you also should not use any point source character that is already associated with another one of your interface programs.

       

      Interface Point Configuration

          The PI point is the basic building block for controlling data flow to and from PI Universal Data Server.  A single point is configured for each measurement value that needs to be archived. Use the point attributes below to define what data to transfer.

      Point Attributes

          Every two minutes, PI-Foxboro checks the PI Universal Data Server for changes to PI points whose PointSource is associated with the Interface.  The Interface automatically incorporates these changes into its point list. 

          However, PI-Foxboro can process only 25 point changes every 30 seconds.  If more than 25 points are added, edited, or deleted, PI-Foxboro will process the first 25 points, wait 30 seconds, process the next 25 points, and so on.  As soon as the Interface has processed all point changes, it will resume checking for point updates every two minutes.

          Use the point attributes below to define how PI-Foxboro associates PI points with Foxboro I/A objects.

      Tag

          A tag is a label or name for a point.  There is a one-to-one correspondence between a tag and a point.  PI client applications such as PI-ProcessBook and PI-DataLink use this identifier as a means of referencing the values retrieved by PI-Foxboro.

          You may use any tag name that conforms to the normal PI point naming conventions.  See the PI Universal Data Server manual for the details regarding this naming convention.

          PI System documentation often uses the terms tag and point synonymously.

      InstrumentTag

          This is the Foxboro tag name (also called the I/A object) used for reading/writing from/to the I/A.  It may contain up to 32 characters in the compound:block.parameter or alias formats.  You should use the full Foxboro name with the proper case.

          If this field is empty, the Exdesc attribute (see below) determines the I/A object.  If both the Instrumenttag and Exdesc attributes contain an I/A object, then PI-Foxboro uses the I/A object specified in the former.

      ExDesc

          This is the extended descriptor attribute.

          Inputs

          For reading data from the I/A, the Extended Descriptor field has the form:

          EVENT=PItag, PROFILE=Profile_info, BTM=x,y,z...    ! comments

          Here, EVENT=PItag (or alternatively, TRIG=PItag, or TRG=PItag) is an optional specification for event/trigger tags.  The Interface must be connected to the PI Server to receive the notifications of new values for PItag.

          An input is triggered when a new value is sent to the Snapshot of the trigger point. The new value does not need to be different than the previous Snapshot value to trigger an input, but the timestamp of the new value must be greater than (more recent than) or equal to the timestamp of the previous value.  This algorithm is different than the trigger mechanism for output points.  For output points, the timestamp of the trigger value must be greater than (not greater than or equal to) the timestamp of the previous value.

          PROFILE=Profile_info is an optional field for reading profile points if the Foxboro profile library (libprofplot.so) is available.  A later section of this manual provides more information on reading profile points.

          BTM=x,y,z... is an optional field for bit masking values retrieved from I/A integer types.  The bit mask is x,y,z... where x is the bit location in the source (0-31 for long integers) whose value is put in the low order bit (0) in the target. Then y is the bit location in the source whose value is put in the next bit (1) in the target. Up to 31 bits can be put in the target, and unspecified target bits are set to 0.  An example is BTM=31,0,7,8.  This specification puts

          • bit 31 of the source to bit 0 of the target
          • bit 0 of the source to bit 1 of the target
          • bit 7 of the source to bit 2 of the target
          • bit 8 of the source to bit 3 of the target

          The value of the target is then placed in the PI tag.

          If the instrument tag field is empty, then the extended descriptor may be of the form

          FoxIA_tag_name  PROFILE=Profile_info, EVENT=PItag, BTM=x,y,z...    ! comments

          In the above, FoxIA_tag_name represents the I/A object.  PI-Foxboro reads up to 32 characters beginning in the left most position.  You should use the full Foxboro name with the proper case.

          PI-Foxboro no longer supports the MSG=IA_string_object_name specification. Instead, you should configure a PI string tag and set the Location2 field (described later) to 4 to indicate an I/A string type.

          Outputs

          Under normal circumstances, the Instrumenttag attribute contains the name of the I/A object and the Sourcetag attribute (described later) contains the name of the PI tag whose value will be written to the I/A.   Thus, the Extended Descriptor field should be blank for an output point.

          However, for backwards compatibility, you may use Exdesc to specify both the I/A object name and the PI source tag for output.  For example,

          FoxIA_tag_name SRC=PItag

          In the above, FoxIA_tag_name represents the I/A object.  PI-Foxboro reads up to 32 characters beginning in the left most position.  You should use the full Foxboro name with the proper case.

          The SRC=PItag indicates that when PItag receives a new value, PI-Foxboro sends this value to the corresponding I/A object.  For output points, the timestamp of the trigger value must be greater than (not greater than or equal to) the timestamp of the previous value.

          Performance Points

          The PI-Foxboro Interface checks the extended descriptor for the string “PERFORMANCE_POINT”. If it finds this character string, the Interface treats this point as a performance point. See the section called “Performance Points.”

      Source Tag

          For an output point, the source tag attribute contains the PI tag that provides the output value.  When this Sourcetag receives a new value, the Interface sends this value to the corresponding I/A object that is specified in the Instrument Tag.  The timestamp of this trigger value must be greater than (not greater than or equal to) the timestamp of the previous value.

          If this field is empty, then PI-Foxboro checks Exdesc for the name of the source tag.

      PointSource

          The PointSource is a single character used to identify a PI point as a point that belongs to a particular interface.  For additional information, see the description for the  -ps command line parameter and the Point Source section.

      PointType

          Typically, Foxboro point types do not need to correspond to PI point types.  For example, short integer values from the I/A can be sent to floating point or digital PI tags. Similarly, floating-point value from the I/A can be sent to integer or digital PI tags, although the values will be truncated.

          PI Universal Data Server 2.x

          PI-Foxboro supports the following PI 2.x point types:

          • Digital
          • Integer
          • Real (scaled)
          • Real (full precision)

          For more information on the individual point types, refer to the Data Archive (DA) section of PI System Manual I.

          PI Universal Data Server 3.x

          PI-Foxboro supports the following PI 2.x point types:

          • Digital
          • Int16
          • Int32
          • Float16
          • Float32
          • Float64
          • String

          For more information on the individual point types, see PI Universal Data Server Manual.

       

          The I/A point types and data ranges are listed in a table under the description of the Location3 point attribute (described later).

          For input tags, PI-Foxboro converts the I/A value to the destination PI point type and value.  However, please note that the point type of the PI tag limits the value that can be stored.  That is, if the PI tag is of type Int16 (PI 3.x) or Integer (PI 2.x), the Interface can store numbers in the range 0 to 32,767 only.

          For a PI input digital tag, the I/A value is sent as a positive offset into the specified PI digital set.

          For output tags, PI-Foxboro converts the PI tag’s value to the destination I/A point type and value.

      Location1

          The Location1 attribute associates a point with a particular copy of PI-Foxboro.  Location1 is a positive integer from 100 to 9900, inclusive.  Its value is 100 times the -id= parameter used in the startup command file (described later). 

          For example, if -id=1 then you should set Location1 to 100.

      Location2

          The Location2 attribute determines whether the Interface adds the point to a FoxAPI data set and retrieves “buffered” values from the FoxAPI.  Buffered values are those updated by the FoxAPI in the system-shared memory.  Unbuffered access to I/A objects makes requests to the Foxboro CP for each data retrieval call.  OSIsoft recommends the use of buffered access to reduce the load on the Foxboro system.

          The value of Location2 is the PI list number.  Set the value of Location2 to a positive number to indicate that PI-Foxboro should use buffered access to retrieve I/A data.  For tags with a common value of Location2, the Interface groups these tags into a list for use with the FoxAPI scopen() call.  This FoxAPI function returns a unique data set number, which may be different than the Location2 value.

          Tags for read values must be in a PI list that is separate than those tags for write values.  Tags referencing I/A objects from different Foxboro CP modules must also be in different PI lists. 

          To indicate that the Interface should use unbuffered access to I/A objects, set Location2 to 0.  Access to I/A string data is always unbuffered.

          In summary,

          I/A data access method Location2
          Unbuffered 0
          Buffered >0 (PI list number)
       

          Some customers have experienced performance problems when there are many (~250) tags in a PI List.  So, you may want to keep the size of a PI List within this number.

          Upon processing a PI list (i.e., points with a common positive Location2), the Interface enters this list into the FoxAPI shared memory as a data set named PILISTxxLyyy.  The first two digits (xx) refer to the interface number as defined by the –id= startup parameter.   The next 3 digits (yyy) refer to the Location2 number. 

          For example, for points with Location2 equal to 5 and processed by a copy of the Interface running with –id=1, the FoxAPI data set named PILIST01L5 is created.

      Location3

          The Location3 attribute indicates the I/A point type and direction of data transfer.  For the transfer of data from the I/A to PI (input), Location3 is positive.  Otherwise, it is negative.

          Location3 I/A Type I/A Data Range
           1 1, char '0' to '9'
           2 2, short integer -32768 to 32767
           3 3, float 1.175E-38 to 3.402E+38
           4 4, string up to 256 bytes
           5 5, Boolean 0 and 1
           6 6, long integer -2,147,483,648 to 2,147,483,647
           8 8, short integer 0 to 255
           9 9, packed Boolean 0 to 65535
          10 10, long packed boolean 0 to 4,294,967,295

       

          Examples
          Location3 I/A Type Data Transfer
          2 short integer I/A to PI
          -3 float PI to I/A

          However, regardless of the Location3 value, PI-Foxboro checks with the FoxAPI to determine the correct data type of the I/A object.  The Interface writes to the PI Message Log occurrences of point type mismatches and uses the correct type internally.  The user should then correct the value of Location3.

          For output points (transfer of data from PI to the I/A), remember to configure an appropriate output source point.  Please see the Source Tag attribute description above.

      Location4

          Scan-Based Inputs

          The PI-Foxboro Interface supports scan-based collection of data.  So, the Location4 attribute defines the scan class for the PI point.  This scan class determines the frequency at which input points are scanned for new values. 

          A scan class number is a positive integer.  It refers to the instance of the appearance of the –f= parameter (described later) in the PI-Foxboro startup command file.  For example, if the file contains the following command

               fxbais –f=2 –f=5 –f=8 ...

          then three scan classes are defined:  1, 2, and 3. 

          In the above example, for tags with Location4 set to 1, PI-Foxboro reads values from the I/A once every 2 seconds (–f=2).  For tags with Location4 set to 2, the Interface reads once every 5 seconds (–f=5).

          For more information, see the description of the -f flag in the section called “The Startup Command File”.

          Event-Based Inputs and Output Points

          Location4 should be set to zero for these points.

      Location5

          The Location5 attribute is normally 0.  If it is non-zero, it is used to total a PI-Foxboro list’s I/A object change counts.  Please refer to Appendix A, Error Messages and Troubleshooting for details.

      UserInt1

          The UserInt1 attribute, in conjunction with the BadStatusIndication key of the fxbais.ini file, tells the Interface how to proceed if it receives a value for an I/A object that has its bad bit (bit 8) set.  Please see the Initialization File section of this manual for more information.

          The UserInt1 field also causes the Interface to print point-specific debugging messages.  Please refer to Appendix A, Error Messages and Troubleshooting for details.

      Scan

          By default, the Scan attribute has a value of 1, indicating 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, PI-Foxboro writes the SCAN OFF digital state to the point. If you change the scan attribute from 1 to 0 while the Interface is running, PI-Foxboro also will write SCAN OFF to the point after it has detected this point attribute change.

          There is one other situation, which is independent of the Scan attribute, where PI-Foxboro will write SCAN OFF to a PI point. If a point that is currently loaded by the Interface is edited so that the point is no longer valid for the Interface, PI-Foxboro removes the point from the interface, and writes SCAN OFF to the point. For example, if you change the PointSource of a PI point that is currently loaded by PI-Foxboro, it will no longer service the point and write SCAN OFF to it.

      Shutdown

      PI Universal Data Server 2.x

          PI Universal Data Server 2.x does no have a Shutdown attribute. For information on configuring shutdown events for PI 2.x, see Data Archive (DA) section 4.2.3 of PI System Manual I.

      PI Universal Data Server 3.x

          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 the PI Universal Data Server manuals.

          By setting the Shutdown attribute to 0 for each point, you can disable SHUTDOWN events from being written to PI Universal Data Server when PI Universal Data Server restarts. 

          Alternatively, you can change the default behavior of the PI Shutdown Subsystem as described above.  You will need to edit the Shutdown.dat file to do so.  Please see the PI Universal Data Server manuals.

          Note: The SHUTDOWN events that are written by the PI Shutdown subsystem are independent of the SHUTDOWN events that are written by the Interface when you specify the -stopstat=Shutdown command-line parameter.

      Bufserv

          It is undesirable to write shutdown events when Bufserv (PI Buffer Server) is being used.  Bufserv is a utility program that provides the capability to store and forward events to a PI Server, allowing continuous data collection when the Server is down for maintenance, upgrades, backups, and unexpected failures.  That is, when PI is shut down, Bufserv will continue to store data collected by the interface, making it undesirable to write SHUTDOWN events to the PI points serviced by this interface.

      Exception Specifications

          PI-Foxboro utilizes exception reporting.  As such, you should set appropriate values for the following tag attribute fields:

      • exception deviation
      • exception minimum time
      • exception maximum time

          Consult the PI Universal Data Server manuals for a detailed explanation of exception reporting.

      Other Attributes

          There are additional tag attribute that are not unique to PI-Foxboro but are required for proper operation.  These are:

      • compression flag
      • compression deviation
      • compression minimum time
      • compression maximum time
      • archiving flag
      • step

          For PI digital tags, the following attributes should be configured:

      • digital set  (for PI 3.x)
      • first digital state and additional digital states (for PI 2.x)

          For PI 2.x, the user should be aware that the following fields affect how values are stored in the archive:

      • precision
      • zero
      • span
      • resolution code

          Consult the PI Universal Data Server manuals for a detailed explanation of all these attributes.

      Point Configuration Examples

          The interface distribution contains point configuration examples in a comma-delimited file (examples_pts.csv) for use with PI-SMT and Microsoft Excel.  However, if you are running PI 2.x, you will need to make modifications both to the attributes (e.g., DigitalSet) and values (e.g., Int32).

          The following table summarizes the various point configurations and the values for the InstrumentTag, Sourcetag, and the Location attributes.

            Loc2 Loc3 Loc4 Loc5 Instrumenttag Sourcetag
          Buffered Inputs > 0 > 0 > 0 0 I/A object -
          Buffered Outputs > 0 < 0 * > 0 0 I/A object PI value to be written
          Unbuffered Inputs 0 > 0 > 0 0 I/A object -
          Unbuffered Outputs 0 < 0 0 0 I/A object PI value to be written

          *For Buffered Outputs, a positive Location4 value is needed to set a frequency for the FoxAPI.  However, the Interface does not use this value.

      Profile Points

          If the Foxboro profile library (libprofplot.so) is available, you may configure PI points so that PI-Foxboro reads I/A profile data points.  Three types of profile data points are available:

      • profile trigger points
      • profile array position points
      • profile discrete points

          The point attribute fields are the same as above, except for the Exdesc and Location2 fields.  The Interface ignores the value in the Location2 field because the reading of I/A profile points is always unbuffered.

          Retrieval of profile points is not available on Windows NT.

          Profile Trigger

          For profile trigger points, the Extended Descriptor field contains the following:

          PROFILE=SCAN

          The instrument tag field should refer to an I/A object whose value is a timestamp.  Although the value of the referenced I/A object is a timestamp, the Interface records into the profile trigger tag this I/A object’s change in value.  (At startup, the Interface records a value of 0 for the initial value of the profile trigger tag.)  It is the change in value of the I/A object that triggers the reading of profile array position points or profile discrete points.

          The timestamp associated with the profile trigger tag is the value of the referenced I/A object.  The point type of a profile trigger must be numeric.  That is, it cannot be digital, string, or blob.

          Profile Array Position

          For profile array position points, the Extended Descriptor field contains the following:

          PROFILE=###   EVENT=PITrigTag1

          The above specification indicates that when the profile trigger tag PITrigTag1 changes value, the Interface reads the value in the profile array position ###.  Here, ### is a numeric entry. 

          The Interface uses the FoxAPI function PRaryrdel() to obtain the values for profile array positions points.  The timestamp associated profile array position points is the value of the I/A object referenced by the profile trigger tag.

          Profile Discrete

          For profile discrete points, the Extended Descriptor field contains the following:

          PROFILE=DISCRETE   EVENT=PITrigTag2

          This specification indicates that when the profile trigger tag PITrigTag2 changes value, the Interface reads the value of the I/A object referenced in the instrument tag field of this profile discrete tag. 

          The Interface uses the FoxAPI function uread() to obtain the values for profile discrete points.  The timestamp associated profile array position points is the value of the I/A object referenced by the profile trigger tag.

           

       
       

      Performance Point Configuration

          You can configure a Performance Point to monitor the amount of time in seconds that the Interface takes to complete a scan for a particular scan class. The closer the scan completion time is to 0 seconds, the better the performance. This scan completion time is recorded to millisecond resolution

      Configuring Performance Points with PI-ICU

          The PI-Interface Configuration Utility (PI-ICU) provides a graphical user interface for creating and managing Performance Points.

       

          To create or delete a Performance Point, right mouse click the line belonging to the tag to be created, and click Create or Delete.  If a tag already exists, the status is marked “Created”, and the Delete option will be enabled.  If a tag does not exist, the status is marked “Not Created” or “Deleted”, and the Create option is enabled.

          The Performance Points are created with the following PI attribute values:

          Attribute Details
          Tag Tag name that appears in the list box
          Point Source Point Source for tags for this interface, as specified on the first tab
          Compressing Off
          Excmax 0
          Descriptor Interface name + " Scan Class # Performance Point"
       

          Status

          The Status column in the Performance Points table indicates whether the Performance Point exists for the scan class in column 2.  If a Performance Point does exist, a status of “Created” is displayed.  If the Performance Point does not exist, a status of “Not Created” is displayed.  If a Performance Point exists, and is deleted, a status of “Deleted” is displayed.

          Scan Class

          The Scan Class column indicates to which scan class the Performance Point in the Tagname column belongs.  There will be one scan class in the Scan Class column for each scan class listed in the Scan Classes combo box on the Uniint Parameters tab.

          Tagname

          The Tagname column holds the Performance Point tag name.

      Configuring Performance Points Manually

          Performance Point configuration is the same on all operating system platforms. Performance points are configured as follows.

          1. Set the extended descriptor to: 
            PERFORMANCE_POINT 
            or to: 
            PERFORMANCE_POINT=interface_id 
            where interface_id corresponds to the identifier that is specified with the -id parameter on the startup command line of the Interface.  The character string PERFORMANCE_POINT is case insenstive. The interface_id does not need to be specified if there is only one copy of an interface that is associated with a particular point source.
          2. Set Location4 to correspond to the scan class whose performance is to be monitored. For example, to monitor scan class 2, set Location4 to 2.  See the -f parameter for a description of scan classes.
          3. Set the PointSource attribute to correspond to the -ps parameter on the startup command line of the Interface.
          4. Set the PointType attribute to float32 (PI 3.x) or Full Precision Real (PI 2.x).
       

      I/O Rate Point Configuration

          An I/O Rate point measures the throughput of an Interface.  In particular, the value of an I/O Rate point represents a 10-minute average of the total number of values per minute sent by the Interface to the PI Universal Data Server.  Because values are averaged over a 10-minute interval, the first value is not written to PI Universal Data Server until 10 minutes after the Interface has started.  You can configure one I/O Rate point for each copy of the Interface that is in use.

          PI System documentation often use the terms Event Counter Tag and I/O Rate Point synonymously.

      Monitoring I/O Rate Points

          Because an I/O Rate point is a PI point, you can use standard PI client applications to monitor its value.  For example, you can use PI-ProcessBook to build and view a trend that displays the most recent 8-hour values for an I/O Rate point.

          On PI Universal Data Server 2.x, you can run the PISysExe:IOMonitor.exe program to monitor I/O Rate points.

      Configuring I/O Rate Points with PI-ICU

          The PI-Interface Configuration Utility (PI-ICU) provides a graphical user interface for creating and managing I/O Rate Points.

       

          PI-ICU currently allows for one I/O Rate point to be configured for each copy of the Interface that is in use.

          PI-Foxboro supports multiple I/O Rate points.  The Startup Command File section provides more information on these additional I/O Rate points.

      Enable IORates for this Interface

          The Enable IORates for this interface check box enables or disables the I/O Rate point for the Interface. To disable the I/O Rate point, uncheck this box.  To enable the I/O Rate point, check this box.

          Tag Status

          The Tag Status column indicates whether the I/O Rate point currently exists in PI Universal Data Server. The possible states are:

          • Created – This status indicates that the point exists in PI Universal Data Server
          • Not Created – This status indicates that the point does not yet exist in PI Universal Data Server
          • Deleted – This status indicates that the point has just been deleted
          • Unknown – This status indicates that the PI-ICU is not able to access PI Universal Data Server
          In File

          The In File column indicates whether the I/O Rates point listed in the Tagname column and the event counter number listed in the Event Counter column are in the IORates.dat file.  The possible states are:

          • Yes – This status indicates that the I/O Rate point and the event counter number are in the IORates.dat file
          • No – This status indicates that the I/O Rate point and the event counter number are not in the IORates.dat file
          Event Counter

            The Event Counter number correlates a point specified in the IORates.dat file with this Interface.  This correlation results from the command line parameter

               -ec=x

            where x is the same number that is assigned to the point named in the IORates.dat file.

          Tagname

            The tag name listed under the Tagname column is the name of the I/O Rates point.

      Right Mouse Button Menu Options

          If the Enable IORates for this interface box is checked, you can use the right mouse button to bring up the following menu options.

          Create

          Creates the suggested I/O Rates point with the tag name indicated in the Tagname column.

          Delete

          Deletes the I/O Rate point listed in the Tagname column.

          Rename

          Allows you to specify a new name for the I/O Rate point listed in the Tagname column.

          Add to File

          Adds the I/O Rate point and the event counter number to the IORates.dat file.

          Search

          Allows you to search the PI Universal Data Server for points, such as previously defined I/O Rate points.

      Configuring I/O Rate Points Manually

          There are two main steps.  The first occurs on PI Universal Data Server and the second on the computer on which the Interface runs.

      Configuring the PI Point on the PI Server

      PI 2.x

          Create an I/O Rate point via the following steps:

          1. Enter PI by typing the following command from an OpenVMS command prompt: @pisysexe:pi
          2. Select the Point Bld option from the menu.
          3. Create the I/O Rate point by using the existing tag named SYARC001 as a template.

      PI 3.x

          Create an I/O Rate Point with the following PI point attribute values.

            Attribute Value
            PointSource L
            PointType float32
            Compressing 0
            ExcDev 0

       

      Configuration on the Interface Node

          The following procedure for I/O Rate point configuration on the interface node assumes that the tag name of this point is syfxbais01.  An interface node is the computer on which the Interface runs.  Recall that the PI-Foxboro Interface runs only on a PI-API node.

      Windows NT PI-API node

          1. Edit or create the file named iorates.dat in the dat subdirectory of the directory where the PI-API was installed.  You can find out the name of this PI-API directory by looking at the pipc.ini file located in the Windows NT directory (typically, C:\WinNT).  The pipc.ini file contains an entry for PIHOME and PIPCSHARE.  The PI-API directory is given either by the value for PIPCSHARE (if both PIHOME and PIPCSHARE exist in pipc.ini) or by the value for PIHOME (if only PIHOME exists).

            Because PIHOME is typically C:\program files\PIPC, the full name of the iorates.dat file is typically C:\program files\PIPC\dat\iorates.dat.

            In the iorates.dat file, add the tag name of the I/O Rate point; followed by a comma; and finally, followed by a number between 2 and 34 or between 51 and 200, inclusive.  For example:

            syfxbais01,11

          1. Set the value for the -ec parameter in the Interface’s startup command file (described later) to be the same number as that entered in the iorates.dat file.  For the above example,

            fxbais.exe –ec=11 ...

          Because you have made changes to the Interface’s startup command file, you need to stop and restart the Interface for these changes to take effect.

       

      Solaris PI-API node

          1. Edit or create the file named iorates.dat in the dat subdirectory of the directory where the PI-API was installed.  Because PIHOME is typically /opt/piapi, the full name of the iorates.dat file is typically /opt/piapi/dat/iorates.dat.

            In the iorates.dat file, add the tag name of the I/O Rate point; followed by a comma; and finally, followed by a number between 2 and 34 or between 51 and 200, inclusive.  For example:

            syfxbais,11

          1. Set the value for the -ec parameter in the Interface’s startup command file (described later) to be the same number as that entered in the iorates.dat file.  For the above example,

            fxbais –ec=11 ...

          You must then stop the I/O Rate shared memory server and the I/O Rate monitor program for the changes in iorates.dat to take effect.  The easiest way to do this is to stop and re-start the PI-API processes.  For example,

            $ sh $PIHOME/bin/pistop

            $ nohup sh $PIHOME/bin/pistart

          You can determine whether the I/O Rate shared memory server and the I/O Rate monitor programs are running by using the commands:

            $ ps –ef | grep ioshmsrv

            $ ps –ef | grep iorates

       

       

      Startup Command File

      Program Executable Name

          The name of the PI-Foxboro Interface executable program is one of the following:

          Name Operating System Foxboro Library Required
          fxbais.exe Windows NT FoxAPI
          fxbais Solaris FoxAPI
          fxbaisnet Solaris netFoxAPI

          (The name fxbais is a relic from previous versions of the Interface). 

      Using PI-ICU to maintain the Startup Command File

          On Windows NT, the PI-Interface Configuration Utility (PI-ICU) is a graphical tool that allows you to configure the Interface’s startup command file.  When you use the PI-ICU, select “fxbais” for the Type of interface.  That is,

       

          The interface-specific tab (i.e., “fxbais”) allows you to enter values for the startup parameters that are particular to PI-Foxboro.  That is,

       
       

          The PI-Foxboro control for PI-ICU has various sections. A yellow text box indicates that an invalid value has been entered, or that a required value has not been entered.

          Additional I/O rate counter numbers

          Because it is a UniInt-based interface, PI-Foxboro supports the standard I/O Rate point.  This I/O Rate point measures the number of events per minute that the Interface sends to PI Universal Data Server.  However, PI-Foxboro also allows you to keep track of

          • the number of buffered outputs per minute that it sends to the I/A,
          • the number of unbuffered inputs per minute that it sends to PI Universal Data Server, and
          • the number of unbuffered outputs per minute that it sends to the I/A.

          To enable these additional I/O Rate counters, select the appropriate check box (e.g., buffered outputs).  Then, enter an I/O Rate counter number in the text box next to the check box.  This number must be between 2 and 34, or between 51 and 200, inclusive.

          Please note that the PI-Foxboro ICU control merely supplies the appropriate command line parameters to the startup command file.  In order to fully enable these additional I/O Rate points, you must also

          • create these I/O Rate point on the PI Server, and
          • edit the IORates.dat file to reference these I/O Rate points with the I/O Rate counter numbers.
          Failover

          You may run the PI-Foxboro Interface in a failover configuration.  If a copy of the Interface is configured as the Primary node, it is responsible for collecting data whenever it is running.  If a copy of the Interface is configured as the Secondary node, it collects data only after it detects that the Primary node is not currently running. 

          There are many additional parameters that need to be configured in order for Failover to work.  You enter these parameters by editing the fxbais.ini configuration file.

          Appendix B describes Failover in more detail.

          Outputs

          To enable the PI-Foxboro Interface to write data to the Foxboro you must check the enable outputs box.

          Configuration File

          You may further customize the behavior of PI-Foxboro by creating a configuration file called fxbais.ini.  This file is not needed for normal interface operation.  Use this file only if you need special behavior for the Interface.

          This fxbais.ini file resides in the same directory as the interface executable (fxbais / fxbais.exe / fxbaisnet).  The contents of fxbais.ini should have the following format:

            [fxbais-1]

            ; comment lines begin with a semi-colon

            ; lines in this file have the format

            ;   key=value

            ;

            ; BadStatusIndication=1

            ; FirstSetReopen=60

            ; SetReopen=24

            ; EditSetReopen=35

            ; HibernateDealy=100

          The [fxbais-1] section indicates that the entries below it pertain to the copy of PI-Foxboro running with –id=1.  (For a copy of PI-Foxboro running with –id=2, put in a section called [fxbais-2], and so on.)  The following sections describe the meaning of the different keys and their values.

          BadStatusIndication

          The BadStatusIndication key tells the Interface how to proceed if it receives a value for an I/A object that has its bad bit (bit 8) set.  The following table describes the behavior:

          BadStatusIndication Value written to PI
          1 Bad Input
          2 I/A value, with PI questionable bit set (PI 3.x only)
          3 I/A value

          If the value of BadStatusIndication is 0, then the Interface looks at an individual tag’s UserInt1 point attribute field for information on how to proceed. 

          UserInt1 Value written to PI
          1 Bad Input
          2 I/A value, with PI questionable bit set (PI 3.x only)
          3 I/A value

          The default value for BadStatusIndication is 1.  That is, the Interface writes Bad Input when the I/A object’s bad bit is set.

       

          FirstSetReopen

          SetReopen

          When an attempt by PI-Foxboro to open a FoxAPI data set fails, the Interface will try to reopen this data set after FirstSetReopen seconds and again every SetReopen hours.  The default value is 60 seconds for the former and 24 hours for the latter.  Fractional values for SetReopen are allowed.  To prevent the reopening of a set, enter a value of 0 for either FirstSetReopen or SetReopen.

       

          EditSetReopen

          If you edit a tag that is part of a FoxAPI data set, the Interface waits EditSetReopen seconds before closing and reopening the set.  The default value of EditSetReopen is 35 seconds.

          HibernateDelay

          After it has finished opening all its data sets, the Interface waits HibernateDelay milliseconds before checking the I/A for new values.  The default value of HibernateDelay is 100 milliseconds

       

          Debugging

          To troubleshoot anomalous behavior of the Interface, you may enable one or more debugging parameters.  These parameters tell the Interface to print informational messages to the pipc.log (Windows NT) or pimesslogfile (Solaris) message log file (described later).

          You should not use these debugging parameters during the normal operation of the Interface.

          Opening data sets

          Enabling this parameter tells the Interface to print information regarding the return status of the FoxAPI scopen() function.  The Interface uses scopen() when it encounters PI points whose Location2 value is positive.

          Setup of profile library tags

          Enabling this parameter tells the Interface to print information when there is a point configured as a profile trigger point.

          Reading profile library tags

          Enabling this parameter tells the Interface to print information regarding the profile values read via the FoxAPI function PRaryrdel().

          PI Server time offset

          Enabling this parameter tells the Interface to print information regarding time offset between the computer running the Interface and the computer running PI Universal Data Server.  The Interface prints this information every 10 minutes.

          Point loading

          Enabling this parameter tells the Interface to print detailed information regarding points that it has either loaded or not loaded.

          Shutdown

          Enabling this parameter tells the Interface to print information regarding shutdown signals received.  In addition, the Interface displays a message when it tells the FoxAPI to close a data set.

          Close all data sets

          Unlike other debugging parameters, this one modifies the behavior of the Interface.  Enabling this parameter tells the Interface to close all FoxAPI data sets, even those that it did not open.

          Buffered outputs

          Enabling this parameter tells the Interface to print a message when a buffered output fails.

          Outputs in general

          Enabling this parameter tells the Interface to print information regarding outputs.  You should enable this parameter if you have having problems with using PI-Foxboro to send data from PI to the I/A.

          Detailed data set opening

          Enabling this parameter tells the Interface to print detailed information regarding the return status of the FoxAPI scopen() function.  The Interface uses scopen() when it encounters PI points whose Location2 value is positive.

          Additional Parameters

          The Additional Parameters text box allows you to enter additional startup parameters.

      Notes on command files for Windows NT

          For Windows NT, various filename extensions are associated with command files.  For example, .bat and .cmd are both acceptable.  However, only the .bat extension is valid for a command file used by the Interface.

          The Window NT continuation character (^) allows you to use multiple lines for the startup command.  The maximum length of each line is 1024 characters (1 kilobyte). The number of parameters is unlimited, and the maximum length of each parameter is 1024 characters.

      Notes on command files for Solaris

          For Solaris, the name of a command file typically has a .sh extension.  However, Solaris does not enforce file-naming conventions.  The backslash (\) continuation character allows you to use multiple lines for the startup command.  There is no limit to the command-line length and there is no limit to the number or length of the command line parameters.

      Command-Line Parameters

          The PI-Foxboro program requires a number of parameters for proper operation.  These parameters may appear in any order on the command line.  The dash character (-) precedes each parameter.

          Note: The UniInt End User Document includes details about other command line parameters that may be useful.

       
          Parameter Description
          -write

          Optional

          The -write parameter enables the Interface to send data from PI to the I/A.  If you omit the -write parameter, the Interface does not load output points.
          -ecout=x

          Optional

          The -ecout parameter specifies the I/O Rate counter number for measuring the rate of buffered outputs from PI to the I/A.  The value of x should be between 2 and 34, inclusive, or 51 and 200, inclusive.
          -ecuinp=x

          Optional

          The -ecuinp parameter specifies the I/O Rate counter number for measuring the rate of unbuffered inputs from the I/A to PI.  The value of x should be between 2 and 34, inclusive, or 51 and 200, inclusive.
          -ecuout=x

          Optional

          The -ecuout parameter specifies the I/O Rate counter number for measuring the rate of unbuffered outputs from PI to the I/A.  The value of x should be between 2 and 34, inclusive, or 51 and 200, inclusive.
          -foxserver=host

          Required if netFoxAPI is used

          The -foxserver parameter specifies the name of the netFoxAPI server machine.  If you are not using the netFoxAPI, do not specify this parameter.
          -failover

          Optional

          Specify –foxserver=primary or –foxserver=secondary if you want to run the Interface in a failover configuration.  There are many additional parameters that need to be configured in order for Failover to work.  You enter these parameters by editing the fxbais.ini configuration file.  Appendix B describes Failover in more detail.
          -fdb

          Optional

          To troubleshoot anomalous behavior of the Interface, you may enable one or more debugging parameters via –fdb.  These parameters tell the Interface to print informational messages to the pipc.log (Windows NT) or pimesslogfile (Solaris) message log file (described later).

          Appendix A describes Interface Troubleshooting in more detail.

          -ps=x

          Required

          The –ps parameter specifies the point source character for the Interface.  Each instance of PI-Foxboro uses the –ps and –id parameters to identify uniquely its particular list of points to service. 

          The value for the –ps parameter is not case sensitive.  That is, –ps=F is identical to –ps=f.

          -id=x

          Required

          The -id parameter specifies the Interface number from 1 to 99, inclusive.  Each instance of PI-Foxboro uses the –ps and –id parameters to identify uniquely its particular list of points to service.
          -f=SS 
          or 
          -f=SS,SS 
          or  
          -f=HH:MM:SS 
          or 
          -f=HH:MM:SS,hh:mm:ss  

          Required for reading scan-based inputs

           
          The -f parameter defines the time period between scans in terms of hours (HH), minutes (MM), and seconds (SS).  The scans can be scheduled to occur at discrete moments in time with an optional time offset specified in terms of hours (hh), minutes (mm), and seconds (ss). If HH and MM are omitted, then the time period that is specified is assumed to be in seconds.

          Each instance of the -f parameter on the command line defines a scan class number for the Interface. There is no limit to the number of scan classes that can be defined.  The first occurrence of the -f flag on the command line defines the first scan class of the Interface, the second occurrence defines the second scan class, and so on.

          PI Points are associated with a particular scan class number via the Location4 attribute. For example, all PI Points that have Location4 set to 1 will receive input values at the frequency defined by the first scan class.  Similarly, all points that have Location4 set to 2 will receive input values at the frequency specified by the second scan class, and so on.

          Two scan classes are defined in the following example: 
          /f=00:01:00,00:00:05 /f=00:00:07 
          or, equivalently: 
          /f=60,5 /f=7 
          The first scan class has a scanning frequency of 1 minute with an offset of 5 seconds, and the second scan class has a scanning frequency of 7 seconds.

          When an offset is specified, the scans occur at discrete moments in time according to the formula:

          scan times = (reference time) + n(frequency) + offset

          where n is an integer and the reference time is midnight on the day that the Interface started.  In the above example, frequency is 60 seconds and offset is 5 seconds for the first scan class.  These numbers mean that if the Interface started at 05:06:06, the first scan would be at 05:06:10, the second scan would be at 05:07:10, and so on. Since no offset is specified for the second scan class, the absolute scan times are undefined.

          The definition of a scan class does not guarantee that the associated points will be scanned at the given frequency. If the Interface is under a large load, then some scans may occur late or be skipped entirely.  See the section called “Performance Point Configuration” for more information on skipped or missed scans.

           

          Wall Clock Scheduling

          Scan classes that strictly adhere to wall clock scheduling are now possible. This feature is available for PI-Foxboro.  Previously, wall clock scheduling was possible, but not across daylight savings time. For example, -f=24:00:00,08:00:00 corresponds to one scan a day starting at 8 AM.  However, after a Daylight Savings Time change, the scan would occur either at 7 AM or 9 AM, depending upon the direction of the time shift.  To schedule a scan once a day at 8 AM (even across daylight savings time), you should use /f=24:00:00,00:08:00,L.  The ,L at the end of the scan class tells the Interface to use the new wall clock scheduling algorithm.

          -host=host:port

          Optional, but recommended

          The –host parameter is used to specify the PI Universal Data Server machine.  host is either the IP address of the PI Sever node or the TCP/IP name of the PI Server node.  port is the TCP port number for TCP/IP communication. The port is always 5450 for a PI 3.x Server and 545 for a PI 2.x Server.

          OSIsoft recommends that you explicitly define the host and port on the command line by using the -host parameter.  Nevertheless, if either the host or port is not specified, the Interface will attempt to use defaults.

          Defaults:

          On Solaris, the default port number and PI Server name is specified in the piclient.ini file.

          On Windows NT, the default port number and PI Server name is specified in the pilogin.ini or piclient.ini file.  The piclient.ini file is ignored if a pilogin.ini file is found. 

          Refer to the PI-API Installation Instructions manual for more information on the piclient.ini and pilogin.ini files.

          Examples: 
          The Interface is running on a PI-API node, the name of the PI 3.x Server is marvin, and the IP address of Marvin is 206.79.198.30. Valid -host parameters would be: 
          -host=marvin                       
          -host=marvin:5450  
          -host=206.79.198.30 
          -host=206.79.198.30:5450

          -stopatat= 
          digstate

          Optional

          If -stopstat=digstate is present on the command line, then the digital state, digstate, will be written to each PI Point when the Interface stops.  For a PI 3.x Server, digstate must be in the system digital state table. For a PI 2.x Server, where there is only one digital state table available, digstate must simply be somewhere in the table. UniInt uses the first occurrence in the table.

          If -stopstat=digstate is not specified on the command line, then no digital state will be written when the Interface shuts down.

          Example: 
          -stopstat=”Intf shut”

          The entire parameter is enclosed within double quotes when there is a space in digstate.

          -ec=x

          Optional

          The -ec parameter on the command line is used to specify a counter number, x, for an I/O Rate point.  The value of x should be between 2 and 34, inclusive, or 51 and 200, inclusive.

          Configuration of an I/O Rate point is discussed in the section called “I/O Rate Point Configuration”.

          -q

          Optional

          When the -q parameter is present, Snapshots and Exceptions are queued before they are sent to the PI Server node.  The maximum queue size is close to 4000 bytes. The queue is flushed between scans if it is not filled.

      Configuration File

          You may further customize the behavior of PI-Foxboro by creating a configuration file called fxbais.ini.  This file is not needed for normal interface operation.  Use this file only if you need special behavior for the Interface.

          This fxbais.ini file resides in the same directory as the interface executable (fxbais / fxbais.exe / fxbaisnet).  The contents of fxbais.ini should have the following format:

            [fxbais-1]

            ; comment lines begin with a semi-colon

            ; lines in this file have the format

            ;   key=value

            ;

            ; BadStatusIndication=1

            ; FirstSetReopen=60

            ; SetReopen=24

            ; EditSetReopen=35

            ; HibernateDealy=100

          The [fxbais-1] section indicates that the entries below it pertain to the copy of PI-Foxboro running with –id=1.  (For a copy of PI-Foxboro running with –id=2, put in a section called [fxbais-2], and so on.)  The following sections describe the meaning of the different keys and their values.

          BadStatusIndication

          The BadStatusIndication key tells the Interface how to proceed if it receives a value for an I/A object that has its bad bit (bit 8) set.  The following table describes the behavior:

          BadStatusIndication Value written to PI
          1 Bad Input
          2 I/A value, with PI questionable bit set (PI 3.x only)
          3 I/A value

          If the value of BadStatusIndication is 0, then the Interface looks at an individual tag’s UserInt1 point attribute field for information on how to proceed. 

          UserInt1 Value written to PI
          1 Bad Input
          2 I/A value, with PI questionable bit set (PI 3.x only)
          3 I/A value

          The default value for BadStatusIndication is 1.  That is, the Interface writes Bad Input when the I/A object’s bad bit is set.

          FirstSetReopen

          SetReopen

          When an attempt by PI-Foxboro to open a FoxAPI data set fails, the Interface will try to reopen this data set after FirstSetReopen seconds and again every SetReopen hours.  The default value is 60 seconds for the former and 24 hours for the latter.  Fractional values for SetReopen are allowed.  To prevent the reopening of a set, enter a value of 0 for either FirstSetReopen or SetReopen.

          EditSetReopen

          If you edit a tag that is part of a FoxAPI data set, the Interface waits EditSetReopen seconds before closing and reopening the set.  The default value of EditSetReopen is 35 seconds.

          HibernateDelay

          After it has finished opening all its data sets, the Interface waits HibernateDelay milliseconds before checking the I/A for new values.  The default value of HibernateDelay is 100 milliseconds

      Seldom Used Parameters

          The following command line parameters to the Interface are rarely used.  They are included here in case you want to change the default behavior.  These parameters are all optional.

          Parameter Description
          -doubtful= 
          digstate

          Optional

          When the Interface receives a value for an I/A object that has its bad bit (bit 8) set, it usually writes the Bad Input digital state to the corresponding PI tag.  (See the discussion on BadStatusIndication above.)  If you want another digital state written, use the -doubtful parameter and specify another digital state.  For example,

          fxbais –ps=F "–doubtful=Invalid Data" ...

          Notice that you need to use quotation marks if the digital state contains a space.

          -doubtful= 
          digstate

          Optional

          When the Interface receives a value for an I/A object that has its object connection status bits (bits 5, 6, or 7) set to something other than “being scanned” (1), it writes the Bad Input digital state to the corresponding PI tag.  If you want another digital state written, use the –no_connect parameter and specify another digital state.  For example,

          fxbais –ps=F "–no_connect=I/O Timeout" ...

          Notice that you need to use quotation marks if the digital state contains a space.

       

      Sample fxbais.bat file

          On Windows NT, the following is an example startup command file:

          fxbais.exe -ps=F -id=1 -q -write -host=piserver:5450 ^

          "-stopstat=Intf Shut" -f=4 -f=6

      Sample fxbais.sh file

          FoxAPI

          On Solaris, the following is an example startup command file for the Interface using FoxAPI:

          fxbais -ps=F -id=1 -q -write -host=piserver:5450 ^

          "-stopstat=Intf Shut" -f=4 -f=6

       

          netFoxAPI

          On Solaris, the following is an example startup command file for the Interface using netFoxAPI:

          fxbaisnet -ps=F -id=1 -q -write –foxserver=foxserver ^

          -host=piserver:5450 "-stopstat=Intf Shut" -f=4 -f=6

       
       

      Interface Node Clock

      Windows NT

          On Windows NT, the PI-Foxboro Interface runs only on a 70-series AW workstation.  This workstation has its clock set to wall clock time and the time zone setting set to GMT.

      Solaris

          On Solaris, the PI-Foxboro Interface runs either on a 50-series AW/AP workstation (running FoxAPI) or a generic Solaris workstation (running netFoxAPI).  However, in either case, the workstation has its clock set to wall clock time and the time zone setting set to GMT.

       
       

      Security

      PI Universal Data Server 3.x

          In general, you will need to edit PI Universal Data Server’s Trust (PI Universal Data Server v3.3) or Proxy (version 3.2) table.  Such a procedure modifies the security configuration of PI Universal Data Server and allows programs running on a PI-API node to write data to PI points. 

          PI Universal Data Server v3.2

          For PI Universal Data Server v3.2, the following example demonstrates how to edit the PI Proxy table:

            C:\PI\adm> piconfig

            @table pi_gen,piproxy

            @mode create

            @istr host,proxyaccount

            piapimachine,piadmin

            @quit

          In place of piapimachine, put the name of the PI-API node as it is seen by PI Universal Data Server.

          PI Universal Data Server v3.3

          For PI Universal Data Server v3.3, the following example demonstrates how to edit the PI Trust table:

            C:\PI\adm> piconfig

            @table pitrust

            @mode create

            @istr Trust,IPAddr,NetMask,PIUser

            a_trust_name,192.168.100.11,255.255.255.255,piadmin

            @quit

          For the above,

          Trust: An arbitrary name for the trust table entry; in the above example,

                a_trust_name

          IPAddr: the IP Address of the computer running the Interface; in the above example,

                192.168.100.11

          NetMask:  the network mask; 255.255.255.255 specifies an exact match with IPAddr

          PIUser:  the PI user you want the Interface to be entrusted as; piadmin is usually an appropriate user

       

          See the PI System Management chapter in the PI Universal Data Server manual for more details on security configuration.

          If the Interface cannot write data to PI Universal Data Server because of security issues, it reports a –10401 error in the pipc.log or pimesslogfile file.  See Appendix A for additional information on error messaging.

      PI Universal Data Server 2.x

          In general, you may need to edit entries in the PISysDat:PIServer.dat file on PI Universal Data Server.  This procedure modifies the security configuration of PI 2.x and allows programs running on a PI-API node to write data to PI points. For example, if the PISysDat:PIServer.dat file contains

          [CLIENTACCESS]

          DEFAULT=R

          PIAPIMACHINE=RW

          then by default, PI-API nodes will have only read access to this PI Server (DEFAULT=R).  However, the programs running on the node named PIAPIMACHINE will have both read and write access to this PI Server (PIAPIMACHINE=RW). 

          Accordingly, the PI-API node on which the PI-Foxboro Interface runs should have an entry in the PI Server’s PISysDat:PIServer.dat file so that this PI-API node has both read and write access.  Please be aware that you should change PIAPIMACHINE to the name of the PI-API node as it is seen by PI Universal Data Server.  The file PIBuild:PIServer.txt on the PI Server machine provides more information.

          If the Interface cannot write data to PI Universal Data Server because of security issues, it reports a –999 error in the pipc.log or pimesslogfile file.  See Appendix A for additional information on error messaging.

       
       

      Starting / Stopping the Interface on Windows NT

      Using the PI-ICU

          Starting/stopping the Interface as a service

          To start the Interface service, click on the start button () located on the PI-ICU toolbar.

          When the Interface service is currently running, you can click on the stop button () to stop it.

          You can determine the current status of the Interface service by looking at the lower portion of the PI-ICU screen.  For example,

       

          shows that the Interface is currently stopped.

          Starting/stopping the Interface interactively

          To run the Interface interactively, select Interface, Start Interactive from the PI-ICU menu.  To stop this interactive execution, use the Control-C combination of keystrokes.

      Not using the PI-ICU

          Starting the Interface as a Service

          If the Interface is currently installed as a service, you can start it from the Services applet of the Windows NT Control Panel.  You can also start the Interface with the command:

            C:\program files\pipc\interfaces\fxbais> fxbais.exe –start

          A message will be echoed to the screen informing you whether or not the Interface has successfully started as a service.  Even if the message indicates that the Interface service started successfully, make sure that the service is still running by checking the Services applet.

          There are several reasons that a service may immediately terminate after startup.  One is that the service may not be able to find the associated startup parameters.  For this association to succeed, the root name of the .bat file (startup command file) and the .exe file (interface executable file) must be the same, and the .bat file and the .exe file must be in the same directory.  If the service terminates prematurely for whatever reason, no error messages will be echoed to the screen.  You must consult the pipc.log file for error messages.  See the section “Appendix A: Error and Informational Messages,” p.12, for additional information.

          Stopping the Interface Running as a Service

          If the Interface is currently running as a service, you can stop it by using the Services applet of the Windows NT Control Panel.  You can also stop the Interface with the command:

            C:\program files\pipc\interfaces\fxbais> fxbais.exe –stop

          You can remove the Interface service by

            C:\program files\pipc\interfaces\fxbais> fxbais.exe –remove

       

          Starting/stopping the Interface interactively

          To run the Interface interactively, execute the Interface’s startup command file (.bat file).  For example,

            C:\program files\pipc\interfaces\fxbais> fxbais.bat

          To stop this interactive execution, use the Control-C combination of keystrokes.

       
       

      Starting / Stopping the Interface on Solaris

      Interactive execution

          First, make sure that the startup command file (e.g., fxbais.sh) does not contain the ampersand character (&) at the end of the startup command.  The reason is that the ampersand character runs a process into the background.  Then, simply execute the startup command file.  For example,

          $ cd $PIHOME/interfaces/fxbais

          $ fxbais.sh

          To stop this interactive execution, use the Control-C combination of keystrokes.

      Command-Line syntax for background processes

          A process that runs in the background remain in existence even after the user who has started the process has logged off of the system.  The command line in the fxbais.sh startup command file should begin with nohup and end with &.  For example:

            nohup fxbais program_parameters > fxbais.log 2>&1 &

          The & at the end of the command line causes the job to be launched in the background. The nohup at the beginning of the command line causes hang-ups and quits to be ignored.  Always execute a background job with nohup, either by incorporating it into the startup command file of the Interface or by typing nohup fxbais.sh or nohup sh fxbais.sh from the command prompt. Unless the job is executed with nohup, the hang-up signal will cause the job to be terminated even if it is run in the background.

          A job that is started with nohup will have its standard output redirected to the file nohup.out, unless the standard output is redirected to a different file name. On the command line above, the standard output is redirected with the > director to the file fxbais.log.

          The optional sequence 2>&1 causes the standard error to be redirected to standard output so that the standard error messages will also appear in fxbais.log.  System commands typically send error messages to the standard error. For example, the command:

            cat nonexistentfile

          fails with the error message “cat: cannot open nonexistent file: No such file or directory.” This error message is directed to the standard error, which is normally seen on the screen.

          Typically, messages that interfaces write to the standard output are also written to the $PIHOME/dat/pimesslogfile.  If you want to avoid this duplication, you can redirect the standard output to the null device, which discards the messages.  For example:

            nohup fxbais program_parameters > /dev/null &

          redirects the standard output to the null device.  OSIsoft recommends that you initially use the first command-line example, where the output is redirected to the fxbais.log file.

      Terminating background processes

          First, obtain the process id (pid) of the background process. To do so, execute command

            $ ps –ef | grep fxbais

          This command produces output similar to:

            piadmin 12788 12707  2 09:55:27 ttys1 0:00 fxbais ps=F …

          The second column is the pid of the process. That is, 12788 is the pid of the fxbais interface in the example above.

          You then stop the process by:

            $ kill 12788

          The kill command sends the SIGTERM signal to the interface, causing the Interface’s exit handler to be invoked.

          Unless absolutely necessary, do NOT stop the interface with kill –9 pid.  The option -9 causes the SIGKILL signal to be sent to the interface.  The Interface’s exit handler cannot catch this signal. SIGKILL will immediately terminate the process.  So, if you stop the Interface via kill –9, the Interface does not properly unregister itself from the FoxAPI system.  For proper operation, you must subsequently stop and restart the FoxAPI before restarting the Interface.

      Interface shutdown script

          OSIsoft provides script named fxastop that automates the steps necessary to stop the Interface.  In particular, this script

          • performs the ps command to find the process identification number of fxbais,
          • issues the kill command to stop this process

          To run this script, use commands such as the following:

            $ cd $PIHOME/interfaces/fxbais

            $ csh ./fxastop

          You can always edit this script to suit your particular configuration.

      Anomalous background job termination

          On some platforms, processes that are started in the background will terminate if you use the Control-C keystroke combination in the same window in which the process was started.  However, if you close the window in which the interface was started or if you log off and log back on, then you will not be able to accidentally terminate the process in this manner.

      Startup summary

          The following is the order in which various processes should be started:

          • FoxAPI processes (i.e., om_poll)
          • PI-API processes (i.e., mqmgr, mqsrv, ioshmsrv, iorates, bufserv)
          • PI-Foxboro Interface (i.e., fxbais)

          You must understand the relationship among all of the above.  For example, the FoxAPI startup script calls

                /etc/fox/user_apps.dat

          which calls

                /opt/piapi/interfaces/fxbais/go_pistart

          which calls

                /opt/piapi/bin/pistart

          which calls

                /opt/piapi/bin/sitestart

          which calls

                /opt/piapi/interfaces/fxbais/fxbais.sh

          which executes the Interface.  By understanding the above sequence, you can easily modify the various scripts and command files to satisfy your particular situation.

       

      Buffering

          For complete information on PI-API node buffering, please refer to the PI-API Installation Instruction.

          PI-API node buffering consists of a buffering process (bufserv) which runs continuously on the local node, a PI-API library (piapi32.dll on Windows NT, libpiapi.so on Solaris) whose calls can send data to this buffering process, and a utility program (bufutil) for examining the state of buffering and controlling the buffering process.

      Configuring Buffering with PI-ICU (Windows NT)

          On Windows NT, PI-API node buffering runs as a Windows Service.  However, unless buffering is explicitly enabled, the PI-API will not buffer data.  Instead, the PI-API sends data directly to the PI Server.  Buffering is enabled through the PI-Interface Configuration Utility’s Tools, API Buffering… menu selection.

          The API Buffering… dialog allows you to view and configure the parameters associated with the PI-API Buffering (bufserv) process.  The user can start and stop the PI-API Buffering process from the Service tab:

       

      Service Tab

          The Service tab allows you to configure some aspects of the PI-API Buffering service. For further configuration changes, use the Services applet in the Windows Control Panel.

          Service Name

          The Service name displays the name of the PI-API Buffering Service.

          Display Name

          The Display name displays the full name associated with the PI-API Buffering service.

          Log On As

          Log on as indicates the Windows user account under which the PI-API Buffering service is set up to start.  To modify the user account or password under which bufserv runs, use the Microsoft Windows Services applet.

          Dependencies

          The Dependencies lists the Windows services on which the PI-API Buffering service is dependent.

          Service Startup Type

          The Startup Type indicates whether the PI-API Buffering service is set up to start automatically on reboot or manually on reboot, or is disabled.

          • If the Auto option is selected, the service will be installed to start automatically when the machine reboots. 
          • If the Manual option is selected, the interface service will not start on reboot, but will require someone to manually start the service. 
          • If the Disabled option is selected, the service will not start at all. 

          Generally, the PI-API Buffering service is set to start automatically.

          Start / Stop Service

          The Start / Stop buttons allow for the PI-API Buffering service to be started and stopped.

          After a change is made to any of the settings on the Settings tab, the Save button must be clicked, and then the service must be stopped and restarted for the changes to take effect.

      Settings Tab

          The Settings tab allows for configuration of the 7 configurable settings used by the PI-API Buffering service.  Default values are used if no other value is provided.

       

          Enable buffering

          Enables the PI-API Buffering feature.

          Maximum File Size

          Maximum buffer file size in kilobytes before buffering fails and discards events.  Default value is 100,000. Range is 1 to 2,000,000.

          The Use Default button places the default value into the text box.  To keep this value, click the Apply button.

          Send Rate

          Send rate is the time to wait between sending up to MAXTRANSFEROBJS to the server (milliseconds).  Default value is 100. Range is 0 to 2,000,000.

          The Use Default button places the default value into the text box.  To keep this value, click the Apply button.

          Primary Memory Buffer Size

          Primary memory buffer size is the size in bytes of the Primary memory buffer.  Default value is 32768. Range is 64 to 2,000,000.

          The Use Default button places the default value into the text box.  To keep this value, click the Apply button.

          Secondary Memory Buffer Size

          Secondary memory buffer size is the size in bytes of the Secondary memory buffer. Default value is 32768. Range is 64 to 2,000,000.

          The Use Default button places the default value into the text box.  To keep this value, click the Apply button.

          Max Transfer Objects

          Max transfer objects is the maximum number of events to send between each SENDRATE pause.  Default value is 500. Range is 1 to 2,000,000.

          The Use Default button places the default value into the text box.  To keep this value, click the Apply button.

          Pause Rate

          When buffers are empty the buffering process will wait for this number of seconds before attempting to send more data to the PI Server.  Default value is 2.  Range is 0 to 2,000,000.

          The Use Default button places the default value into the text box.  To keep this value, click the Apply button.

          Retry Rate

          When the buffering process discovers that the PI Server is unavailable, it will wait this number of seconds before attempting to reconnect.  Default value is 120.  Range is 0 to 2,000,000.

          The Use Default button places the default value into the text box.  To keep this value, click the Apply button.

          Max Theoretical Send Rate

          This is the theoretical max send rate is calculated like this: 
          max = MAXTRANSFEROBJS / SENDRATE * 1000 
          Default value is 5000.

          There are no additional steps needed to install buffering after installing the PI-API.  The delivered PI-API library supports both buffered and un-buffered calls.

      Configuring Buffering Manually

          PI-API Buffering is enabled through the use of a configuration file piclient.ini.  Unless this file is modified to explicitly enable buffering, the PI-API will not buffer data.  Instead, it sends data directly to the PI Server.

          Note:  When buffering is configured to be on, the bufserv process must be started before other programs using the PI-API, so that these programs can access the shared buffering resources.  Any program that makes a connection to a PI Server has this requirement even if it does not write data to the PI Server.

          The piclient.ini file is found in the dat subdirectory of the PIHOME directory.  So, on Windows NT, this file is typically located in

          c:\program files\pipc\dat

          On UNIX systems, this file is typically located in

          /opt/piapi/dat

          This file follows the conventions of Microsoft Windows initialization files with sections, keywords within sections, and values for keywords.  All PI-API Buffering settings are entered in a section called [APIBUFFER]. To modify settings, simply edit the piclient.ini file with a text editor (e.g., Notepad on Windows, vi on UNIX) so that keywords have the desired values.

          The following settings are available for PI-API Buffering configuration:

          Keywords Values Default Description
          BUFFERING 0,1 0 Turn off/on buffering. OFF = 0, ON = 1,
          PAUSERATE 0 - 2,000,000 2 When buffers are empty the buffering process will wait for this long before attempting to send more data to the PI Server (seconds)
          RETRYRATE 0 - 2,000,000 120 When the buffering process discovers the home node is unavailable it will wait this long before attempting to reconnect (seconds)
          MAXFILESIZE 1 - 2,000,000 100,000 Maximum buffer file size before buffering fails and discards events. (Kbytes)
          MAXTRANSFEROBJS 1 - 2,000,000 500 Maximum number of events to send between each SENDRATE pause.
          BUF1SIZE 64 - 2,000,000 32768 Primary memory buffer size. (bytes)
          BUF2SIZE 64 - 2,000,000 32768 Secondary memory buffer size. (bytes)
          SENDRATE 0 - 2,000,000 100 The time to wait between sending up to MAXTRANSFEROBJS to the server (milliseconds)
       

          In addition to the [APIBUFFER] section, the [PISERVER] section may be used to define the default PI Server and an optional time offset change that may occur between the client and server.

          Keywords Values Default Description
          PIHOMENODE string none On Unix machines, this keyword specifies the default PI Server.

          On Windows NT the default PI Server is in pilogin.ini

          DSTMISMATCH 0 - 2,000,000 0 The time that the server and client local time offset is allowed to jump. Typically, 3600 if the nodes are in time zones whose DST rules differ (seconds)

       

      Example piclient.ini File

      Windows NT

          On Windows NT the default server information is stored in the pilogin.ini file.  So, the piclient.ini file would only have the [APIBUFFER] section.  The etnry BUFFERING=1 indicates that buffering is on.  The MAXFILESIZE entry in Kbytes of 100000 allows up to 100 Megabytes of data storage.  Do not use commas or other separators in the numeric entries.  The retry rate is set to 600 seconds.  This setting means that PI Buffer Server waits 10 minutes after losing a connection before retrying.  So, given these parameters, a piclient.ini file might look like:

            [APIBUFFER]

            BUFFERING=1

            MAXFILESIZE=100000

            ; The PI-API connection routines have a 1 minute default timeout.

            RETRYRATE=600

      Unix

          The BUFFERING=1 indicates that buffering is on.  The MAXFILESIZE entry in Kbytes of 100000 allows up to 100 Megabytes of data storage.  Do not use commas or other separators in the numeric entries.  The retry rate is set to 600 seconds.  This setting means that PI Buffer Server waits 10 minutes after losing a connection before retrying.  The [PISERVER] and [TCP/IP] sections are used to define the default connection.  Comment lines begin with a semicolon.

          A piclient.ini file might look like:

            [PISERVER]

            PIHOMENODE=MYPISERVER

            ; DSTMISMATCH=0

            [TCP/IP]

            PORT=5450

            [APIBUFFER]

            BUFFERING=1

            MAXFILESIZE=100000

            ; The PI-API connection routines have a 1 minute default timeout.

            RETRYRATE=600

       

      Appendix A 
      Error / Informational Messages, and Troubleshooting

          The string FXBIA- ID> is pre-pended to error and informational messages written to the message log.  The value of the -id parameter on the startup command line determines the ID identifier.

      Message Logs

          During non-interactive execution on Windows NT, check the pipc.log file for messages.  This file is located in a subdirectory where the PI-API is installed.  For example,

            C:\program files\pipc\dat\pipc.log

          During non-interactive execution on Solaris, check the pimesslogfile for messages.  This file is located in a subdirectory where the PI-API is installed.  For example,

            /opt/piapi/dat/pimesslogfile

          Messages are written to the log file at the following times.

      • When the Interface starts many informational messages are written to the log. These include the version of the Interface, the version of the UniInt template, the version of the PI-API, the command-line parameters used, and the number of points being serviced.
      • As the Interface retrieves points, messages are sent to the log if there are any problems with the configuration of the points.
      • When anomalous events occur, the Interface writes messages to the log.

      Messages

          The following is an example of a successful startup of the Interface:

          Tue Jul 30 10:26:06 2002

          FXBIA-> Starting interface, Point source:  F

          Tue Jul 30 10:26:06 2002

          FXBIA-> Uniint version>@(#)uniint.cxx     3.4.2

          Tue Jul 30 10:26:06 2002

          FXBIA-> API version> 1.3.4

          Tue Jul 30 10:26:08 2002

          FXBIA-> PIAPI successfully connected to default piserver

          Tue Jul 30 10:26:08 2002

          FXBIA- 8> PI-Foxboro Interface, version 2.2.4

                  Handling of BadStat from FoxAPI:  BAD INPUT reported for all tags

                  ReadOnly=TRUE

          Tue Jul 30 10:26:08 2002

          FXBIA- 8> Event counter number (input) = 24

                  Event counter number (output) = 0

                  Event counter number (input-unbuffered) = 0

                  Event counter number (output-unbuffered) = 0

          Tue Jul 30 10:26:08 2002

          FXBIA- 8> FoxAPI parameters: FoxAPI version 4.2.5, IA version 6.2

                  maximum number of data sets = 100

                  maximum number of objects = 6000

          Tue Jul 30 10:26:08 2002

          FXBIA- 8> Uniint is running in Extended API Mode with options 0x49

          Tue Jul 30 10:26:08 2002

          FXBIA- 8> Digital state caching initialized successfully

          Tue Jul 30 10:26:08 2002

          FXBIA- 8> 10 Scan classes have been defined

          Tue Jul 30 10:26:08 2002

          FXBIA- 8> 1 UNSOLICITED Scan class has been defined

          Tue Jul 30 10:26:10 2002

          FXBIA- 8> 445 points found for point source F

          Tue Jul 30 10:26:10 2002

          FXBIA- 8> 0 unique event classes have been established

          Tue Jul 30 10:26:10 2002

          FXBIA- 8> 0 output points have been established

          Tue Jul 30 10:26:10 2002

          FXBIA- 8> (UTC time on server node - UTC time on interface node) = 1

          Tue Jul 30 10:26:10 2002

          FXBIA- 8> Opening all lists

          Tue Jul 30 10:27:49 2002

          FXBIA- 8> Finished opening all lists

          Tue Jul 30 10:27:49 2002

          FXBIA- 8> Starting scans

      System Errors and PI Errors

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

      PI Universal Data Server 3.x

          You can obtain descriptions of operating system and PI System errors with the pidiag program found on the computer running PI Universal Data Server.  This program is located in the adm subdirectory of the directory where PI Universal Data Server is installed.  Use –e command line parameter followed by the error number.  For example,

            C:\PI\adm> pidiag –e 100

            [100] Cannot create another system semaphore.

       

            C:\PI\adm> pidiag –e 10401

            [-10401] No Write Access - Secure Object

      PI Universal Data Server 2.x

          You can obtain descriptions of OpenVMS operating system errors by using the OpenVMS exit command.  Run this command followed by the positive OpenVMS error number.  For example,

            $ exit 660

            %SYSTEM-F-REJECT, connect to network object rejected

      PI-API node

          You can obtain descriptions of PI System errors by using the pilogsrv program.  This program is located in the bin subdirectory of the directory where the PI-API is installed.  Use the -e command line parameter followed by the error number.

          For example,

            $ cd $PIHOME/bin

            $ pilogsrv -e -999

            [-999] Request Not Permitted Without Login

      List Event Counters and Location5

          If the event count appears too high or low, you can determine the source of excess values.  There are event counters for the Interface and for the individual buffered lists. 

          You may configure the Interface to count all inputs (-ec), unbuffered inputs (-ecuinp), buffered outputs (-ecout), and unbuffered outputs (-ecuout).  Use of these counters will provide an overview of events generated by each category.

          If there are buffered input or output points (i.e., Location2 greater than zero), you may use list event counters.  You configure these counters by specifying a non-zero Location5 field and a positive Location2 for a point.  Such a point will then contain the number of I/A object change counts.  Location2 corresponds to the PI list number.  Location5 indicates the frequency in seconds with which the Interface updates this point.  (For example, Location5 may be 120 to indicate 2 minutes.) Location4 indicates a scan class number whose frequency is less than the Location5 value.

      Extra Debugging Messages

          Interface Level

          You can configure the Interface to print out debugging messages by specifying various values in the -fdb command line parameter.  Alternatively, you may enter them in the DebugFlags section of the fxbais.ini file.  The available debugging values are:

            11 – additional messages when opening lists of tags

            12 – setup of tags used with the libprofplot.so library

            13 – reading of data using libprofplot.so function calls

            15 – time offset between the PI Server and the Interface

            16 – verbose messages during point loading

            17 – verbose messages during Interface shutdown

            18 – extra attempts to locate and close data sets.  Unlike other debugging values, this one affects the behavior of the Interface.  If you specify -fdb=18, the Interface will close all data sets, even those that it did not open.

            19 – messages for buffered outputs

            21 – messages for outputs in general

            24 – detailed error status after an scopen() call

          For example, to tell PI-Foxboro to print verbose messages during point loading (debug value 16) and during Interface shutdown (debug value 17), add the following command line parameter to the startup command file (fxbais.sh or fxbais.bat):

               fxbais –ps=F –id-1 –fdb=16,17 …

          Alternatively, you may edit the fxbais.ini file so that it contains:

            [fxbais-1]

            DebugFlags=16,17

          PI-Foxboro reads the contents of fxbais.ini on startup.  On Solaris, you may tell the Interface to re-read this file by first determining the Interface’s process identification number (PID) and then issuing the command

            $ kill –HUP xxx

          where xxx is numeric PID.

          Point Level

          You can configure the Interface to print out debugging messages for individual points.  To do so, add 4096 to the value of the point’s UserInt1 tag attribute field. 

          The advantage of point level debugging is that you do not have to

          • stop the Interface
          • add –fdb parameters to the interface startup file
          • re-start the Interface

          Because the Interface automatically incorporates PI tag attribute changes, you can disable point level debugging by setting the point’s UserInt1 attribute field to a value less than 4096.

          The following are examples of point level debug messages:

            FXBIA- 1> [mreaidx] PItag (fx_real_01) status=0x23 val=1.386837 istat=0

          This message indicates that for the PI tag fx_real_01, the call to the FoxAPI function mreaidx() resulted in a value of 1.38687 and an I/A object status of 23 hex.

            FXBIA- 1> [uread] error=0, status 0x3, val=100.015; PItag (fx_real_01)

          This message indicates that for the PI tag fx_real_01, the call to the FoxAPI function uread() resulted in a value of 100.015 and an I/A object status of 3 hex.

            FXBIA- 1> PItag (fx_real_01) t=997010983 ival=0 drval=100.015 istat=0 sent to UniInt

          This message indicates that for the PI tag fx_real_01, the PI-Foxboro specific portion of the code returned to the UniInt template a value of 100.015.

      Common Problems

          The following describes some of the common problems that you may encounter during the operation of the PI-Foxboro Interface.

          Relocation error in libpiapi.so

          A message similar to

            ld.so.1: ./fxbais: fatal: relocation error: file /opt/piapi/lib/libpiapi.so: symbol __1cG__CrunKpure_error6F_v_: referenced symbol not found

          indicates that the PI-API was installed with the incorrect option. 

          Starting with version 1.3.3, the PI-API on Solaris supports both the ANSI C++ compiler version 5 and the previous version 4.  However, the user must pick one or the other at the beginning of the installation.  If you chose a version that is not compatible, the above error message appears.

          Thus, the solution to this “relocation error” is to re-install the PI-API, choosing the option different from the previous installation.

          Relocation error in libfoxapi.so

          A message similar to

            ld.so.1: ./fxbais: fatal: relocation error: file /usr/lib/libfoxapi.so: symbol fh_RTPINdex: referenced symbol not found

          indicates that the file /usr/lib/libfoxapi.so is incompatible with the PI-Foxboro Interface.  The most likely reason is that /usr/lib/libfoxapi.so is FoxAPI version 5.x.  On Solaris, FoxAPI v5.x is not compatible with PI-Foxboro.

          In order to work around this problem, you need to use PI-Foxboro with a copy of FoxAPI v4.2.x that is currently on your machine.

          First, find all copies of libfoxapi.so using the Solaris find command.

          # find / –name libfoxapi.so –print

          The results should look something like the following

          /usr/lib/libfoxapi.so

          /opt/foxapi42/libfoxapi.so

          Then, you need to tell Solaris to use the file /opt/foxapi42/libfoxapi.so when running fxbais.  To do so, set the LD_LIBRARY_PATH environment variable to reference the directories where the FoxAPI (libfoxapi.so) and the PI-API (libpiapi.so) files are found.  For example,

          # LD_LIBRARY_PATH=/opt/foxapi42:$PIHOME/lib

          # export LD_LIBRARY_PATH

          Then, re-run the Interface

          # ./fxbais –ps=F –id=100 –host=piserver:5450 –f=5 …

          To make sure that /opt/foxapi42/libfoxapi.so is a valid FoxAPI file, run Foxboro’s foxtst program:

          # LD_LIBRARY_PATH=/opt/foxapi42

          # export LD_LIBRARY_PATH

          # cd /opt/fox/ais/bin

          # ./foxtst

          Then,

          • select 300 (for Objects),
          • select 40 (for uread),
          • enter a COMPOUND, BLOCK, and PARAMETER. 

          The FoxAPI should return a value.

       

          Cannot find libCrun.so.1

          A message similar to

            ld.so.1: ./fxbais: fatal: libCrun.so.1: open failed: No such file or directory

          indicates that the file libCrun.so.1 is missing.   This file is part of the C++ runtime library used by the Interface.  To get this file via download, go to Sun Microsystems patch database at

            http://sunsolve.sun.com

          and search for libCrun.so.1

       

          libpiapi.so open failed

          A message similar to

            ld.so.1: fxbais: fatal: libpiapi.so: open failed: No such file or directory

          indicates that the environment variable LD_LIBRARY_PATH is incorrectly set.

          The solution to this problem is to make sure that both the PIHOME and LD_LIBRARY_PATH environment variables are defined in the /etc/profile file.  (Recall that the /etc/profile file sets up environment variables for all users.)

          For example, edit the /etc/profile file such that it contains:

          PIHOME=/opt/piapi

          export PIHOME

          LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PIHOME/lib

          export LD_LIBRARY_PATH

          (Of course, you should put in the appropriate directory for PIHOME.)  You will need to log out and log back into the operating system for changes to /etc/profile to take effect.  To confirm that PIHOME and LD_LIBRARY_PATH contain the appropriate entries, use the echo command to display these environment variables:

            $ echo $PIHOME

            $ echo $LD_LIBRARY_PATH

       

          Undefined symbol

          If you start the Interface, and the program exits and complains about “undefined symbol” or “symbol not found”, these messages indicate that the shipped fxbais executable is incompatible with the libraries on your Foxboro workstation.  You will have to re-link the program.

          To re-link, make sure that the environment variables PIHOME and LD_LIBRARY_PATH are defined.  Then, change to the directory containing the program object files and run the link script:

            $ cd $PIHOME/interfaces/fxbais/fxlink

            $ fxlink.sh

          When the script finishes, the new fxbais executable is placed in the $PIHOME/interfaces/fxbais directory.  The old executable is renamed to fxbais.prev.

          If you are running PI-FoxboroNet (the version of the Interface that uses netFoxAPI), you will have to edit the fxnetlink.sh file and then run this link script:

            $ fxnetlink.sh

          The new fxbaisnet will be in the $PIHOME/interfaces/fxbais/fxlink directory.  You then should move it to the $PIHOME/interfaces/fxbais directory.

       

          Waiting for FoxAPI to start

          If you start the Interface and receive a message such as “Waiting for FoxAPI to initialize” or “Waiting for central to start”, these warnings indicate that the FoxAPI software is not running.  Try running Foxboro’s foxtst program located in /opt/fox/ais/bin.  If you receive the same warnings, you should stop and restart the FoxAPI software via the aisstart command.

          If foxtst program runs properly, you may have multiple versions of the FoxAPI installed.  In particular, the libais.so and libfoxapi.so files represent different versions of the FoxAPI.

       

          Interface exits because of multiple instances of om_poll

          The startup file go_pistart tries to determine whether the FoxAPI is currently running by looking for the process om_poll.  If it finds that more than one instance of om_poll is running, go_pistart exits and does not start the Interface.

          However, some customers have indicated that some versions of the FoxAPI support the running of multiple instances of om_poll.  If this situation applies to your AW workstation, you should comment out the portions of the go_pistart file that exits and prevents the starting of the Interface.

       

          Interface does not restart after reboot

          If the Interface does not restart after the AW workstation reboots, check whether the FoxAPI itself has restarted.  PI-Foxboro cannot start unless the FoxAPI is running. 

       

          Interface does not shut down

          Normally, you should stop the Interface with the script fxastop or stop the entire PI-API and the Interface with the script $PIHOME/bin/pistop.  If the fxbais program continues to run, you can terminate it by finding its process number and issuing a kill –9.  For example,

            $ ps –ef | grep fxbais

          resulting in

            piadmin 24776 24774  0 17:13:06 pts/8    0:01 fxbais -ps=F

          Then,

            $ kill –9 24776

          where 24776 is the process number of the fxbais program.

          Note that if you stop the Interface via kill –9, the Interface does not properly unregister itself from the FoxAPI system.  For proper operation, you must subsequently stop and restart the FoxAPI before restarting the Interface.

       

          open_action:  not found

          During normal operations, the Interface calls the FoxAPI function scopen().  This function in turns checks for a file called /opt/fox/ais/bin/open_action.  If this file does not exist, FoxAPI displays the above message.

          To eliminate this warning, create a trivial open_action file.  That is,

            $ cd /opt/fox/ais/bin

            $ echo "#trivial file to prevent warning" > open_action

            $ chmod +x open_action

       

          clsset_action:  not found

          During normal operations, the Interface calls the FoxAPI function clsset().  This function in turns checks for a file called /opt/fox/ais/bin/clsset_action.  If this file does not exist, FoxAPI displays the above message.

          To eliminate this warning, create a trivial clsset_action file.  That is,

            $ cd /opt/fox/ais/bin

            $ echo "#trivial file to prevent warning" > clsset_action

            $ chmod +x clsset_action

       

          Error 212 seen

          The pimesslogfile or pipc.log may show a message such as:

            FXBIA- 1> Error 212 …

          This error 212 is returned by the FoxAPI and indicates a problem caused by a lack of permission/privileges.  On Windows NT, make sure that the fxbais.exe service runs under the Fox user account. 

          On Solaris, this error should occur only if you are using the netFoxAPI.  To fix this problem, make sure the netFoxAPI client machine has permissions to access the netFoxAPI server.  See the FoxAPI Installation Guide for more information.

       

          Output from the Interface fails

          The Interface can only write to an INPUT parameter of a block.  For example, the Interface cannot change the value of an .SPT parameter of a PID block since that parameter is the output of these blocks.  You can determine whether a parameter is an OUTPUT by examining the documentation for the block.  Note that the VALUE parameter of data blocks is also an OUTPUT even though the documentation does not clearly state so.

      Operational Hints

          You may find the following information useful during the operation of the PI-Foxboro Interface.

          Solaris/Unix

          The Solaris operating system is case sensitive.  Thus, a file named

            fxbais.tar.z

          is not the same as

            fxbais.tar.Z

          If you used FTP to transfer the interface distribution from a PC to the AW workstation, make sure that this file has a capital Z.  Otherwise, you will not be able to run zcat or uncompress on it. 

          To rename a file, use the mv command.  For example,

            $ mv fxbais.tar.z fxbais.tar.Z

       

          If you get a “permission denied” message while trying to run a script file, you will have to make the script file executable.  For example,

            $ chmod +x a_script_file.sh

          Under the Bourne or Korn, to set an environment variable (such as PIHOME):

            $ PIHOME=/opt/piapi

            $ export PIHOME

          To add to an existing environment variable (such as LD_LIBRARY_PATH):

          $ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PIHOME/lib

          $ export LD_LIBRARY_PATH

          To remove an environment variable (such as PIHOME):

          $ unset PIHOME

       

          Fixes to FoxAPI

          Foxboro regularly provides fixes and enhancements to their FoxAPI.  Please be sure you have installed the latest one.  As of 2 February 2001, the most recent FoxAPI QF (Quick Fix) is QF990341.

       

          Status of an I/A Series Object

          The Interface reads the status of an I/A object.  FoxAPI presents this status as a 32-bit word, with the bits numbered from 0 to 31.  Bit 0 is the least significant.

          Bits 0-4 indicate the value type.  The resulting numeric value corresponds to:

          1 – character

          2 – integer

          3 – float

          4 – string

          5 – 1 byte Boolean

          6 – long integer

          8 – short integer

          9 – packed Boolean

          10 – long packed Boolean

          Bits 5-7 indicate the object connect status.  The resulting numeric value corresponds to:

          0 – no response

          1 – being scanned (connected)

          2 – disconnected

          3 – deleted

          4 – bad data type or unconnectable compound

          6 – non-connectable parameter

          Bit 8 indicates whether the object is bad (value equal to 1) or okay (value equal to 0).

          Bit 9 indicates whether the object is secured (1) or unsecured (0).

          Bit 10 indicates whether the compound is on (1) or off (0).

          Bit 11 indicates whether the block is out of service (1) or in service (0).

          For example, a status of 0x23 corresponds to binary

            0000 0000 0010 0011

          The value of bits 0 to 4 is 3.  Thus, the value type of the object is float.

          The value of bits 5 to 7 is 1.  Thus, the object is connected.

          Another example is a status of 0x963, or in binary

            0000 1001 0110 0011

          The value of bits 0 to 4 is 3.  Thus, the value type of the object is float.

          The value of bits 5 to 7 is 3.  Thus, the object is deleted.

          The value of bit 8 is 1.  Thus, the object is bad.

          The value of bit 11 is 1.  Thus, the object is out of service.

          Generally, the Interface sends the I/A object’s value to PI only if all three of the following conditions are met:

          1. Bits 5-7 indicate a connected status.
          2. Bit 8 indicates okay.
          3. Bit 11 indicates in service.

          Otherwise, the Interface sends Bad Input to PI.  However, you may choose to ignore the condition regarding the bad status from Bit 8.  See the description for BadStatusIndication in the section regarding the fxbais.ini file.

       

          Reading an entire MCIN/MCOUT block

          If you wish, you may read all of the inputs of an MCIN or all of the outputs of an MCOUT block into a single PI point.  The MCIN block has a parameter of type Long Packed Boolean (10) called PAKCIN.  The MCOUT block has a parameter of type Packed Boolean (9) called PAKCRB.  These parameters are the packed equivalent of the .CO_x parameters of the MCOUT and the .IN_x parameters of the MCIN blocks.

          Reading I/A Series Messages

          The Interface does not support the reading of I/A Series Messages.  For example, messages such as

                Control Station Generated:

                  Process Alarms

                  Sequence of Events

                  Sequence Block

                System Monitor

                Operator Action Journal

          are not supported.

       

          Settings in foxapi.cfg

          Foxboro recommends the following setting in the FoxAPI configuration file (foxapi.cfg).

          ctdlay     =   200

       

          Time difference reported by the Interface

          Because the Interfaces uses the UniInt template, it prints out a message that indicates a difference between the clock on the PI Universal Data Server and the I/A workstation.  For example,

            FXBIA- 1> (UTC time on server node - UTC time on interface node) = 48

          However, this message is technically incorrect.  The correct message should be

            FXBIA- 1> (local time on server node - local time on interface node) = 48

       
       

      Appendix B 
      Failover Support

          In order to achieve continuous transfer of data between the Foxboro I/A and the PI Universal Data Server, you may run two copies of the PI-Foxboro interface program, each on a different Foxboro AW workstation.  Either AW workstation may be an AW50 Series (Solaris) or AW70 Series (Windows NT) model.  However, only the version of the Interface using FoxAPI (not netFoxAPI) supports failover.

          In a failover configuration, one copy of the interface is designated as PI-Foxboro-Primary and the other as PI-Foxboro-Secondary. The Primary program is responsible for data collection during the vast majority of the time.

       
       

          However, should the Primary program terminate, the Secondary program automatically assumes responsibility for transferring data between the I/A and PI.

       
       

          When the Primary program restarts, the Secondary program automatically stops data collection.  The transfer of data between the I/A and PI again becomes the responsibility of the Primary.

       

      Parameters for operation

      PI-ICU

          To designate that PI-Foxboro is running in a failover configuration, change the Failover selection from None to either Primary or Secondary.

       

      Command Line

          To designate that PI-Foxboro is running in a failover configuration, provide the -failover parameter on the interface command line.  Specifically, run the copies of the interface as

            $ fxbais –ps=F –id=1 –failover=primary ...

          on one machine and

            $ fxbais –ps=F –id=1 –failover=secondary ...

          on the other.

      Initialization File

          When PI-Foxboro encounters the –failover option on the command line, it looks for other failover-related parameters in the initialization file fxbais.ini.  In particular, the Interface needs to know

          • which machine is running the other instance of PI-Foxboro
          • the maximum time that the user can tolerate neither copy of PI-Foxboro collecting data
          • the name of the watchdog object on the I/A (to be described later)
          • the name of the PI tag that tracks the failover data collection status (also described later)

          The following contents of fxbais.ini provide an example of how to specify the above information:

            [fxbais-1]

            failover_peer=casaba

            fail_time=4

            watchdog=PI_COMM:PI_WATCHDOG.II1234

            failover_status=fx:coll

          The section [fxbais-1] indicates that the entries below it pertain to the copy of PI-Foxboro running with –id=1.  If you run PI-Foxboro with –id=2, edit the fxbais.ini file and create a section called [fxbais-2].

          The value of the entry for failover_peer indicates the name of the workstation that is running the other instance of PI-Foxboro.  The AW running the present copy of PI-Foxboro must be able to communicate to this other (peer) workstation via TCP/IP.  To confirm, run the standard ping command.

            $ ping casaba

          Alternatively, you may specify an IP address (in dotted-decimal form) for the failover_peer value.

            [fxbais-1]

            failover_peer=192.168.100.10

          Again, you should confirm the communication between the two machines via TCP/IP by running ping.

            $ ping 192.168.100.10

          The value of the entry for fail_time indicates the maximum time in minutes for the Secondary to wait before assuming data collection.  In this example, at most 4 minutes will elapse from the time that the Primary terminates to the time that the Secondary automatically starts data collection.  A value of fail_time that is too small (e.g., 1) can cause the Secondary to start data collection even though the Primary is still collecting data.

          The value of the watchdog entry is the name of the object residing on the Foxboro I/A.  The value of the failover_status entry is the name of a PI tag that keeps track of the operational state of the failover configuration.  Both of these items are described later.

      I/O Rate Points

          Running PI-Foxboro in a failover configuration requires the existence of two sets of different I/O Rate points.  The Primary uses one set while the Secondary uses the other.

          The Primary and Secondary copies of PI-Foxboro may use the same –ec= command line parameter, but the entries for the PI tag names in the iorates.dat file must be different.  For example, on the Primary machine:

            * sample iorates.dat file

            syfxbais.in1,31

            syfxbais.in1,32

          On the Secondary machine:

            * sample iorates.dat file

            syfxbais.in2,31

            syfxbais.in2,32

      Design Details

      Watchdog Object on I/A

          The failover feature of PI-Foxboro relies on a watchdog object, which must becreated on the I/A before execution of the PI-Foxboro programs.  This object must be a Long Integer (I/A Type 6).  It provides the main method of communications between the Primary and Secondary programs regarding the responsibility of data transfer between the I/A and PI.  At startup, if PI-Foxboro cannot access the watchdog object, it exits.

          During normal operation (i.e., when the Primary is collecting data), the Primary program periodically writes to this watchdog object.  The value written is between 110 and 115, and increases monotonically.  When the value reaches 115, it rolls back to 110.

          At specific intervals, the Secondary program reads the value of the watchdog object.  When it determines that the value of the watchdog object has stopped changing, it sends a message via UDP to the Primary.  If it does not get a response from the Primary, it concludes that the Primary program is not running.  The Secondary program then starts transferring data between the I/A and PI.

          While the Secondary program is collecting data, it writes periodically to the watchdog object a value between 210 and 215.  However, before every write, it reads the value of the watchdog object.  It checks to see whether this value is 10 (scenario to be described below).

          When the Primary program is re-started, it writes a value of 10 to the watchdog object, indicating that it wishes to resume data collection.  When the Secondary program sees that the watchdog object has a value of 10, it stops collecting data, and writes a value of 20 to the watchdog object.

          When the Primary sees that the watchdog object has a value of 20, it begins data collection and writes values of 110 through 115.  At this point, the default configuration exists – the Primary is collecting data and the Secondary is in standby mode.

          Other scenarios are described in a later section.

      Meaning of Watchdog I/A Object Values

          Written by the Primary:

          10  Primary wants to start/resume collecting data

          110 – 115 Primary is currently collecting data

          Written by the Secondary:

            1. Primary should go ahead and start/resume collecting data

          210 – 215 Secondary is currently collecting data

      Prevention of Simultaneous Data Collection

          The Interface has various safeguards to preclude simultaneous data collection by the Primary and the Secondary.  If after writing a value of 10 to the watchdog object, the Primary reads this same value back, it then assumes that the Secondary is not collecting data.  (Otherwise, it would have read 210-215).  However, in order to be certain, the Primary sends a message via UDP to the Secondary to confirm.  If the Secondary replies that it is collecting data, the Primary writes a value of 10 again.  Otherwise, the Primary begins data collection.

          On the Secondary side, if after determining that the value of the watchdog object has stopped changing, the Secondary assumes that the Primary is not running (and hence not collecting data).  However, in order to be certain, the Secondary sends a message via UDP to the Primary to confirm.  If the Primary replies that it is collecting data, the Secondary remains in standby mode.  Otherwise, the Secondary begins data collection.

      FoxAPI Functions Used

          The FoxAPI function used in writing a value to the watchdog object is uwrite().  For reading, it is uread().  The periodic time interval for these calls is one-half of the user-specified fail_time value.  For example, if the failover time is set at 4 minutes, and both programs are running, the Primary program calls uwrite() once every 2 minutes and the Secondary program calls uread() once every 2 minutes.

      Informational PI Tag

          Within the fxbais.ini file, one of the mandatory entries is failover_status.  For example,

            [fxbais-1]

            failover_status=fx:coll

          Given the above entry, PI-Foxboro writes the following values to the PI tag fx:coll to indicate the operational state of the failover configuration:

          Value Meaning
          1 Primary wants to start data collection
          2 Primary is the most recent program that collected data
          3 After data collection, Primary exited normally
          4 Secondary wants to start data collection
          5 Secondary is the most recent program that collected data
          6 After data collection, Secondary exited normally

          At startup, if PI-Foxboro cannot access this PI tag, it exits.  Therefore, you must create this failover status tag on the PI Server machine before starting PI-Foxboro.  You may create the tag with the default PI tag attributes. 

          On PI 3.x, if you want to create the failover status tag as Digital, be sure first to create the digital state set, with the first state (corresponding to a value of 0) as a dummy state.  For example, to create a digital set named FXFailStat

            D:\PI\adm> piconfig

            PIConfig> @table pids

            PIConfig> @mode create

            PIConfig> @istr set, state, . . .

            PIConfig> FXFailStat, unknown, 1start, 1coll, 1exit, 2start, 2coll, 2exit

            PIConfig> @exit

          Alternatively, you may use the PI-PointBuilder program to create the above digital state set.

          Please be aware the current value of this failover status PI tag may not tell you which copy of the interface is collecting data.  For example, the current value of the failover status PI tag may be 2start, but the Primary copy of the interface is collecting data. 

          To determine which copy of the interface is collecting data, look at the values of the I/A Watchdog object via a Foxboro console.  Values that continuously change from 110 to 115 indicate that the Primary is collecting data.  Values that continuously change from 210 to 215 indicate that the Secondary is collecting data.

      Digital State Written when Interface Stops

          The startup command for PI-Foxboro usually contains a parameter specifying the digital state that will be written to its list of tags when the interface stops.  For example,

            $ fxbais –ps=F –id=1 "–stopstat=Intf Shut" ...

          In this example, when PI-Foxboro stops, it writes the digital state Intf Shut to its list of input tags. 

          However, for a failover configuration, this behavior of writing a digital state upon exit is not desirable because there is usually another copy of the interface that will assume data collection.  Therefore, when running in a failover configuration, a copy of PI-Foxboro writes the digital state specified by –stopstat only if it has determined that the other copy of the interface is not running.

      Consistency of Startup Parameters

          Either the Primary or the Secondary may start first.  However, the one that does start up before the other determines the common startup parameters.  Specifically, if the Secondary starts up first, it makes special note of the following information:

      • point source character (-ps=)
      • interface number (-id=)
      • PI Server machine and PI communications port (-host=)
      • watchdog I/A object (watchdog=)
      • failover time (fail_time=)
      • PI tag that tracks the failover operational state (failover_status=)

          The Secondary program then opens an UDP socket port.  This port is used for communications between the Primary and Secondary programs.

          When the Primary program starts, it also makes special note of the following:

      • point source character (-ps=)
      • interface number (-id=)
      • PI Server machine and PI communications port (-host=)
      • watchdog I/A object (watchdog=)
      • failover time (fail_time=)
      • PI tag that tracks the failover operational state (failover_status=)

          The Primary program sends all of this information (via UDP) to the Secondary.  The Secondary confirms that this set of information is identical to its own.  If these parameters do not match, the Primary will exit and print out the mismatched parameters in the log file.  The Secondary itself will begin data collection within the failover time (scenario to be described below).

      Operational Scenarios

          In the following scenarios, “WD=” indicates the value of the watchdog object.  “WD=110-115” means a periodic change in the value of the watchdog object from 110 to 111 to 112 to 113 to 114 to 115 to 110 and so on.

      1.  Startup, Normal

          At startup, neither the Primary nor the Secondary is collecting data.

          The Secondary program starts.  The Secondary continuously checks for WD=10 and WD=110-115.  If WD=10, the Secondary writes WD=20.

          Meanwhile, the Primary program starts.  It writes WD=10.  It then checks for WD=20.  Since the Secondary wrote WD=20, the Primary starts data collection and periodically writes WD=110-115.

          End Result:  Primary is collecting data.

      2.  Startup, Primary can Connect to the PI Server but Secondary cannot

          At startup, neither the Primary nor the Secondary is collecting data.

          The Secondary program starts but cannot connect to the PI Server.  Therefore, the Secondary program exits. 

          Meanwhile, the Primary program starts.  It writes WD=10.  It then checks for WD=20.   Because the Secondary program is not running, WD=10.  The Primary then sends a message to the Secondary via UDP.  The Secondary does not respond because it is not running.  The Primary starts data collection and periodically writes WD=110-115.

          End Result:  Primary is collecting data.

      3.  Startup, Primary cannot Connect to the PI Server but Secondary can

          At startup, neither the Primary nor the Secondary is collecting data.

          The Secondary program starts.  The Secondary continuously checks for WD=10 and WD=110-115.  If WD=10, the Secondary writes WD=20.

          Meanwhile, the Primary program starts but cannot connect to the PI Server.  Therefore, the Primary program exits.

          The Secondary sees that the WD is not changing.  It then sends a message to the Primary via UDP.  The Primary does not respond because it is not running.  The Secondary starts data collection and periodically writes WD=210-215.

          End Result:  Secondary is collecting data.

      4.  Primary Currently Collecting Data; Primary Fails

          The Primary is collecting data and periodically writes WD=110-115.  The Secondary sees that the WD=110-115.

          The Primary program stops.  The Secondary sees that the WD is not changing.  It then sends a message to the Primary via UDP.  The Primary does not respond because it is not running.  The Secondary starts data collection and periodically writes WD=210-215.

          End Result:  Secondary is collecting data.

      5.  Secondary Currently Collecting Data; Primary Re-starts

          The Secondary is collecting data and periodically writes WD=210-215.

          The Primary program starts.  It writes WD=10.

          Because the Secondary sees that WD=10, it writes WD=20.  It stops collecting data and continually checks for WD=110-115.

          Since WD=20, the Primary starts data collection and periodically writes WD=110-115.

          End Result:  Primary is collecting data.

      6.  Primary Currently Collecting Data; Secondary Fails; Secondary Re-starts

          The Primary is collecting data and periodically writes WD=110-115.

          The Secondary program fails.

          The Secondary program re-starts.  The Secondary first checks for WD=10.  Because WD=110-115, and periodically changes, the Secondary does not collect data.  However, it is prepared to do so.

          End Result:  Primary is collecting data.

      7.  Power Outage and Recovery; Primary Re-starts much Earlier than the Secondary

          This scenario is the same as the sequence of scenarios 2 and 6.

      8.  Power Outage and Recovery; Secondary Re-starts much Earlier than the Primary

          This scenario is the same as the sequence of scenarios 3 and 5.

      9.  Primary Cannot Write to the Watchdog Object

          An inability of the Primary to write to the watchdog object indicates a serious problem on either the I/A System or the Foxboro NodeBus.  The Primary program writes a message to the PI log file and exits.  The situation then becomes scenario 4.

      10.  Secondary Cannot Write to the Watchdog Object

          An inability of the Secondary to write to the watchdog object indicates a serious problem on either the I/A System or the Foxboro NodeBus.  The Secondary program writes a message to the PI log file and exits.

      Failover Installation Checklist

          1. Confirm that PI-Foxboro runs properly in a non-failover configuration on the two machines.  Specifically, on the machine that will be running the copy of the interface that will be designated as the Primary, install and run the interface without the -failover startup parameter.  Stop the Interface on the Primary machine.  On the Secondary machine, Install and run the interface without the -failover startup parameter.  Stop the Interface on the Secondary.
          2. Create the watchdog object on the Foxboro I/A.  This object must be a Long Integer (I/A Type 6).
          3. Create the PI tag that will track the operational status of the failover configuration.  On PI 3.x, if you want to create this tag as Digital, first create the digital state set.
          4. Make sure that two sets of event counter tags exist.  The Primary and Secondary copies of PI-Foxboro may use the same –ec= command line parameter, but the entries for the PI tag names in the iorates.dat file must be different.
          5. Create and/or edit the fxbais.ini file.  Change the section name [fxbais-1] if you will not be using –id=1 in the PI-Foxboro interface startup command line.  Put in values for the entries failover_peer, fail_time, watchdog, and failover_status.
          6. Confirm that the Primary machine can communicate to the Secondary machine via TCP/IP and vice-versa.  For example, use the ping command.
          7. On the Primary machine, interactively start PI-Foxboro with the parameter -failover=primary.  Confirm that this copy of the interface properly collects data.  Stop the interface on the Primary machine.
          8. On the Secondary machine, interactively start PI-Foxboro with the parameter -failover=secondary.  Confirm that this copy of the interface properly collects data.
          9. On the Primary machine, start PI-Foxboro with –failover=primary.  Confirm that the Primary copy of the interface starts data collection.  Confirm that the Secondary copy of the interface goes into standby mode.
          10. Stop the interface on the Primary machine.  Confirm that the Secondary copy of the interface starts data collection.
          11. Restart the interface on the Primary machine.  Confirm that the Primary copy of the interface takes over data collection.
          12. Permanently install the two copies of PI-Foxboro so that they run in the background (Solaris) or as services (Windows NT).

          If you are running multiple copies of the interface on the same machine (for example, using different –id= parameters), you will need to create entries for failover_port and failover_self_port in the fxbais.ini file.  See the next section for details.

      Miscellaneous Information on Failover

      Optional Parameters

          Wait Time for Response from Peer

          At startup, a copy of the PI-Foxboro interface configured for failover communicates with its peer via UDP in order to check for common startup parameters.  By default, it waits 5 seconds for a response from its peer.  If you wish to change this wait time, put in a value for the entry check_peer_time in the fxbais.ini file.   For example, to increase this wait time to 10 seconds:

            [fxbais-1]

            ...

            check_peer_time=10

          Socket port numbers

          By default, a copy of the PI-Foxboro interface listens for messages sent by its peer on the socket port numbered 5451.  If another application is currently using port 5451, edit the fxbais.ini file on both machines and put in the same value for the entries failover_port and failover_self_port.  For example,

            [fxbais-1]

            ...

            failover_port=5500

            failover_self_port=5500

          Of course, for the above example, port 5500 should not be used by another application on either the Primary or the Secondary machines.

          If you are running multiple copies of PI-Foxboro on the same machine (for example, using different –id= parameters), create entries for failover_port and failover_self_port in the fxbais.ini file to correspond to each copy.  For example, if there are two copies (-id=1 and –id=2):

            [fxbais-1]

            ...

            failover_port=5451

            failover_self_port=5451

       

            [fxbais-2]

            ...

            failover_port=5452

            failover_self_port=5452

      Questions and Answers

          Why must I create two sets of I/O Rate points?

          The Primary and Secondary copies of PI-Foxboro work together to transfer data between PI and the Foxboro I/A.  Indeed, at any given time, only one of these copies is sending data to PI.  However, each copy of PI-Foxboro is an independent instance of the Interface.  Accordingly, every 10 minutes, each writes to the I/O Rate point (as referenced by the –ec= parameter on the command line) a value that represents the data collection rate.  So, while the Secondary is running in standby mode (and thus not collecting data), it will write to its I/O Rate point a value of 0.  Therefore, you should create two sets of I/O Rate points, one for the Primary and one for the Secondary.

          How can I tell which copy is collecting data?

          Look at the values of the I/A Watchdog object via a Foxboro console.  Values that continuously change from 110 to 115 indicate that the Primary is collecting data.  Values that continuously change from 210 to 215 indicate that the Secondary is collecting data.

       

      Migration from v1.16.x

          If you are currently using v1.16.x of the Interface and wish to upgrade to this current version, you will need to make changes to the following:

      • Point attribute Location4
      • Point attribute Extended descriptor, MSG=
      • Point attribute Extended descriptor, RTN=
      • fxbais.sh file
          Location4

          In v1.16.x, the value of Location4 indicated the scan rate, in units of 500 milliseconds.  The current version of the Interface uses Location4 to indicate a scan class number.  A scan class number is the ordinal number of the occurrence of the -f= parameter in the startup command.  The scan rate itself is the value indicated by the –f= parameter.  Therefore, to convert points from v1.16.x, you will have to create a startup command file with appropriate –f= parameters.

          For example, for v1.16.x points with Location4 equal to 4, you are scanning at the rate of 2 seconds (i.e., 4 units of 500 milliseconds).  So, you should create in your v2.x.x fxbais.sh file 4 scan classes.  The first three values for –f= are arbitrary, but the fourth should be 2 seconds.  That is,

            fxbais –ps=F –f=10 –f=11 –f=12 –f=2 …

          In this manner, you do not have to change the value of Location4.

          However, in v1.16.x, a value of 0 in Location4 resulted in a scan rate parameter of 2 seconds.  The current version of the Interface does not allow Location4 to be 0 for scan based points.  Thus, you need to change the Location4 value of such v1.16.x points so that it refers to a scan class number of 2 seconds.

          Extended descriptor, MSG=

          In v1.16.x, the Interface sent I/A string data to the PI message log if a point’s extended descriptor field contains

          MSG=<I/A string object>

          The current version of this Interface does not support such an MSG specification.  Instead, you should create a PI string point to retrieve data from the I/A string object.

          Extended descriptor, RTN=

          In v1.16.x, the output point itself holds the value to be written to the I/A object.  If this output point’s extended descriptor field contains

          RTN=<PI tag>

          the Interface sent the output value to both the I/A object as well as the indicated <PI tag>

          The current version of the Interface does not support such an RTN specification.  Instead, a separate source point holds the value to be written to the I/A object.  In the output tag’s SourceTag field, you reference this separate source point.  The Interface then writes the value of the source point to both the I/A object and the output tag.

          fxbais.sh startup file

          The current version of the Interface uses an fxbais.sh startup command file that differs significantly from that used in v1.16.x.  See the section on Startup Parameters for more information on the required parameters for the current fxbais.sh file.  In addition, you should study the supplied fxbais.sh.new file.

       

      Revision History

          Date Author Comments
          5-Jul-02 ET Added section FoxAPI Version 5
          8-Jul-02 CG Format / style changes; added section breaks and headers
          22-Oct-02 ET v2.2.5; used interface skeleton v1.11
         

       

         UniInt End-User Interface to the PI System 

       

       

       
         

       

       

       

       

       

      PI-Foxboro Interface Manual 

       

      The Title of the Interface  

       

       

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

       

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

       

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

       

       

      PI-Foxboro Interface Manual 

       

       

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

       

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

       

       

      PI-Foxboro Interface Manual 

       

       

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

       

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

       

      PI-Foxboro Interface Manual 

Search more related documents:PI-Foxboro Interface
Download Document:PI-Foxboro Interface

Set Home | Add to Favorites

All Rights Reserved Powered by Free Document Search and Download

Copyright © 2011
This site does not host pdf,doc,ppt,xls,rtf,txt files all document are the property of their respective owners. complaint#downhi.com
TOP