Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Interface for TCP Response

Command line parameters

  • Last UpdatedFeb 14, 2023
  • 6 minute read

Sample PITCPResp.bat File

The following table lists the interface-specific command line parameters used in the interface startup batch file to configure settings. These parameters are provided for debugging purposes to help you read the file. To ensure a correctly-formatted file, use the PI Interface Configuration Utility to configure the interface.

In addition to interface specific parameters, all UniInt interfaces support a common set of parameters. For details, refer to the PI Universal Interface (UniInt) User Guide.

Parameter

Description

-ec= #

Optional

The first instance of the -ec parameter on the command-line is used to specify a counter number, #, for an I/O Rate point. If # is not specified, then the default event counter is 1. Also, if the -ec parameter 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= # explicitly defined will write to the same I/O Rate point. This means either explicitly defining an event counter other than 1 for each copy of the interface or not associating any I/O Rate points with event counter 1.

-f=SS or

-f=SS,SS or

-f=HH:MM:SS or

-f=HH:MM:SS, hh:mm:ss

Required for reading scan-based inputs

The -f parameter defines the time period between scans in terms of hours (HH), minutes (MM), and seconds (SS). Scans can be scheduled at a given time with an optional time offset specified in terms of hours (hh), minutes (mm), and seconds (ss). If HH and MM are omitted, then the time period is presumed to be in seconds. Each instance of the -f parameter on the command-line defines a scan class for the interface. There is no limit to the number of scan classes. The first occurrence of the -f parameter on the command-line defines the first scan class of the interface; the second occurrence defines the second scan class, and so on.

PI Points are associated with a particular scan class using 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 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.

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.

Sub-second Scan Classes Sub-second scan classes can be defined on the command-line, such as -f=0.5 -f=00:00:00.1 where the scanning frequency associated with the first scan class is 0.5 seconds and the scanning frequency associated with the second scan class is 0.1 of a second. Similarly, sub-second scan classes with sub-second offsets can be defined, such as -f=0.5,0.2 -f=1,0.

Wall Clock Scheduling Scan classes that strictly adhere to wall clock scheduling are now possible for interfaces that run on Windows and/or UNIX. Previously, to schedule a scan once a day at 8 AM (even across daylight saving time), 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.

Caution: If you set scan frequencies for less than two minutes and define many points, the multiple and frequent connection requests sent by the interface may overwhelm the network and/or the servers whose response times are being measured.

-denc

Optional

If you have changed the Run as account, use this command line parameter to enable the interface to remove the old Run as account information from Windows Credential Manager before establishing the new Run as account and restarting the interface.

Caution: Read the Note in the Install Interface as Windows service topic to understand the proper procedure for changing the Run as account

-enc

Optional

Tells the interface to use Windows Credential Manager for storage of host configuration, and to delete the password file (pitcpresp#.password) after updating Windows Credential manager.

Note: # in the password file name is the interface service ID.

-host=host:port

Required

The -host parameter is used to specify the Data Archive. Host is the IP address of the PI Server node or the name of the Data Archive node. Port is the port number for TCP/IP communication. This number is always 5450. Examples: The interface is running on a PI Interface Node, the name of the PI Server node is Marvin, and the IP address of Marvin is 192.168.8.30. Valid -host parameters are:

-host=marvin

-host=marvin:5450

-host=192.168.8.30

-host=192.168.8.30:5450

-id=x

Required

The -id parameter specifies the interface identification number. Each instance of PI TCPResponse uses the -ps and -id parameters to identify uniquely its particular list of points to service. In addition, the interface uses the value of this parameter in the messages that it writes to the log file. For example, if the user specifies -id=8 , then the message log file will have contents such as: 12-Dec-02 14:44:58 PI TCPResponse 8> 125 points found for point source P.

-ps=ptSrc

Required

The -ps parameter specifies the point source for the interface. ptSrc can be a single or multiple characters, and is not case sensitive. For example, -ps=P and -ps=p are equivalent. The point source that is assigned with the -ps parameter corresponds to the PointSource attribute of individual PI points. The interface will attempt to load only those PI points with the appropriate point source.

-q

Optional

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

-stopstat or

-stopstat= digstate

Recommended: -stopstat= "Intf Shut"

Optional

The -stopstat parameter causes the interface to write the specified digital state to its list of points before it exits. The recommended digital state is Intf Shut. Because there is a space in this digital state value, the user needs to use quotation marks. For example, PITCPResp.exe -ps=P -stopstat="Intf Shut".

If the user specifies a digital state that does not exist in the PI Server, the interface does not write any digital state values before it exits.

-wt=#

Optional

The -wt parameter specifies (in milliseconds) the amount of time the interface should wait for a response. If the user does not specify this parameter, the interface waits 5000 milliseconds. The lower limit for this value is 100. A point's non-zero Location3 attribute overrides this parameter.

The following is an example of the contents of a startup command file for the TCPResponse interface:

REM=======================================================================
REM
REM
PITCPResp.bat
REM
REM Sample startup file for the TCP Response interface to the PI System
REM
REM=======================================================================
REM
REM OSIsoft strongly recommends using PI ICU to modify startup files.
REM
REM Sample command line
REM
.\PITCPResp.exe -ps=P -id=1 -f=300 -host=XXXXXX:5450 -stopstat="Intf Shut"
REM
REM End of PITCPResp.bat File

The installation program installs a sample command file named PITCPResp.bat_new. The user may use this file as a template to configure the PITCPResp.bat file.

TitleResults for “How to create a CRG?”Also Available in