Citect Interface to the PI System - OSIsoft
Citect
Interface to the PI System
Version 2.6.1.7
Rev C
How to Contact Us
|OSIsoft, Inc. |Worldwide Offices |
|777 Davis St., Suite 250 |OSIsoft Australia |
|San Leandro, CA 94577 USA |Perth, Australia |
| |Auckland, New Zealand |
|Telephone |OSI Software GmbH |
|(01) 510-297-5800 (main phone) |Altenstadt, Germany |
|(01) 510-357-8136 (fax) |OSI Software Asia Pte Ltd. |
|(01) 510-297-5828 (support phone) |Singapore |
| |OSIsoft Canada ULC |
|techsupport@ |Montreal, Canada |
| |OSIsoft, Inc. Representative Office |
|Houston, TX |Shanghai, People’s Republic of China |
|Johnson City, TN |OSIsoft Japan KK |
|Mayfield Heights, OH |Tokyo, Japan |
|Phoenix, AZ |OSIsoft Mexico S. De R.L. De C.V. |
|Savannah, GA |Mexico City, Mexico |
|Seattle, WA | |
|Yardley, PA | |
|Sales Outlets and Distributors |
|Brazil |South America/Caribbean |
|Middle East/North Africa |Southeast Asia |
|Republic of South Africa |South Korea |
|Russia/Central Asia |Taiwan |
| |
|WWW. |
|OSIsoft, Inc. is the owner of the following trademarks and registered trademarks: PI System, PI ProcessBook, Sequencia, |
|Sigmafine, gRecipe, sRecipe, and RLINK. All terms mentioned in this book that are known to be trademarks or service marks |
|have been appropriately capitalized. Any trademark that appears in this book that is not owned by OSIsoft, Inc. is the |
|property of its owner and use herein in no way indicates an endorsement, recommendation, or warranty of such party’s |
|products or any affiliation with such party of any kind. |
| |
|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 |
| |
|Unpublished – rights reserved under the copyright laws of the United States. |
| |
|© 1997-2006 OSIsoft, Inc. PI_Citect.doc |
Table of Contents
Introduction 1
Reference Manuals 1
Supported Features 2
Diagram of Hardware Connection 4
Principles of Operation 5
Input Points 5
Output Points 5
Installation Checklist 7
Interface Installation 9
Naming Conventions and Requirements 9
Interface Directories 10
The PIHOME Directory Tree 10
Interface Installation Directory 10
Interface Installation Procedure 10
Installing the Interface as an Windows Service 10
Installing the Interface Service with PI Interface Configuration Utility 11
Installing the Interface Service Manually 13
Communication Test Programs 15
Testing the Connection to PI 15
Testing the Connection to Citect 15
Connecting to Citect 15
Reading Points 16
Writing Points 16
Digital States 19
Interface Status Tag 19
PI Point Configuration 23
Point Attributes 23
Tag 23
PointSource 23
PointType 23
Location1 23
Location2 24
Location3 24
Location4 24
Location5 24
InstrumentTag 24
ExcDesc 24
Scan 25
Zero/Span 25
Shutdown 26
Output Points 26
Trigger Method 1 (Recommended) 26
Trigger Method 2 27
Performance Point Configuration 29
Configuring Performance Points with PI ICU (NT-Intel) 29
Configuring Performance Points Manually 30
I/O Rate Tag Configuration 33
Monitoring I/O Rates on the Interface Node 33
Configuring I/O Rate Tags with PI ICU (Windows) 33
Configuring I/O Rate Tags Manually 34
Configuring the PI Point on the PI Server 35
Configuration on the Interface Node 35
Startup Command File 37
Configuring the Interface with PI ICU 37
citect Interface Tab 39
Command-line Parameters 44
Sample PI_Citect.bat File 50
Interface Failover Configuration 51
Examples 51
Interface Watchdog Configuration and “StartService” 53
Interface Node Clock 55
Security 57
Starting / Stopping the Interface 59
Starting Interface as a Service 59
Stopping Interface Running as a Service 59
The service can be removed by: 59
Buffering 61
Configuring Buffering with PI ICU (Windows) 61
Configuring Buffering Manually 65
Example piclient.ini File 66
Appendix A: Error and Informational Messages 67
Message Logs 67
Interface Messages 67
System Errors and PI Errors 69
Revision History 71
Introduction
The PI Citect Interface provides communication between PI and Citect. It is based on a version of the OSIsoft standard Universal Interface (UniInt), adapted for the Citect environment.
Data is transferred between Citect and PI via the Citect application programming interface (CTAPI) and the PI API. The interface runs on Microsoft Windows NT 4.0 (service pack 3) or greater.
The interface supports input tags (from Citect to PI) and output tags (from PI to Citect). It counts the events to and from these tags, including exception tests, and sends its totals periodically to PI.
Data from Citect is received at cyclic frequencies or by exception in the data. The frequency of the cycles is configured by the user and controlled by the interface. The number of tags that the interface is capable of servicing is limited only by external limitations, for example, the amount of available memory in the computer.
Changes that are made to the PI point database are reflected in the interface. This includes the adding, editing and deleting of tags.
All error information and some summary information are output to a log file. If the interface is run interactively from an MS-DOS prompt, then the output is displayed on the screen. The amount of summary information that is output is configurable by the user and is minimal by default. For information about configuring information messages, see the “/db” and “/df” headings of the Startup Command File.
For the interface to be able to connect to the Citect database, the Citect node must have sufficient API licenses available. The number of Citect licenses available is shown in the “General” window of the “Citect Kernel” utility. Note that with earlier versions of Citect (before 5.40), Citect included 2 API licenses by default. As of version 5.40, the Citect API licenses (also known as Connection licenses) must be explicitly included.
Reference Manuals
OSIsoft
• UniInt End User Document
• PI Data Archive Manual
• PI API Installation Instructions
• PI ICUUserManual.doc
Vendor
• Citect Users Guide Version 5 or later
• Citect Getting Started
Supported Features
|Feature |Support |
|Part Number |PI-IN-CI-CITEC-NTI |
|Platforms |Windows NT, 2000, XP, 2003 |
|APS Connector |No |
|Point Builder Utility |No |
|ICU Control |Yes |
|PI Point Types |real, digital, integer, string |
|Sub-Second Timestamps |Yes |
|Sub-Second Scan Classes |Yes |
|Automatically Incorporates PI Point Attribute Changes |Yes |
|Exception Reporting |No |
|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 String Support |N/A |
|* Source of Timestamps |PI Interface |
|History Recovery |No |
|* Fail over |Yes |
|* UniInt-based |Yes |
|* Vendor Software Required on PI Interface Node |Yes |
|* Vendor Software Required on Foreign Device |Yes |
|Vendor Hardware Required |No |
|* Additional PI Software Included with Interface |Yes |
* See paragraphs below for further explanation.
Source of Timestamps
Timestamps are generated within the interface. If the scan class is sub-second, then sub-second timestamps will be used.
UniInt-based
UniInt stands for Universal Interface, and it is an OSIsoft-developed template used to create many of our interfaces. UniInt is not a separate product or file, it is solely a template used by our developers, and is integrated into the 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. UniInt is constantly being upgraded with new options and features. In any UniInt interface, UniInt uses some of the supplied configuration parameters, and some parameters are interface-specific features of the interface.
The UniInt End User Document is a supplement to this manual.
Failover
This interface supports failover. Two instances of the interface can run to collect data for the same set of PI tags. Using a command-line parameter, one instance is defined as the primary and the other as the secondary. They both may run on the same machine, or on different machines. They use TCP/IP to coordinate the data collection. Multiple TCP/IP connections between the two interfaces can be used to increase the level of redundancy.
Vendor Software Required on PI Interface Node
The interface requires that the PI API and Citect API be installed on the PI Interface node. The PI API version must be at least 1.2.3.4. The version of Citect API client depends on the version of Citect. Version 2.x of the interface has been built for Version 5.1 or later of Citect.
Vendor Software Required on Foreign Device
The interface requires that Citect API licenses are available on the Citect system. If the Citect system does not have an API license available, the connection request from the interface will be rejected by the Citect node.
Additional PI Software
A test utility called “PI_CitectTest.exe” is included with the interface. This can be used to ensure that the machine running the interface can connect successfully to the Citect node and read values from the Citect real-time database.
Diagram of Hardware Connection
[pic]
There are several options for how the PI Citect interface is run.
If the Citect host node is not heavily loaded then option 1, where the PI Citect interface and the PI API software are run directly on the Citect node is the recommended approach. It has the advantage of the interface running locally on the Citect node and so eliminates a network connection, but also supports buffering for when there are network or PI server problems.
Option 2 also supports buffering; nevertheless, access to Citect is required including an additional machine. This configuration is well suited for situations where the Citect node is heavily loaded. It is also useful when several Citect nodes are to be scanned, as several copies of the Citect interface can run on the same PI Interface node.
Option 3 is when the interface is run directly on the PI Server. This is simple to install; however, it lacks any buffering and therefore it is not the recommended approach.
Principles of Operation
When the interface starts up, it receives several parameters from the interface startup file. These parameters define the PI Point Source code, interface id, and the set of Scan Class time periods to be available as well as other parameters as described in the section “Startup Command File”.
Log messages are recorded either in the PI log file or the PI application log file. The PI log file is named PI\PILog\pimsg_yymmdd.dat and is renewed daily. The status of the interface is recorded in the PI application log file PIPC\Dat\pipc.log.
The interface begins by searching the PI Point Database for all tags configured with the PointSource code specified in the interface startup file. If the interface identifier (/id=) has been specified as a command-line argument, then the point configuration is checked to ensure the point has the same interface identifier. It then records these tags in dynamic group structures in the computer memory based on logical groupings (e.g. one list per scan class, per point type).
When the interface process has completed these initial tasks, it enters a permanent loop in which it processes input and output tags. This loop is repeated until the interface is stopped. The actions taken within this loop are described below.
Input Points
Input tags are serviced by the interface to collect data from Citect and send it to PI. They can either be scan-based or event-based. Scan-based tags are serviced regularly at a pre-defined time interval. Event-based tags are serviced when a change occurs in a separate PI tag.
Scan-based
It is possible to configure an input tag to be updated at a regular time interval specified by any one of a set of user-defined scan classes. The interval of each scan class is based from and controlled by the interface. When a scan class’s time interval expires, the data for the tags that are configured for that scan class is requested. All tags for a particular scan class are retrieved from Citect at once. For information about defining scan-based input tags, see the description of /f in the Startup Command File section.
Event-based
An input tag can be configured to send data to PI on an event, based on the exception of the data from a separate PI point. When the value of this separate PI point changes the data for the actual tag is requested from Citect. For information about setting up an exception tag, see the ExDesc heading of the PI Point Configuration section.
Output Points
Output tags are serviced by the interface to collect data from PI and send it to Citect based on the exception of a separate PI tag (referred to as a “source” tag). When the value of this source tag changes, it is sent both to Citect and to the output tag. This keeps a record of data that were sent to Citect. For more information about setting up an output tag, see the SourceTag heading in the PI Point Configuration section. If a tag is defined to be an output tag, its settings override any settings that apply to input tags.
Installation Checklist
For those users who are familiar with running PI data collection interface programs, this checklist helps you get the PI Citect 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.
1. Install the PI Interface Configuration Utility (which installs PI SDK and PI API)
2. Verify that PI API has been installed.
3. Install the interface.
4. Ensure that there are sufficient Citect API licenses available on the Citect node.
5. Test the connection between the interface node and the Citect node using the “PI_CitectTest.exe” connection tester.
6. Define digital states.
Cit_Bad_Conn - an indicator of communication problems with the Citect node.
If an interface status tag (/itag=) is to be used then a digital set as defined in “Interface Status Tag” section (page 19) is required.
7. Choose a point source. If PI 2 home node, create the point source.
8. Configure PI points.
Location1 is the input / output flag (0=input, 1=output).
Location2 is the interface identifier.
Location3 is not used.
Location4 is the scan class.
Location5 is not used.
ExDesc is optional and used for event driven point scans (EVENT=).
InstrumentTag is the Citect point name.
9. Configure performance points.
10. Configure I/O rate tag.
11. Configure the interface using the PI Interface Configuration Utility or edit startup command file. OSIsoft recommends using the PI Interface Configuration Utility.
If the interface is NOT running directly on the Citect node then the following parameters must be defined
/cihost= name of Citect node
/ciuser= name of Citect user used by remote connection
/cipass= password for user defined by /ciuser=
12. Setup interface node clock.
13. Setup security.
14. Start the interface without buffering.
15. Verify data.
16. Stop interface, start buffering, start interface.
Interface Installation
OSIsoft recommends that interfaces be installed on PI Interface nodes instead of directly on the PI Server node. An Interface node is any node other than the PI Server node where the PI Application Programming Interface (PI API) has been installed (see the PI API Installation Instructions manual). With this approach, the PI Server need not compete with interfaces for CPU time. The primary function of the PI Server is to archive data and to service clients that request data.
After the interface has been installed and tested, Bufserv should be enabled on the API node (once again, see the PI API Installation Instructions manual). Bufserv is distributed with the PI API. It is a utility program that provides the capability to store and forward events to a PI Server, allowing continuous data collection when communication to the PI Server is lost. Communication will be lost when there are network problems or when the PI Server is shut down for maintenance, upgrades, backups, or unexpected failures.
In most cases, interfaces on API nodes should be installed as automatic services. Services keep running after the user logs off. Automatic services automatically restart when the computer is restarted, which is useful in the event of a power failure.
The guidelines are different if an interface is installed on the PI Server node. In this case, the typical procedure is to install the PI Server as an automatic service and interfaces as manual services that are launched by site-specific command files when the PI Server is started. Interfaces that are started as manual services are also stopped in conjunction with the PI Server by site-specific command files. This typical scenario assumes that Bufserv is not enabled on the PI Server node. Bufserv can be enabled on the PI Server node so that interfaces on the PI Server node do not need to be started and stopped in conjunction with PI; however, it is not standard practice to enable buffering on the PI Server node. Please see the UniInt End User Document for special procedural information.
Naming Conventions and Requirements
In the installation procedure below, it is assumed that the name of the interface executable is PI_Citect.exe and that the startup command file is called PI_Citect.bat.
It is customary for the user to rename the executable and the startup command file when multiple copies of the interface are run. For example, one would typically use PI_Citect1.exe and PI_Citect1.bat for interface number 1, PI_Citect2.exe and PI_Citect2.bat for interface number 2, and so on. When an interface is run as a service, the executable and the command file must have the same root name because the service looks for its command-line arguments in a file that has the same root name.
Interface Directories
The PIHOME Directory Tree
The PIHOME directory tree is defined by the PIHOME entry in the pipc.ini configuration file. This pipc.ini file is an ASCII text file, which is located in the %WinDir% directory. A typical pipc.ini file contains the following lines:
[PIPC]
PIHOME=c:\pipc
The above lines define the \pipc directory as the root of the PIHOME directory tree on the C: drive. OSI recommends using \pipc as the root directory name. The PIHOME directory does not need to be on the C: drive.
Interface Installation Directory
Place all copies of the interface into a single directory. The suggested directory is:
PIHOME\Interfaces\Citect\
Replace PIHOME with the corresponding entry in the pipc.ini file.
Interface Installation Procedure
The PI Citect interface setup program uses the services of the Microsoft Windows Installer. Windows Installer is a standard part of Windows 2000 and later. When running on Windows NT 4.0 systems, the PI Citect setup program will install the Windows Installer itself if necessary. To install, run the Citect_x.x.x.x.exe installation kit.
Installing the Interface as an Windows Service
The PI Citect interface service can be created, preferably, with the PI Interface Configuration Utility, or can be created manually.
Installing the Interface Service with PI Interface Configuration Utility
The PI Interface Configuration Utility provides a user interface for creating, editing, and deleting the interface service. For example:
[pic]
Service Configuration
Service Name
The Service to Add box shows the name of the current interface service. This service name is obtained from the interface executable.
Display Name
The Display Name text box shows the current Display Name of the interface service. If there is currently no service for the selected interface, the default Display Name is the service name with a “PI-” prefix. Users may specify a different Display Name. OSIsoft suggests that the prefix “PI-” be appended to the beginning of the interface to indicate that the service is part of the OSIsoft suite of products.
Service Type
The Service Type indicates whether the interface service will start automatically or need to be started manually on reboot.
• 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, interface services are set to start automatically.
Dependencies
The Installed services list is a list of the services currently installed on this machine. Services upon which this Interface is dependant should be moved into the Dependencies list using the [pic] button. For example, if API Buffering is running, then “bufserv” should be selected from the list at the right and added to the list on the left. Often interface services also depend on a vendor program, such as the Fisher-Rosemount chipservice. To remove a service from the list of dependencies, use the [pic] button, and the service name will be removed from the “Dependencies” list.
When the PI Interface is started (as a service), the services listed in the dependency list will be verified as running (or an attempt will be made to start them). If the dependent service(s) cannot be started for any reason, then the PI interface service will not run.
Note: Please see the PI Log and Operating System Event Logger for messages that may indicate the cause for any server not running as expected.
[pic] - Add Button
To add a dependency from the list of Installed services, select the dependency name, and click the Add button.
[pic] - Remove Button
To remove a selected dependency, highlight the service name in the Dependencies list, and click the Remove button.
The full name of the service selected in the Installed services list is displayed below the Installed services list box.
Create
The Create button adds the displayed service with the specified Dependencies and with the specified Startup Type.
Remove
The Remove button removes the displayed service. If the service is not currently installed, or if the service is currently running, this button will be grayed out.
Start or Stop Service
To Start or Stop an interface service, use the Start button [pic] and a Stop button [pic] on the ICU toolbar. If this interface service is not currently installed, these buttons will remain grayed out until the service is added. If this interface service is running, the Stop button is available. If this service is not running, the Start button is available.
The status of the Interface service is indicated in the lower portion of the PI ICU dialog.
[pic]
Installing the Interface Service Manually
One can get help for installing the interface as a service at any time with the command:
PI_Citect.exe –help
Change to the directory where the PI_Citect1.exe executable is located. Then, consult the following table to determine the appropriate service installation command.
|Windows Service Installation Commands on a PI Interface Node or a PI Server node |
|with Bufserv implemented |
|Manual service |PI_Citect.exe –install –depend “tcpip bufserv” |
|Automatic service |PI_Citect.exe –install –auto –depend “tcpip bufserv” |
|Windows Service Installation Commands on a PI Interface Node or a PI Server node |
|without Bufserv implemented |
|Manual service |PI_Citect.exe –install –depend tcpip |
|Automatic service |PI_Citect.exe –install –auto –depend tcpip |
When the interface is installed as a service on the PI Server node and when Bufserv is not implemented, a dependency on the PI network manager is not necessary because the interface will repeatedly attempt to connect to the PI Server until it is successful.
Note: Interfaces are typically not installed as automatic services when the interface is installed on the PI Server node.
Check the Microsoft Windows services control panel to verify that the service was added successfully. One can use the services control panel at any time to change the interface from an automatic service to a manual service or vice versa.
Communication Test Programs
The interface is supplied with a program, PI_CitectTest.exe that connects only to Citect. This test program connects to Citect in exactly the same way as the interface does. It eliminates PI from the equation during any connection problems that may occur because it makes no reference to the PI system.
The program is run from the MS-DOS command prompt and needs no command-line arguments. It begins by initializing a connection to Citect and displaying version information as retrieved from Citect.
Before attempting to run the interface, a connection test should be done individually for both the PI API and Citect API client. If a test program is run that makes reference to only one system, any problems that occur with the communication will be specific to the system being connected to; thus problems can be found and corrected more efficiently. Once connection has been established and confirmed using the test programs described below, the connection specifications for both PI and Citect that have been set up will function equally well for the interface.
Testing the Connection to PI
PI is supplied with a test program, Apisnap.exe, which makes a connection only to PI, eliminating any potential problems connecting to Citect. For more information about ApiSnap.exe see the PI Data Archive for Windows NT and Unix manual.
Testing the Connection to Citect
The interface is supplied with a program, PI_CitectTest.exe that connects only to Citect. This test program connects to Citect in exactly the same way as the interface does. It eliminates PI from the equation during any connection problems that may occur because it makes no reference to the PI system.
The program is run from the MS-DOS command prompt and needs no command line arguments. It begins by initializing a connection to Citect and displaying version information as retrieved from Citect.
Connecting to Citect
The program will prompt for a host with which to establish a remote connection to Citect. If the Citect system to be connected to is version 5.20 or greater and is on a remote machine, the remote machine name or IP address must be entered at the prompt. The program will then prompt for a Citect user name and password before it attempts to connect. Following is an example:
Citect host: 206.347.209.32
Citect User: ENGINEER
Password : ******
Attempting to connect to Citect on 206.347.209.32 ...
Connected to Citect Version 5.20 Rev. 00
handle = 7e45f0
(R)ead or (W)rite:
...
If the Citect system is on the local machine, it is not necessary to supply a host name. Also, if the version of Citect is earlier than 5.20, remote connections to Citect are not possible. Pressing will bypass remote connections and attempt a connection to the Citect system on the local machine. Following is an example:
Citect host:
Attempting to connect to Citect on local machine ...
Connected to Citect Version 5.20 Rev. 00
handle = 7e45f0
(R)ead or (W)rite:
...
Note: The test program supplied with version 2.0.x of the interface will not prompt for a host but immediately attempt to connect to the Citect system on the local machine.
Reading Points
After connecting to Citect, pressing R (not case-sensitive) will put the test program into read mode. It will ask the user for the name of a Citect point to read and display the value for that point. It will only display the value once and then ask for another Citect point to read. Pressing without entering a point name will cause the program to use the last point that was entered.
Following is an example of the test program’s output using read mode:
...
(R)ead or (W)rite: R
Citect point to read from: LOOP_1_PV
LOOP_1_PV = 136.500
Citect point to read from:
LOOP_1_PV = 145.200
Citect point to read from:
LOOP_1_PV = 149.600
Citect point to read from: LOOP_2_PV
LOOP_2_PV = 5.700
Citect point to read from:
LOOP_2_PV = 7.200
Citect point to read from:
LOOP_2_PV = 10.500
Citect point to read from: ^C
Writing Points
After connecting to Citect, pressing W (not case-sensitive) will put the test program into write mode. It will ask the user for the name of a Citect point to write to and ask for a value to write to that point. Pressing without entering a point name will cause the program to use the last point that was entered. Pressing without entering a value will cause the program to write a random number.
Following is an example of the test program’s output using read mode:
...
(R)ead or (W)rite: W
Citect point to write to: LOOP_1_SP
Value to write: 95.22
Citect point to write to:
Value to write:
Writing random number: 75.602
Citect point to write to: LOOP_2_SP
Value to write:
Writing random number: 77.230
Citect point to write to: ^C
Digital States
PI digital states are discrete values represented by strings. These strings are organized in PI as digital state sets. Each digital state set is a user-defined list of strings, enumerated from 1 to n to represent different values of discrete data. For more information about PI digital tags and editing digital state sets, see the PI Data Archive Manual for Windows NT and Unix manual.
A Citect point that contains discrete data can be stored in PI as a digital tag. A Digital tag associates discrete data with a digital state set, as specified by the user.
System Digital State Set
Similar to digital state sets is the system digital state set. This set is used for all tags, regardless of type to indicate the state of a tag at a particular time. For example, if the interface receives bad data from a Citect point, it writes the system digital state bad input to PI instead of a value. The system digital state set has many unused states that can be used by the interface and other PI clients.
The interface uses two states that are not defined as part of the standard PI system digital state set. They are as follows:
Cit_Bad_Conn: This state indicates that the connection to Citect has been lost. It must be entered precisely as shown.
I/F_Stopped: This state indicates that the interface was not running at a particular time. This state can be entered as any string but must match the /stopstat argument in the interface startup file. See the /stopstat heading of the Startup Command File section for more information.
These two states need to be inserted into unused states in the system digital state set. An unused state is identified by a label ?# where # is the number of the unused state; for example, if state 100 is unused it will have ?100 as its label.
Interface Status Tag
When using the /itag= argument to specify an interface status PI tag, the interface assumes than the tag will contain a predefined set of digital states. If the tag does not have the states as expected, the value of the PI tag will be meaningless.
The following shows the digital state set that should be used for the interface status tag.
|State |Digital State String |Description |
|0 |Intf Running |Standalone, interface running normally |
|1 |Intf Stopped |Standalone, interface stopped |
|2 |Intf DCS Error |Standalone, unable to communicate with Citect node |
|3 |Pri Running |Primary, interface running and collecting data from Citect |
|4 |Pri Stopped |Primary, interface stopped |
|5 |Pri DCS Error |Primary, unable to communicate with Citect node |
|6 |Sec Ready |Secondary, interface running (waiting) |
|7 |Sec Stopped |Secondary, interface stopped |
|8 |Sec DCS Error |Secondary, unable to communicate with Citect node |
|9 |Sec Socket Down |Secondary, TCP/IP sockets error |
|10 |Sec Primary Down |Secondary, interface running and collecting data from Citect as the |
| | |primary interface has failed. |
There should be one status tag for each copy of the interface running. The tags should also have the PointSource attribute set to L.
Point Source
The PointSource is a single, unique character that is used to identify the PI point as a point that belongs to a particular interface. For example, one may choose the letter S to identify points that belong to the PI Citect interface. To implement this, one would set the PointSource attribute to S for every PI Point that is configured for the PI Citect interface. Then, if one uses /ps=S on the startup-command line of the PI Citect interface, the PI Citect interface will search the PI Point Database upon startup for every PI point that is configured with a PointSource of S. Before an interface loads a point, the interface usually performs further checks by examining additional PI point attributes to determine whether a particular point is valid for the interface. For additional information, see the /ps argument.
Case-sensitivity for PointSource Attributes
If the interface is running on a PINet node and the Server node is a PI 3 system, use a capital letter (or a case-insensitive character such as a number, a question mark, etc.) for the PointSource attribute when defining points. For all other scenarios, one does not need to be careful with the case of the PointSource.
In all cases, the point source character that is supplied with the /ps command-line argument is not case sensitive. That is, /ps=S and /ps=s are equivalent. One only needs to be careful with the case of the PointSource during point definition, and only if the interface will be running on a PINet node communicating to a PI 3 Server.
PI 2 Server Nodes
The following point source characters are reserved on PI 2 systems and cannot be used as the point source character for an interface: C, ?, @, Q, T. Also, if one does not specify a point source character when creating a PI point, the point is assigned a default point source character of L. Therefore, it would be confusing to use L as the point source character for an interface.
Before a PI point with a given point source can be created, the point source character must be added to the PI 2 point source table. For example, if point source P is not defined in the PI 2 point source table, a point with a point source of P cannot be created. This prevents the user from accidentally creating a point with an incorrect point source character.
Defining a Point Source Character in the PI 2 Point Source Table
1. Enter PI by typing the following command from a VMS 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 minimum and maximum values for the Location1 to Location5 attributes.
| |Location1 |Location2 |Location3 |Location4 |Location5 |
|Minimum |0 |0 |-20000000 |0 |-20000000 |
|Maximum |1 |99 |20000000 |20000000 |20000000 |
5. Select “Save” from the menu.
PI 3 Server Nodes
No point source table exists on a PI 3 Server, which means that points can be immediately created on PI 3 with any point source character. Several subsystems and applications that ship with PI 3 are associated with default point source characters The Totalizer Subsystem uses the point source character T, the Alarm Subsystem uses G and @, Random uses R, RampSoak uses 9, and the Performance Equations Subsystem uses C. Either do not use these point source characters or change the default point source characters for these applications. Also, if one does not specify a point source character when creating a PI point, the point is assigned a default point source character of L. Therefore, it would be confusing to use L as the point source character for an interface.
PI Point Configuration
The PI point is the basic building block for controlling data flow to and from the PI Data Archive. 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
Tag
A tag is a label or name for a point. Any tag name can be used in accordance to the normal PI point naming conventions.
PointSource
The PointSource is a single, unique character that is used to identify the PI point as a point that belongs to a particular interface. For additional information, see the /ps command-line argument and the “Point Source” section.
PointType
Typically, device point types do not need to correspond to PI point types. For example, integer values from a device can be sent to floating point or digital PI tags. Similarly, a floating-point value from the device can be sent to integer or digital PI tags, although the values will be truncated.
PI 2 Server Nodes
Scaled real, full-precision real, integer, and digital point types are supported on PI 2 Servers. For more information on the individual point types, refer to the Data Archive (DA) section of PI System Manual I.
PI 3 Server Nodes
Float16, float32, float64, int16, int32, digital, and string point types are supported on PI 3 Servers. For more information on the individual point types, see PI Data Archive for NT and UNIX.
Location1
This field is used to specify whether a PI tag is an input tag (from Citect to PI) or an output tag (from PI to Citect).
0 – Input tag
1 – Output tag
Location2
The second location field specifies the interface instance number. In the startup .bat file, there is a parameter for interface ID, /ID=#, where # is any number. The Location2 field for each tag must match that number, or the tag will be ignored.
Location3
Location 3 is not used in this interface.
Location4
Scan-based Inputs
For scan-based collection of data, Location4 defines the scan class for the PI point. The scan class determines the frequency at which input points are scanned for new values. For more information, see the description of the /f flag in the section called “Startup Command File.”
Trigger-based Inputs and Output Points
Location 4 should be set to zero for these points.
Location5
Location 5 is not used in this interface.
InstrumentTag
This field contains the full name of Citect point with which it is associated. For input tags, it represents the Citect point that the data is to be collected from. For output tags, it represents the Citect point that data is to be written to. The point name in this field is not case sensitive. The attribute is limited to 32 characters.
ExcDesc
This field is the extended descriptor of a tag and is limited to 80 characters.
Trigger-based Inputs
For trigger-based input points, a separate trigger point must be configured. An input point is associated with a trigger point by entering a case-insensitive string in the extended descriptor (ExDesc) PI point attribute of the input point of the form:
keyword=trigger_tag_name
where keyword is replaced by “event” or “trig” and trigger_tag_name is replaced by the name of the trigger point. There should be no spaces in the string. UniInt automatically assumes that an input point is trigger-based instead of scan-based when the keyword=trigger_tag_name string is found in the extended descriptor attribute.
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 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.
Performance Points
For UniInt-based interfaces, the extended descriptor is checked for the string PERFORMANCE_POINT. If this character string is found, UniInt treats this point as a performance point. See the section called “Performance Point Configuration.”
Scan
By default, the Scan attribute has a value of 1, which means that scanning is turned on for the point. Setting the scan attribute to 0 turns scanning off. If the scan attribute is 0 when the interface starts, SCAN OFF will be written to the PI point. If the scan attribute is changed from 1 to 0 while the interface is running, SCAN OFF will also be written to the PI point after the point edit is detected by the interface.
There is one other situation, which is independent of the Scan attribute, where UniInt 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, the point will be removed from the interface, and SCAN OFF will be written to the point. For example, if the PointSource of a PI point that is currently loaded by the interface is changed, the point will be removed from the interface and SCAN OFF will be written to the point.
Input tags are serviced by the interface to collect data from Citect and send it to PI. They can either be scan-based or event-based.
Scan-based
Scan based tags are serviced regularly at a pre-defined time interval. An input tag can be configured to be updated at a regular time interval specified by any one of a set of user-defined scan classes. The interval of each scan class is based from and controlled by the interface. When a scan class’s time interval expires, the data for the tags that are configured for that scan class is requested. All tags for a particular scan class are retrieved from Citect at once. For information about defining scan-based input tags, see the description of /f in the Startup Command File section.
Event-based
Event-based tags are serviced when a change occurs in a separate PI tag. An input tag can be configured to send data to PI on an event, based on the exception of the data from a separate PI point. When the value of this separate PI point changes the data for the actual tag is requested from Citect. For information about setting up an exception tag, see the “Trigger-based Inputs” heading of the PI Point Configuration section.
Zero/Span
This field specifies the range of the PI tag’s zero and span. If the value of a Float16 or Int16 tag is outside of its specified range, either the digital state UnderRange or OverRange will be written to the tag. If the tag is specified as a Float32 or Int32, the input value is written to PI even when it is out of range. This range is also used to determine the compression dead-band width in engineering units when using the CompDevPercent attribute. For more information about the CompDevPercent attribute, see the PI Data Archive for Windows NT and Unix manual.
Shutdown
PI 2 Server Nodes
The Shutdown attribute is not used if the server node is a PI 2 system. For information on configuring shutdown events for PI 2, see Data Archive (DA) section 4.2.3 of PI System Manual I.
PI 3 Server Nodes
The shutdown attribute is used only if the server node is a PI 3 system.
The Shutdown attribute is 1 (true) by default. The default behavior of the PI Shutdown subsystem is to write the SHUTDOWN digital state to all PI points when PI is started. The timestamp that is used for the SHUTDOWN events is retrieved from a file that is updated by the Snapshot Subsystem. The timestamp is usually updated every 15 minutes, which means that the timestamp for the SHUTDOWN events will be accurate to within 15 minutes in the event of a power failure. For additional information on shutdown events, refer to PI Data Archive for NT and UNIX.
Note: The SHUTDOWN events that are written by the PI Shutdown subsystem are independent of the SHUTDOWN events that are written by the interface when the /stopstat command-line argument is specified.
One can disable SHUTDOWN events from being written to PI when PI is restarted by setting the Shutdown attribute to 0 for each point. Alternatively, one can change the default behavior of the PI Shutdown Subsystem to write SHUTDOWN events only for PI points that have their Shutdown attribute set to 0. To change the default behavior, edit the \PI\dat\Shutdown.dat file, as discussed in PI Data Archive for NT and UNIX.
Bufserv
It is undesirable to write shutdown events when Bufserv 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 shutdown, Bufserv will continue to collect data for the interface, making it undesirable to write SHUTDOWN events to the PI points for this interface.
Output Points
Output points control the flow of data from the PI Data Archive to any destination that is external to the PI Data Archive, such as a PLC or a third-party database. For example, to write a value to a setpoint on the Citect system, one would use an output point.
Outputs are triggered for UniInt-based interfaces. That is, outputs are typically not scheduled to occur on a periodic basis. There are two mechanisms for triggering an output.
Trigger Method 1 (Recommended)
For trigger method 1, a separate trigger point must be configured. The output point must have the same point source as the interface. The trigger point can be associated with any point source, including the point source of the interface. Also, the point type of the trigger point does not need to be the same as the point type of the output point.
The output point is associated with the trigger point by setting the SourceTag attribute of the output point equal to the tag name of the trigger point. An output 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 value that was sent to the Snapshot to trigger an output, but the timestamp of the new value needs to be more recent than the previous value. If no error is indicated, then the value that was sent to the trigger point is also written to the output point. If the output is unsuccessful, then an appropriate digital state that is indicative of the failure is usually written to the output point. If an error is not indicated, the output still may not have succeeded because the interface may not be able to tell with certainty that an output has failed.
Trigger Method 2
For trigger method 2, a separate trigger point is not configured. To trigger an output, write a new value to the Snapshot of the output point itself. The new value does not need to be different than the previous value to trigger an output, but the timestamp of the new value must be more recent than the previous value.
Trigger method 2 may be easier to configure than trigger method 1, but trigger method 2 has a significant disadvantage. If the output is unsuccessful, there is no tag to receive a digital state that is indicative of the failure, which is very important for troubleshooting.
Performance Point Configuration
One can configure performance points to monitor the amount of time in seconds that it takes an interface to complete a scan for a particular scan class. The closer the scan time is to 0 seconds, the better the performance. The scan time is recorded to millisecond resolution
Configuring Performance Points with PI ICU (NT-Intel)
[pic]
Create
To create a Performance Point, right click the line belonging to the tag to be created, and select Create.
Delete
To delete a Performance Point, right click the line belonging to the tag to be deleted, and select Delete.
Correct
If the “Status” of a point is marked “Incorrect”, the point configuration can be automatically corrected by ICU by right clicking on the line belonging to the tag to be corrected, and selecting Correct. The Performance Points are created with the following PI attribute values. If ICU detects that a Performance Point is not defined with the following, it will be marked Incorrect:
|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” |
Rename
To rename a Performance Point, right click the line belonging to the tag to be renamed, and select “Rename”.
Status
The Status column in the Performance Points table indicates whether the Performance Point exists for the scan class in column 2.
• Created – Indicates that the Performance Point does exist
• Not Created – Indicates that the Performance Point does not exist
• Deleted – Indicates that a Performance Point existed, but was just deleted by the user
Scan Class
The Scan Class column indicates which scan class the Performance Point in the Tagname column belongs to. 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.
Snapshot
The Snapshot column holds the snapshot value of each Performance Point that exists in PI. The Snapshot column is updated when the Performance Points/Counters tab is clicked, and when the interface is first loaded.
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 flag 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 flag for a description of scan classes.
3. Set the PointSource attribute to correspond to the /ps flag on the startup command line of the interface.
4. Set the PointType attribute to float32.
I/O Rate Tag Configuration
An I/O Rate point can be configured to receive 10-minute averages of the total number of exceptions per minute that are sent to PI by the interface. An exception is a value that has passed the exception specifications for a given PI point. Since 10-minute averages are taken, the first average is not written to PI until 10 minutes after the interface has started. One I/O Rate tag can be configured for each copy of the interface that is in use.
Monitoring I/O Rates on the Interface Node
For Windows and UNIX nodes, the 10-minute rate averages (in events/minute) can be monitored with a client application such as ProcessBook.
For Open VMS nodes, the rate (events/minute) can be monitored with the PISysExe:IOMonitor.exe program or with another client program such as Process Book. The IOMonitor program is discussed in PI System Manual I.
Configuring I/O Rate Tags with PI ICU (Windows)
The PI Interface Configuration Utility (PI ICU) provides a user interface for creating and managing IORates Tags.
[pic]
PI ICU currently allows for one I/O Rate tag to be configured for each copy of the interface that is in use. Some interfaces allow for multiple I/O Rates tags.
Enable IORates for this Interface
The Enable IORates for this interface check box enables or disables IORates for the current interface. To disable IORates for the selected interface, uncheck this box. To enable IORates for the selected interface, check this box.
Tag Status
The Tag Status column indicates whether the IORates tag exists in PI. The possible states are:
• Created – This status indicates that the tag exist in PI
• Not Created – This status indicates that the tag does not yet exist in PI
• Deleted – This status indicates that the tag has just been deleted
• Unknown – This status indicates that the ICU is not able to access the PI Server
In File
The In File column indicates whether the IORates tag listed in the tag name and the event counter is in the IORates.dat file. The possible states are:
• Yes – This status indicates that the tag name and event counter are in the IORates.dat file
• No – This status indicates that the tag name and event counter are not in the IORates.dat file
Event Counter
The Event Counter correlates a tag specified in the iorates.dat file with this copy of the interface. The command line equivalent is /ec=x, where x is the same number that is assigned to a tag name in the iorates.dat file.
Tagname
The tag name listed under the Tagname column is the name of the IORates tag.
Snapshot
The Snapshot column holds the snapshot value of the IORates tag, if the IORates tag exists in PI. The Snapshot column is updated when the IORates/Status Tags tab is clicked, and when the interface is first loaded.
Right Mouse Button Menu Options
Create
Create the suggested IORates tag with the tag name indicated in the Tagname column.
Delete
Delete the IORates tag listed in the Tagname column.
Rename
Allows the user to specify a new name for the IORates tag listed in the Tagname column.
Add to File
Adds the tag to the IORates.dat file with the event counter listed in the Event Counter Column.
Search
Allows the user to search the PI Server for a previously defined IORates tag.
Configuring I/O Rate Tags Manually
There are two configuration steps.
Configuring the PI Point on the PI Server
PI 2 Server Nodes
A listing of the I/O Rate Tags that are currently being monitored can be obtained with the command:
@PISysDat:
Create an I/O Rate Tag using one of the existing I/O Rate Tags as a template.
PI 3 Server Nodes
Create an I/O Rate Tag with the following point attribute values.
|Attribute |Value |
|PointSource |L |
|PointType |float32 |
|Compressing |0 |
|ExcDev |0 |
Configuration on the Interface Node
For the following examples, assume that the name of the PI tag is citect001, and that the name of the I/O Rate on the home node is citect001.
1. Edit/Create a file called iorates.dat in the PIHOME\dat directory. The PIHOME directory is defined either by the PIPCSHARE entry or the PIHOME entry in the pipc.ini file, which is located in the \%WinDir% directory. If both are specified, the PIPCSHARE entry takes precedence.
Since the PIHOME directory is typically C:\PIPC, the full name of the iorates.dat file will typically be C:\PIPC\dat\iorates.dat.
Add a line in the iorates.dat file of the form:
citect001, x
where citect001 is the name of the I/O Rate Tag and x corresponds to the first instance of the /ec=x flag in the startup command file. X can be any number between 2 and 34 or between 51 and 200, inclusive. To specify additional rate counters for additional copies of the interface, create additional I/O Rate tags and additional entries in the iorates.dat file. The event counter, /ec=x, should be unique for each copy of the interface.
2. Set the /ec=x flag on the startup command file of the interface to match the event counter in the iorates.dat file.
The interface must be stopped and restarted in order for the I/O Rate tag to take effect. I/O Rates will not be written to the tag until 10 minutes after the interface is started.
Startup Command File
For NT, command file names have a .bat extension. The Windows continuation character (^) allows one to use multiple lines for the startup command. The maximum length of each line is 1024 characters (1 kilobyte). The number of flags is unlimited, and the maximum length of each flag is 1024 characters.
Note: The UniInt End User Document includes details about other command line parameters which may be useful.
Configuring the Interface with PI ICU
Note: PI ICU requires PI 3.3 or greater.
The PI Interface Configuration Utility provides a graphical user interface for configuring PI interfaces. If the interface is configured by the PI ICU, the batch file of the interface (PI_Citect.bat) will be maintained by the PI ICU and all configuration changes will be kept in that file. The procedure below describes the necessary steps for using PI ICU to configure the PI Citect Interface.
From the PI ICU menu, select Interface, New, and then Browse to the PI_Citect.exe executable file. Then, enter values for Point Source and Interface ID#. A window such as the following results:
[pic]
“Interface name as displayed in the ICU (optional)” will have PI- pre-pended to this name and it will be the display name in the services menu.
Click on Add.
You should then see a display such as the following:
[pic]
Note that in this example the Host PI System is localhost, which means that the interface will be configured to communicate with the local PI Server. However, if you want the interface to communicate with a remote PI Server, you can do this by selecting ‘Connections…’ item from PI ICU menu and make it your default server. If you do not see the remote node in the list of servers, you can add that in.
Once you add the interface to PI ICU, near the top of the main PI ICU screen, the Interface Type should be citect. If not, use the drop-down box to change the Interface Type to be citect.
Click on Apply to enable the PI ICU to manage this copy of the PI Citect Interface.
[pic]
The next step is to make selections in the interface-specific tab (i.e. “citect”) that allow you to enter values for the startup parameters that are particular to the PI Citect Interface.
[pic]
Since the PI Citect Interface is a UniInt-based interface, in some cases the user will need to make appropriate selections in the UniInt tab. This tab allows the user to access UniInt features through the PI ICU and to make changes to the behavior of the interface.
If you want to set up the interface as a Windows Service, you can do that by using the Service tab. This tab allows you to configure the interface to run as a service as well as to start and stop the interface. You can also run the interface interactively from the PI ICU. To do that go to menu, select the Interface item and then Start Interactive.
For more detailed information on how to use the above-mentioned and other PI ICU tabs and selections, please refer to the PI Interface Configuration Utility User Manual. In the next section we will describe the selections that are available from the citect tab. After you have made your selections on the PI ICU GUI, you will need to press the Apply button in order for PI ICU to make these changes to the interface’s startup file.
citect Interface Tab
Since the startup file of the PI Citect Interface is maintained automatically by the PI ICU, you should use the citect tab to configure the startup parameters and not make changes in the file manually. The following is the description of interface configuration parameters used in the PI ICU Control and corresponding manual parameters.
[pic]
Citect Connection
Citect host machine
This parameter specifies the remote Citect machine name. An IP address may also be used instead of the host name. If the interface is to run on the same computer as Citect, then this argument should not be used. This parameter MUST be used in conjunction with the /ciuser and /cipass command-line parameters. (/CIHOST=hostname).
Citect user name
This parameter specifies the user name with the remote Citect machine. It is used in conjunction with the /cihost and /cipass parameters. If the /cihost is specified and the /ciuser is not, the interface will fail to initialize. (/CIUSER=username).
Citect password
This parameter specifies the password for the username within the remote Citect machine as specified by the /ciuser parameter. It is used in conjunction with the /cihost parameters. If /cihost is specified and the /cipass is not, the interface will fail to initialize. (/CIPASS=password).
Don’t send data to PI
This parameter prevents the interface from sending its data to PI. It is used for testing the throughput of Citect and the interface, generating as little interaction with PI as possible. If the appropriate event counters are configured, the interface will still count the number of Citect reads and writes and send their averages to the event counter tags in PI. It will not count the number of exceptions. (/NOPIWRITE)
Interface Recovery
On Lockup
The interface is able to detect when the Citect API failed to return. When this lockup occurs, the interface can Abort, Ignore the problem, or Restart. The default is /ONLOCKUP=Abort. If the interface is running under Windows 2000 as a service, the service can be configured to automatically restart on a failure.
If /ONLOCKUP=Restart is used, the interface will start an external utility and abort. The utility will wait for the service to stop and then restart it. (This is only required with NT)
Service Name
This parameter specifies the name of the service that the restart utility will attempt to start if the interface detects a lockup and the /ONLOCKUP=Restart is used. The default is to use the name of the interface executable filename as the service name. If multiple instances of the service are configured to use the same executable file, then the service name will need to be defined explicitly. (/SERVICENAME=servicename)
Restart Utility
The parameter specifies the name of the external utility to be started if the interface detects a lockup and the /ONLOCKUP=Restart is used. The default utility name is StartService. The utility must be in the same directory as the interface executable. (/RESTARTUTIL=executablename)
Watchdog Timer (sec)
This parameter specifies the watchdog timeout period, in seconds. If the watchdog timer is not updated by the interface within this time period, then the interface will carry out the action defined by the /ONLOCKUP=x parameter (Ignore, Abort, Restart) (/WTO=#, default=60)
Citect Debug Flags
All messages
This is the same as specifying all of the debug flags for /df=. If this flag is used, all others are effectively redundant. (/DF=A)
Verbose messages
As for All debug messages, but also includes messages relating to the usage of the Citect API calls. Due to the large amount of data output, care should be taken when using this option. (/DF=V)
List creation messages
Every tag is added to a list in the CTAPI for retrieval from Citect, A message is reported every time one of these lists is created. (/DF=L)
Tag creation
A message is reported every time a tag is added to a CTAPI internal point list. The message indicates which list the point was added to. (/DF=T)
Input tag data
A message is reported that displays the value and status of the first five tags in each scan class and event class. (/DF=I)
Output tag data
A message is reported that displays the values and status of the first five tags in each output class. (/DF=O)
ctListRead() messages
A message is reported before and after each call to the ctListRead() Citect API function, which occurs when a scan list is read. (/DF=X)
ctListData() messages
A message is reported before and after each call to the ctListData() Citect API function, which occurs when the value is read for each tag in a scan list. This option will fill the pipc.log file very quickly and should be used with caution. (/DF=Y)
Failover
Enable failover
This check box is used to enable the interface to use failover.
Primary node
When running redundant interface, this flag specifies whether this instance will be the primary (P) or secondary (S) node. Only one instance can be specified as Primary. (/IMODE=P or S)
Failover Tag
The parameter specifies the name of a PI digital tag that will be used to store the status of the interface. The digital tag should have a digital state set as specified in the section Interface Status Tag. (/ITAG=digitaltag)
Failover nodes and Ports
When running redundant interfaces, this parameter give the host name and port number that should be used to establish the communications between the two instances of the interface. If both interface are running on the same machine, then use the host name “localhost”. The port number can be any unused port on the system. Up to three failover nodes:ports can be specified. (/IHOST=host:port)
Additional Parameters
This section is provided for any additional parameters that the current ICU control does not support.
Command-line Parameters
Command-line arguments can begin with a / or with a -. For example, the /ps=M and
–ps=M command-line arguments are equivalent.
|Parameter |Description |
|/ps=x |The /ps flag specifies the point source for the interface. X is not case sensitive |
|Required |and can be any single character. For example, /ps=P and /ps=p are equivalent. |
|/id=x |The /id flag is used to specify the interface identifier. |
|Optional |The interface identifier is a string that is no longer than 9 characters in length. |
|Note: Corresponds to location2 |UniInt concatenates this string to the header that is used to identify error |
|point attribute. |messages as belonging to a particular interface. See the section called “Error and |
| |Informational Messages” for more information. |
| |UniInt always uses the /id flag in the fashion described above. This interface also |
| |uses the /id flag to identify a particular interface copy number that corresponds to|
| |an integer value that is assigned to the Location2 point attribute. If the /id flag |
| |is a valid integer, then the interface will only process PI tags with the same value|
| |in the Location2 attribute. If the /id flag is not an integer, then the interface |
| |will process all PI tags with a matching PointSource and ignore the value of the |
| |attribute location2. |
|/f=SS |The /f flag defines the time period between scans in terms of hours (HH), minutes |
|or |(MM), and seconds (SS). The scans can be scheduled to occur at discrete moments in |
|/f=SS,SS |time with an optional time offset specified in terms of hours (hh), minutes (mm), |
|or |and seconds (ss). If HH and MM are omitted, then the time period that is specified |
|/f=HH:MM:SS |is assumed to be in seconds. |
|or |Each instance of the /f flag on the command line defines a scan class for the |
|/f=HH:MM:SS,hh:mm:ss |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 |
|Required for reading scan-based |the interface, the second occurrence defines the second scan class, and so on. PI |
|inputs |Points are associated with a particular scan class via the Location4 PI Point |
| |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 was started. In the above example, frequency is 60 seconds and offset is 5|
| |seconds for the first scan class. This means that if the interface was 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. |
| |This interface does not support sub-second scan classes. |
| |Wall Clock Scheduling |
| |Scan classes that strictly adhere to wall clock scheduling are now possible. This |
| |feature is available for interfaces that run on Windows and/or UNIX. Previously, |
| |wall clock scheduling was possible, but not across daylight savings time. For |
| |example, /f=24:00:00,08:00:00 corresponds to 1 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), one should use |
| |/f=24:00:00,00:08:00,L. The ,L at the end of the scan class tells UniInt to use the |
| |new wall clock scheduling algorithm. |
|/host=host:port |The /host flag is used to specify the PI Home node. Host is the IP address of the PI|
|Optional |Sever node or the domain name of the PI Server node. Port is the port number for |
| |TCP/IP communication. The port is always 5450 for a PI 3 Server and 545 for a PI 2 |
| |Server. It is recommended to explicitly define the host and port on the command line|
| |with the /host flag. Nevertheless, if either the host or port is not specified, the |
| |interface will attempt to use defaults. |
| |Defaults: |
| |The default port name and 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 an API node, the domain name of the PI 3 home node is |
| |Marvin, and the IP address of Marvin is 206.79.198.30. Valid /host flags would be: |
| |/host=marvin |
| |/host=marvin:5450 |
| |/host=206.79.198.30 |
| |/host=206.79.198.30:5450 |
|/stopstat |If the /stopstat flag is present on the startup command line, then the digital state|
|or |I/O Timeout will be written to each PI Point when the interface is stopped. |
|/stopatat= |If /stopstat=digstate is present on the command line, then the digital state, |
|digstate |digstate, will be written to each PI Point when the interface is stopped. For a PI 3|
|default: |Server, digstate must be in the system digital state table. For a PI 2 Server, where|
|/stopstat= |there is only one digital state table available, digstate must simply be somewhere |
|”Intf Shut” |in the table. UniInt uses the first occurrence in the table. |
|Optional |If neither /stopstat nor /stopstat=digstate is specified on the command line, then |
| |no digital states will be written when the interface is shut down. |
| |Examples: |
| |/stopstat=”Intf Shut” |
| |The entire parameter is enclosed within double quotes when there is a space in |
| |digstate. |
|/ec=x |The first instance of the /ec flag on the command line is used to specify a counter |
|Optional |number, x, for an I/O Rate point. If x is not specified, then the default event |
| |counter is 1. Also, if the /ec flag is not specified at all, there is still a |
| |default event counter of 1 associated with the interface. If there is an I/O Rate |
| |point that is associated with an event counter of 1, each copy of the interface that|
| |is running without /ec=x explicitly defined will write to the same I/O Rate point. |
| |This means that one should either explicitly define an event counter other than 1 |
| |for each copy of the interface or one should not associate any I/O Rate points with |
| |event counter 1. Configuration of I/O Rate points is discussed in the section called|
| |“I/O Rate Tag Configuration.” |
|/sio |The /sio flag stands for “suppress initial outputs.” The flag applies only for |
|Optional |interfaces that support outputs. If the /sio flag is not specified, the interface |
| |will behave in the following manner. |
| |When the interface is started, the interface determines the current Snapshot value |
| |of each output tag. Next, the interface writes this value to each output tag. In |
| |addition, whenever an individual output tag is edited while the interface is |
| |running, the interface will write the current Snapshot value to the edited output |
| |tag. |
| |This behavior is suppressed if the /sio flag is specified on the command line. That |
| |is, outputs will not be written when the interface starts or when an output tag is |
| |edited. In other words, when the /sio flag is specified, outputs will only be |
| |written when they are explicitly triggered. |
|/q |When the /q flag is present, Snapshots and exceptions are queued before they are |
|Optional |sent to the PI Server node. |
|/cihost= |This argument specifies the remote Citect machine name. An IP address may also be |
|Citect_hostname |used instead of a host name. If the interface is to run on the same computer as |
|Citect Host Name |Citect, then this argument should not be used. |
|Optional |Note: Remote Citect connections are available for use only with version 2.1.x and |
| |greater of the interface connecting to Citect version 5.20, service pack B or |
| |greater. |
| |Note: This argument MUST be used in conjunction with the /ciuser and /cipass |
| |command-line arguments. |
|/ciuser= |This argument specifies the user name within the remote Citect machine. It is used |
|Citect_username |in conjunction with the /cihost and /cipass arguments. If /cihost is specified and |
|Citect User Name |/ciuser is not, the interface will fail to initialize. |
|Optional | |
|Required if /cihost used. | |
|/cipass= |This argument specifies the password for the user name within the remote Citect |
|Citect_password |machine as specified by the /ciuser argument. It is used in conjunction with the |
|Citect User Password |/cihost argument. If /cihost is specified and /cipass is not, the interface will |
|Optional |fail to initialize. |
|Required if /cihost used | |
|/imode=x |When running redundant interfaces, this flag specifies whether this instance will be|
|Optional |the primary (p) or the secondary (s). |
|/ihost=host:port |When running redundant interfaces, this argument gives the host name and port number|
|Optional |that should be used to establish the communications between the two instances of the|
| |interface. If both interfaces are running on the same machine, then use the host |
| |name “localhost”. The port number can be any unused port on the system. |
| |e.g. /ihost=localhost:6789 |
|/itag=x |This argument specifies the name of a PI digital tag that will be used to store the |
|Optional |status of the interface. The digital tag should have a digital state set as defined |
| |in the “Interface Status Tag” section on page 19. There should be a tag for each |
| |copy of the interface running. |
|/db=n |This refers to the debug messages output by the standard OSI universal interface |
|UniInt Debug Level |(UniInt) template that the interface is based on. Various levels can be specified |
| |which display different types of messages. They are as follows: |
| |/db or /db=1 all messages |
| |/db=2 initialization |
| |/db=3 tag building and updates |
| |/db=8 exit handling |
|/df=xxxx |This argument defines flags that cause further information to be reported. These |
|Interface Debug Flags |flags are normally only used during installation or when a problem with the |
|Optional |interface occurs. Using them under normal operation of the interface will cause it |
| |to slow down. Because this information is also sent to the interface log file |
| |Pipc.log, it may quickly grow very large. |
| |Each flag determines what kind of information messages to report during operation of|
| |the interface. Each kind of message is specified by a letter of the alphabet (not |
| |case sensitive). They are listed below: |
| |A (A)ll Debug Messages. The same effect as specifying all of the debug flags for |
| |/df=. If this flag is used, all others are effectively redundant. |
| |V (V)erbose Messages. As for All debug messages, but also includes messages relating|
| |to the usage of the Citect API calls. Due to the large amounts of data output, care|
| |should be taken when using this option. |
| |L (L)ist Creation Messages. Every tag is added to a list in the CTAPI for retrieval |
| |from Citect. A message is reported every time one of these lists is created. |
| |T (T)ag Creation. A message is reported every time a tag is added to a CTAPI |
| |internal point list. The message indicates which list the point was added to. |
| |I (I)nput Tag Data. A message is reported that displays the value and status of the |
| |first five tags in each scan class and event class. |
| |O (O)utput Tag Data. A message is reported that displays the value and status of the|
| |first five tags in each output class. |
| |X Log ctListRead() calls. A message is reported that displays the value and status |
| |of the first five tags in each output class. |
| |Y Log ctListData() calls. A message is reported that displays the value and status |
| |of the first five tags in each output class. |
| |For debug flags I and O, each line of data takes the following format: |
| |() data = , |
| |These flags may be present in any order and may be repeated or omitted. For example,|
| |/df=OTLT |
| |will cause the interface to report list creation, tag creation and output data |
| |information messages. |
|/nopiwrite |This argument prevents the interface from sending its data to PI. It is used for |
|No PI Write |testing the throughput of Citect and the interface, generating as little interaction|
|Optional |with PI as possible. If the appropriate event counters are configured, the interface|
| |will still count the number of Citect reads and writes and send their averages to |
| |the event counter tags in PI. It will not count the number of exceptions. |
|/onlockup=xx |The interface is able to detect when the Citect API has failed to return. When this|
|Optional |lockup occurs, the interface can abort, ignore the problem, or restart. The default|
| |is /onlockup=abort. If the interface is running under Windows2000 as a service, the |
| |service can be configured to automatically restart on a failure. |
| |If /onlockup=restart is used, the interface will start an external utility and |
| |abort. The utility will wait for the service to stop and then restart it. (This is |
| |only required with NT) |
|/servicename=xx |This argument specifies the name of the service that the restart utility will |
|Optional |attempt to start if the interface detects a lockup and the /onlockup=restart. The |
| |default is to use the name of the interface executable filename as the service name.|
| |If multiple instances of the service are configured to use the same executable file,|
| |then the service names will need to be defined explicitly. |
|/restartutil=xx |This argument specifies the name of the external utility to be started if the |
|Optional |interface detects a lockup and the /onlockup=restart. The default utility name is |
| |StartService. The utility must be in the same directory as the interface |
| |executable. |
|/wto=xx |This argument specifies the watchdog timeout period, in seconds. If the watchdog |
|Optional |timer is not updated by the interface within this time period, then the interface |
| |will carry out the action defined by the /onlockup=xx argument (ignore, abort or |
| |restart) The default value is 60 seconds. |
Sample PI_Citect.bat File
The following is an example startup command-line:
REM PI_Citect.bat
REM
REM This is an example startup file for the PI Citect interface.
REM
REM --------------------------------------------------------------
REM
REM Required command-line parameters
REM
REM /f=HH:MM:SS Scan class
REM /ps=x Point source
REM
REM Optional command-line parameters
REM
REM /cihost=x Citect host name
REM /ciuser=x Citect user name
REM /cipass=x Citect password
REM /imode=x Specifies whether node is
REM (P)rimiary or (S)econdary.
REM /ihost=host:port Failover host and port number
REM (up to 3 can be specified)
REM /itag=digitaltag Digital type tag to store
REM status of interface
REM /df=xxxx Interface-specific debug flags
REM /nopiwrite Don't write data to PI
REM /onlockup=x Action taken when the interface locks up
REM /restartutil=x Name of utility to restart service
REM /servicename=x Name of service to be restarted
REM /wto=x Wathdog timeout period
REM (default 60 seconds)
REM
REM /id=n Interface identifier
REM /host=host:port Specify PI home node other than default
REM /stopstat=digstate State to write when interface exits
REM /ec=x Event counter of I/O rate tag
REM /sio Suppress initial output
REM /q Queue data before sending it to PI
REM /sn Bypass exception reporting
REM
REM --------------------------------------------------------------
REM --------------------------------------------------------------
REM
REM Revision History
REM Date Author Comment
REM 06-Apr-01 CG> Written
REM 09-Mar-05 KM> Added new arguments
REM 11-Mar-05 MPK> Added missing failover parameters
REM --------------------------------------------------------------
REM SAMPLE Command Line
REM
PI_Citect.exe /ps=A /id=1 /host=ourpi3svr:5450 ^
/cihost=ci-node1 /ciuser=piuser /cipass=trustn01 ^
/f=00:00:10 /f=00:01:00 /f=00:30:00 ^
/ec=22 /q /stopstat
Interface Failover Configuration
The interface failover functionality allows two instances of the interface to be run, either on the same machine or on different machines. The two instances of the interface communicate with each other and exchange status information.
One instance of the interface is defined as the primary, the other as the secondary. The primary interface will normally collect the data from the Citect system, and the secondary will monitor the primary. If the primary interface loses its connection to the Citect system, or the secondary interface is unable to communicate with the primary (i.e. the primary has stopped), then the secondary interface will start to collect the Citect data.
The command-line arguments listed below are used to define the interface failover
/imode=x
where x is P for the primary interface and S for the secondary
/ihost=hostname:port
defines the TCP/IP ports to be used by the interface for communicating with the other instance of the interface. The primary interface will listen on the specified port for connections (and therefore should be local), and the secondary will attempt to connect to that port.
/itag=tagname
The tagname specifies the name of a PI tag that will be used to store the status of this instance of the interface. Each instance must have a separate status tag. The status tags must be digitals, and contain the digital state set as defined in the “Interface Status Tag” section on page 19.
Note:
There is a limitation with the failover functionality. If the communication link between the two instances of the interfaces is lost, it is possible for the primary AND secondary interfaces to both collect data. This can cause duplicate events to be sent to the PI server.
Use redundant connections between the interfaces to reduce the possibility of this occurring. If the machines running the interfaces have multiple network cards, more than one /ihost argument can be defined so that there are multiple independent connections between the two interfaces.
Examples
1) The primary interface is to run on "CitectA", and the secondary on "CitectB". Both machines are also running the Citect software. Each machine has a secondary network card, with the TCP/IP host names "CitectA_2" and "CitectB_2".
Primary
PI_Citect /ps=A /f=00:00:10 /imode=P /ihost= CitectA:5451 ^
/ihost=CitectA_2:5452 /itag=Citect_Primary
Secondary
PI_Citect /ps=A /f=00:00:10 /imode=S /ihost= CitectA:5451 ^
/ihost=CitectA_2:5452 /itag=Citect_Secondary
Because Citect is running locally, the /cihost, /ciuser and /cipass arguments are not required. Also note that there are two /ihost arguments listed for each interface, one for each network connection.
2) Both instances of the interface are running on a PI Interface node called "PIAPI". The instances are named PI_Citect1 and PI Citect2. Citect is running on redundant machines "CitectA" (master) and "CitectB" (standby).
Primary
PI_Citect1 /ps=A /f=00:00:10 /cihost=CitectA ^
/ciuser=piuser /cipass=passwd ^
/imode=P /ihost=localhost:5451 /itag=Citect_Primary
Secondary
PI_Citect2 /ps=A /f=00:00:10 /cihost=CitectA ^
/ciuser=piuser /cipass=passwd ^
/imode=S /ihost=localhost:5451 /itag=Citect_Secondary
Interface Watchdog Configuration and “StartService”
The interface includes a watchdog timer which is used to detect when there is a problem with the Citect API not responding. The watchdog timer is controlled with the command line arguments /onlockup, /servicename, /restartutil, and /wto.
The older versions of the Citect API had timing issues that meant that it was possible for the interface to attempt to read a list of points but the Citect function would never return control to the interface, and the interface would lockup.
The timeout period for the watchdog timer is 60 seconds by default. If the Citect system is very slow to respond, but has not locked up, it is possible to change the period using the /wto= argument.
By default, if the interface detects a lockup of the Citect API, it will abort itself. Under Windows 2000 or later, the interface service can be configured so that if it aborts, the service will be automatically restarted by the OS. To enable this option, open the services applet (Start -> Settings -> Control Panel -> Administrative Tools -> Services), find the interface service you wish to restart and right click on it, choose Properties from the menu, choose the Recovery tab, on the first, second and subsequent failures dropdown boxes, choose “Restart the Service”.
Unfortunately, this restart functionality is not available under Windows NT. There are third-party programs available that can monitor the status of a service, and restart the service if it aborts.
The interface also has an option where it will use another utility to restart itself. If the command-line argument /onlockup=restart is set, then the interface will execute a program as a separate process and then abort itself. By default, this program that is started is called StartService.exe. This program is included in the interface installation kit. This program will wait for the interface service to abort itself, and when the service has stopped, it will attempt to restart the service. It is possible to use different programs to restart the service, by specifying the name of the program with the /restartutil= argument. The interface will start the program and pass the service name as an argument. By default the service name is the executable file base name. If the service is not using the executable name as the service name (e.g. multiple instances of the interface on one machine), then the actual service name can be specified with the /servicename= argument.
Interface Node Clock
The correct settings for the time and time zone should be set in the Date/Time control panel. If local time participates in Daylight Savings, from the control panel, configure the time to be automatically adjusted for Daylight Savings Time. The correct local settings should be used even if the interface node runs in a different time zone than the PI Server node.
Make sure that the TZ environment variable is not defined. The currently defined environment variables can be listed by going to Start | Settings | Control Panel, double clicking on the system icon, and selecting the environment tab on the resulting dialog box. Also, make sure that the TZ variable is not defined in an autoexec.bat file. When the TZ variable is defined in an autoexec.bat file, the TZ variable may not appear as being defined in the System control panel even though the variable is defined. Admittedly, autoexec.bat files are not typically used on NT, but this does not prevent a rogue user from creating such a file and defining the TZ variable unbeknownst to the System Administrator.
Security
If the home node is a PI 3 Server, the PI Firewall Database and the PI Proxy Database must be configured so that the interface is allowed to write data to the PI Data Archive. See “Modifying the Firewall Database” and “Modifying the Proxy Database” in the PI Server manuals.
Note that the Trust Database, which is maintained by the Base Subsystem, replaces the Proxy Database used prior to PI version 3.3. The Trust Database maintains all the functionality of the proxy mechanism while being more secure.
See “Trust Login Security” in the chapter “PI System Management” of the PI Universal Data Server System Management Guide.
If the home node is a PI 2 Server, the read/write permissions should be set appropriately in the pisysdat:piserver.dat file on the PI 2 home node. For more information on setting permissions on PI 2, see the pibuild:piserver.txt file on the PI 2 home node.
If the interface cannot write data to a PI 3 Server because it has insufficient privileges, a –10401 error will be reported in the pipc.log file. If the interface cannot send data to a PI2 Serve, it writes a –999 error. See the section “Appendix A: Error and Informational Messages” for additional information on error messaging.
.
Starting / Stopping the Interface
This section describes starting and stopping the interface once it has been installed as a service. See the UniInt End User Document to run the interface interactively.
Starting Interface as a Service
If the interface was installed a service, it can be started from the services control panel or with the command:
PI_Citect.exe –start
A message will be echoed to the screen informing the user whether or not the interface has been successfully started as a service. Even if the message indicates that the service started successfully, make sure that the service is still running by checking in the services control panel. There are several reasons that a service may immediately terminate after startup. One is that the service may not be able to find the command-line arguments in the associated .bat file. For this to succeed, the root name of the .bat file and the .exe 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. The user must consult the pipc.log file for error messages. See the section “Error and Informational Messages” for additional information.
Stopping Interface Running as a Service
If the interface was installed a service, it can be stopped at any time from the services control panel or with the command:
PI_Citect.exe –stop
The service can be removed by:
PI_Citect.exe –remove
Buffering
For complete information on buffering, please refer to the PI API Installation Instruction.
PI Interface Node buffering consists of a buffering process which runs continuously on the local node, a PI API library whose calls can send data to this buffering process, and a utility program for examining the state of buffering and controlling the buffering process.
Note: Change the Local Security Policy on Windows XP.
1. Open "Administrative Tools" from the control panel.
2. Open "Local Security Policy" from administrative tools.
3. Browse to "Security Options" under "Local Policies."
4. Double click on "System Objects: Default owner for objects created by members of the Administrators group."
5. Change the dropdown from "Object Creator" to "Administrators group."
The behavior of Bufserv should now be the same on XP as it was for NT4 and 2000.
Configuring Buffering with PI ICU (Windows)
Buffering is enabled through the PI Interface Configuration Utility’s Tools>API Buffering… menu. Unless buffering is explicitly enabled, the PI API will not buffer data, sending data directly to the home node.
The API Buffering… dialog allows the user to view and configure the parameters associated with the API Buffering (bufserv) process. The user can start and stop the API Buffering process from the Service tab:
[pic]
Service Tab
The Service tab allows for some API Buffering service configuration. For further configuration changes, use the Services applet.
Service Name
The Service name displays the name of the API Buffering Service.
Display Name
The Display name displays the full name associated with the API Buffering service.
Log On As
Log on as indicates the Windows user account under which the API Buffering service is setup to start automatically on reboot, or manually.
Password
Password is the name of the password for the Windows user account entered in the Log on as:above.
Confirm password
You must reenter the password again to verify you have typed it correctly both times.
Dependencies
The Dependencies lists the Windows services on which the API Buffering service is dependent.
Dependent Services
The Dependent services area lists the Windows services that depend on bufserv to function correctly.
Start / Stop Service
The Start / Stop buttons allow for the API Buffering service to be started and stopped. If the service is not created this box will show Not Installed.
After a change is made to any of the settings on the Settings tab, the OK button must be clicked to save these settings, and then the service must be stopped and restarted for the changes to be picked up by bufserv.
Service Startup Type
The Startup Type indicates whether the API Buffering service is setup 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 API Buffering service is set to start automatically.
Create/Remove Service
The Create / Remove buttons allow for the creation or removal of the API Buffering service. Clicking the Create button will cause the service to be created using the Log on as and passwords given. Once the service is created the Start / Stop buttons will be activated.
Settings Tab
The Settings tab allows for configuration of the 7 configurable settings used by API Buffering. Default values are used if no other value is provided.
[pic]
Enable Buffering
Enables the 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 home node. 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 the home node 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 which is calculated like this:
max = MAXTRANSFEROBJS / SENDRATE * 1000
Default value is 5000. This value is automatically calculated for the user and can not be changed.
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
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, sending data directly to the home node.
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.
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 to PI.
Configuration of buffering is achieved through entries in the piclient.ini file. The file is found in the dat subdirectory of the PIHOME directory (typically c:\pipc\dat) under Windows NT. This file follows the conventions of Microsoft Windows initialization files with sections, keywords within sections, and values for keywords. All buffering settings are entered in a section called [APIBUFFER]. To modify settings, simply edit the piclient.ini file in a text editor (Notepad on Windows) to the desired values.
The following settings are available for 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 home node (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 |Windows default 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
On Windows the default server information is stored in the pilogin.ini file so the piclient.ini would only have the [APIBUFFER] section. 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 meaning wait 10 minutes after losing a connection before retrying.
On Windows 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
Appendix A: Error and Informational Messages
A string NameID is pre-pended to error messages written to the message log. Name is a non-configurable identifier that is no longer than 9 characters. ID is a configurable identifier that is no longer than 9 characters and is specified using the /id flag on the startup command line.
Message Logs
The location of the message log depends upon the platform on which the interface is running. See the UniInt End User Document for more information.
Messages are written to PIHOME\dat\pipc.log 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 UniInt, the command-line parameters used, and the number of points.
• As the interface retrieves points, messages are sent to the log if there are any problems with the configuration of the points.
• If the /db or /df is used on the command line, then various informational messages are written to the log file.
Interface Messages
Fatal Errors
• No value specified after /id=
Interface expects value following /id= command line parameter.
• Invalid value for /id= parameter (1-99)
The value of the interface identifier has a valid range of 1 to 99.
• Citect username not specified for host xxxxx
A remote Citect node has been specified with the /cihost parameter but no corresponding /ciuser parameter was found.
• Citect password not specified for host xxxxx
A remote Citect node has been specified with the /cihost parameter but no corresponding /cipass parameter was found.
Serious Errors
• dev_service_input_list() ERROR : Citect list handle == NULL
Attempt to read from invalid Citect list. Indicates corrupted memory. Please contact OSI Tech Support.
• dev_service_output_list() ERROR : Citect output list handle == NULL
Attempt to read from invalid Citect list. Indicates corrupted memory. Please contact OSI Tech Support.
• ctListRead() returned error : xxxxx
Error reading from Citect point list. Citect error message should be appended to this message.
• PI Tag xxxxx (CiTag yyyyy) has invalid Citect handle
Attempt to read from invalid Citect point. Indicates corrupted memory. Please contact OSI Tech Support.
• PI Tag xxxxx (CiTag yyyyy) ERROR : xxxxx
Error reading from Citect point list. Citect error message should be appended to this message.
Point Errors
• PI Tag[] location2 value out of range : point refused
PI point attribute location2 value is out of range.
• PI Tag xxxxx (CiTag yyyyy) Error : Invalid data type to write to Citect
Mismatch in data type when writing value to Citect point
• Unable to create [ scan list xx |output list | event list ] : xxxxxx
Error creating Citect tag list. Citect error message should be appended to this message.
• Error : PI tag xxxxx (1234) (CiTag yyyyy) to scan list xx > xxxxxx
Error adding Citect tag to Citect tag list. Citect error message should be appended to this message. Normally caused where the Citect tag listed in InstrumentTag attribute of the PI point is incorrect (Citect tag not found).
Warnings
• Invalid character in /id= parameter - tags will not be filtered using /id
If the /id parameter is not a value between 1 and 99 then the tags will not be filtered by interface identifier. The /id parameter will be used in the log files.
• Cannot find 'xxxxx' state - 'Bad Input' will be used instead
The digital state specified by the /stopstat parameter was not found in the system digital state set.
• Cannot connect to remote Citect host: xxxxx
Unable to connect to the specified Citect host node. The interface will attempt to connect periodically.
• Cannot connect to local Citect host
Unable to connect to the local Citect host node. The interface will attempt to connect periodically.
• Connection lost - xxxxx
The connection to the Citect node was lost. The interface will attempt to reconnect periodically.
• Could not remove temporary recovery file xxxxx
When the interface is shutdown, it will attempt to recover the crash recovery file. If the file can not be removed it could be caused by permissions or a sharing violation.
System Errors and PI Errors
System errors are associated with positive error numbers. Errors related to PI are associated with negative error numbers.
Error Descriptions on Windows and Unix
On Windows, descriptions of system and PI errors can be obtained with the pidiag utility:
\PI\adm\pidiag –e error_number
Revision History
|Date |Author |Comments |
|6-Nov-98 |RGM |Redesign: Version 1.x.x uses the functionality of the Citect v5.00 API. Version |
| | |2.x.x has been built using the functionality of Citect v5.10 API. Enhancement: |
| | |Version 2 now supports event tags and output tags |
|19-Nov-98 |RGM |Enhancement: Writes the server timestamp to a file every minute. Deletes the file|
| | |upon exiting. If the interface does not exit normally, this file will not be |
| | |deleted. If /stopstat is specified in the startup file, the interface will check |
| | |for this file when it starts up. If it exists, it will write the state specified |
| | |by /stopstat to all its points. This prevents data from being interpolated after |
| | |a restart of the interface when it exits abnormally. Bug fix: Cleans up properly |
| | |when a tag is removed from the interface. |
|25-Nov-98 |RGM |Bug Fix: Now supplies username and password to CTAPI connect routine. Accepts |
| | |them as command line arguments. Improvement: error messages now report more |
| | |consistently and Citect based error messages are retrieved from Citect. |
|11-Dec-98 |RGM |Bug Fix: The character array for holding the Citect version number was too short.|
| | |Lengthened from 16 to 80. |
| | |Improvement: If a tag fails to register with Citect, the Citect tag name |
| | |(InstrumentTag) is reported instead of the PI tag name. |
|11-Dec-98 |RGM |Functionality Addition: Can now connect to a remote Citect host if the remote |
| | |Citect host is version 5.20 service pack B or later. Use /CiHost=IP_Address |
| | |/CiUser=Username |
| | |/CiPass=Password |
|9-Mar-99 |RGM |Functionality Addition: Can now connect to a remote Citect host if the remote |
| | |Citect host is version 5.20 service pack B or later. Use /CiHost=IP_Address |
| | |/CiUser=Username /CiPass=Password |
|15-Sep-00 |RGM |Changed the “I” part of /df= so that the input values reported were all reported |
| | |to the log in groups of 8 instead of just the first 8. |
| | |Fixed a bug where the wrong message was reported in debug mode for /df=I |
| | |Added version resource so version tab appears in the file properties dialog. |
| | |Changed the code to read this version info when logging to pipc.log |
|2-Mar-01 |AKF |Updated formatting to Skeleton 1.04 |
|19-Mar-01 |KJM |Update info for PI Citect version 2.3.x |
|5-Apr-01 |KJM |Updated for PI Citect version 2.4.x Added interface failover arguments. |
|16-Jan-02 |KMillar |Updated for PI Citect version 2.5.x |
| | |String support. Added new section on failover configuration. |
|26-Mar-03 |KMillar |Added ICU documentation and 2.5.7 support for lockup detection (abort and |
| | |restart) |
|08-Sep-03 |KMillar |Added comments about Citect API licenses. |
|30-Sep-03 |KMillar |Added /wto=x argument description |
|26-Jan-04 |Chrys |2.6.0.3 Rev A: Reformatted; fixed headers & footers; removed redundant |
| | |information; reordered to put in standard format; clarified that location2 not |
| | |location1 corresponds to the .id; enhanced PI ICU information; added part number;|
| | |added platforms |
|9-Mar-05 |KMillar |Added description of lockup detection and the StartService utility. |
|11-Mar-05 |MKelly |Fixed headers and footers. Modified the section on ICU control. Updated manual |
| | |to latest interface skeleton 1.15. |
|21-Mar-05 |MKelly |Removed Random and replaced with PI Citect in Point Source description. Fixed |
| | |headers and footer, TOC. |
|21-Apr-05 |Chrys |Changed some heading formats |
|31-Oct-06 |MKelly |Version 2.6.1.7 Rev C; Updated manual name to remove reference to Citect version,|
| | |added Windows Server 2003 as a supported platform, fixed headers and footers. |
| | | |
| | | |
| | | |
| | | |
| | | |
-----------------------
Status of the ICU
Status of the Interface Service
Service installed or uninstalled
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- why the school system is bad
- is the education system broken
- the school system is broken
- the education system is failing
- why the education system is good
- changing the school system essay
- the college system is broken
- calculator with the pi button
- how to cleanse the lymphatic system naturally
- the planets of the solar system song
- the organs in the circulatory system include
- label the conduction system of the heart