Batch File - NT and UNIX



Batch File - NT and UNIXBatch File - NT

Interface to the PI System

version 1.4

How to Contact Us

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

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

|Fax |(510) 357-8136 |

|Internet |techsupport@ |

|World Wide Web | |

|Bulletin Board |(510) 895-9423 |

| |Telebit WorldBlazer modem (Hayes, MNP, or PEP compatible) |

| |8 data bits, 1 stop bit, no parity, up to 14400 bps download |

| |protocols: Xmodem, Ymodem, Zmodem, Kermit |

|Mail |OSI Software, Inc. | |

| |P.O. Box 727 | |

| |San Leandro, CA 94577-0427 | |

| |USA | |

| | | |

| |OSI Software GmbH |OSI Software, Ltd |

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

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

| |Deutschland |Auckland 3, New Zealand |

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

RESTRICTED RIGHTSRESTRICTED RIGHTS LEGEND

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

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

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

BatchntBATCHNT.DOCBatchnt.doc

( 1997 OSI Software, Inc. All rights reserved

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

Table of Contents

Overview 1

Point Configuration 2

Data Files 3

Startup 4

Running as an NT Service 7

Running on NT PI-API Node 7

Shutdown 8

Troubleshooting 9

Installation 10

Overview 1

Point Configuration 2

Data Files 3

Startup 4

Running as an NT Service 7

Running on NT PI-API Node 7

Shutdown 8

Troubleshooting 9

Installation 10

Overview 1

Point Configuration 2

Data Files 3

Startup 4

Running as an NT Service 7

Running on a NT PI-API Node 7

Shutdown 8

Troubleshooting 9

Installation 10

Overview

The Batchfl Interface:

• Processes data from files to a Plant Information (PI) System.

• Is designed in conformance with the PI Instrument and Computer Interfacing Standard.

• Requires the PI-API and

• Runs on all platforms on which the PI-API is available; this includes the PI Data Archive platforms, including OpenVMS, NT, and UNIX, PINet nodes, and PI clients.

This document applies to the NT and UNIX version.

|Supported Features |

|Signup for Updates |N/A |

|Exception Reporting |N/A |

|PI-API Support |Yes |

|Outputs |No |

|Vendor Software Required |No |

|Failover |No |

|Maximum Point Count |Unlimited |

|Uses Language Resources |N/A |

Point Configuration

When configuring a Batchfl Interface point, the point source may be used.

Point Source

The point source for the Batchfl interface is typically L. The point source is specified as a Batchfl interface startup command line parameter. This is an optional parameter. If you leave it out, no point source checking will be done.

Data Files

The interface searches for data files to process and purges processed files. The Batchfl Data records consist of PI Tagname, timestamp, and value. The parser character between the fields is typically a comma ‘,’. This can be changed by passing a different character in the startup parametersPassing a different character in the startup parameters can change this. The PI Tag name can be a long or short name; the maximum is 80 characters. The time stamp is in the form: dd-mmm-yyyy hh:mm:ss. The value field can be a numeric or digital state.

The following is an example of a data file:

au1311.01,29-May-1996 07:00:00,234.3

au1321.01,29-May-1996 08:00:00,2.3

au1331.01,29-May-1996 08:30:00,34.3

au1301.01,29-May-1996 07:30:00,BAD DATA

au1302.01,29-May-1996 07:00:50,ON

au1303.01,29-May-1996 07:00:00,OFF

au1304.01,29-May-1996 17:00:00,RUNNING

Startup

On the NT and UNIX platforms, the Batchfl interface is started automatically by the PI Data Archive startup procedure. Program activation and command line parameters are the same for both NT and UNIX in the batchfl.bat and batchfl.sh respectively

The following is an NT example:

REM batchfl.bat

REM

REM this command procedure passes required -default parameters to

REM process batchfl.

REM

REM

REM command line arguments:

REM /f= required - frequency in seconds to check for new data files

REM /pa= required - path and mask to data files

REM /pu= required - relative purge time to delete processed data files (-Xh,-Xd,-Xm)

REM /ps= optional - point source character. Default is none.

REM /host= optional - name of PI home node. Default is localhost:5450

REM /fs= optional - character to separate fields in data line. default is comma

REM /db optional - turns on additional debug messages

REM

REM run string needs a space between arguments, no spaces within

REM argument.

REM

..\interfaces\batchfl\batchfl noservice /f=60 /pa=c:\batchfl\*.dat /pu=-1d

REM

REM end of batchfl.bat

The following is a UNIX example:

#

# @(#)batchfl.sh 1.0 07/29/96

#

#

# this command procedure passes required -default parameters to

# process batchfl.

#

#

# command line arguments:

# /f= required - frequency in seconds to check for new data files

# /pa= required - path and mask to data files

# /pu= required - relative purge time to delete processed data

# files (-Xh,-Xd,=Xm)

# /ps= optional - point source character. Default is none.

# /host= optional - name of PI home node. Default is localhost:5450

# /fs= optional - character to separate fields in data line.

# default is comma

# /db optional - turns on additional debug messages

#

# run string needs a space between arguments, no spaces within

# argument.

#

#

echo "Starting Batchfl Interface"

./batchfl /f=60 /pa=/usr/labdata/*.dat /pu=-1d \

/host=casaba > ../../log/batchfl.log 2>&1 &

#

#

In this example,

/ps=L

specifies the point source. This is an optional parameter. If no point source is passed, no point source checking is done. If a point source is passed, only points with this point source will be processed.

/f=60

specifies the cycle time for the checking for data files in seconds.

/pa=c:\labdata\*.dat

specifies the data file path and mask. Processed files will have 999 added to the file name. Do not make data files with 999 at the end of the name. They will be ignored and purged.

NOTE: for Unix, the data file mask only supports *.

/pu=-2d

specifies the age of processed data files to be deleted. In this example, processed data files older than 2 days are deleted.

/host=xxxxxx

specifies the PI home node where xxxxxx can be localhost:5450 if the interface is running on the PI3 server node. If the interface is sending data t a PI3 server, /host=name of pi3 server:5450. e.g.: /host=rasin:5450. If the interface is sending data to a PI2 server, /host=rasin:545. This is an optional parameter. If not specified, localhost:5450 is used.

/fs=|

specifies the field separator between tagname and timestamp, and timestamp and value. This is an optional parameter. If not specified a comma(‘,’) is used.

/db

specifies that debug messages be written to the log files.

In NT, there is an additional command line parameter, noservice, which indicates that the program should not be run as an NT service when not started from services. Services will be officially supported with the release of PI3.1.

Running as an NT Service

On an NT system running PI 3.1 it is recommended that the interface be run as a service.

• Edit the PI\adm\pisrvsitestart.bat file to add pisrvcfg batchfl -s & wait 5000.

• Edit PI\adm\ to add pisrvcfg batchfl -c -i $1 -d tcpip.

More information for running the interface as a service can be found in your PI Data Archive for NT and UNIX for version 3.1 document, PI Installation and Upgrade on Windows NT chapter in section Configuring NT Services.

Running on NT PI-API Node

With PI-API on NT, the interface should not be run as a service until PI-API buffering is supported as a service.

Shutdown

On the UNIX platform, the Batchfl interface is normally stopped automatically by the PI Data Archive shutdown procedure. It can also be stopped by killing the UNIX process. On the NT platform, the Batchfl interface is stopped by typing C in the appropriate Command Prompt window. On an NT system running as a service, edit the PI/adm/pisrvsitestop.bat file to add pisrvcfg batchfl -k This way the Batchfl interface will automatically be stopped whenever PI is stopped

Troubleshooting

The Batchfl interface records status and error messages go to pipc\dat\pipc.log file. If the pipc directory does not exist it goes to the temp directory of the root drive. e.g.: c:\temp\pipc.log.

If you are having problems with the Batchfl interface, this is the first place to look for indications of what the source of where the trouble lies.

Messages will be written to the pipc.log file at the following times:

• At Startup

• When invalid parameters are found in the command line

• When a file has not been processed for more than 24 hours

• When a file has been processed and the last file that has been processed was done more than 24 hours ago

• When a digital state is not found

• When a PI point is not found

• When a error occurs when adding data to PI

• When a point does not have the passed point source (if passed)

Installation

The Batchfl interface is installed separately from the installation of the PI Data Archive installation. Installations consists of the following steps:

1. Create the directory PI\interfaces\batchfl.

1. On NT systems, copy the executable (batchfl.exe) and its startup procedure (batchfl.bat or batchfl.sh) into the newly created directory. The interface requires the MSVCRT40.DLL. If this DLL is NOT in your Windows System directory (on most NT systems this will be the C:\WINNT\SYSTEM32), copy the MSVCRT40.DLL file provided to your Windows System directory.

2. On UNIX systems, go to the directory PI\interfaces\batchfl and issue the command:

$ tar -xv

3. The files batchfl and batchfl.sh will be copied to that directory.

2. Edit the startup procedure to configure the point source and scan class.

3. Edit the PI\adm\pisitestart.bat or PI/adm/pisitestart.sh file to add batchfl.bat or batchfl.sh. This way the Batchfl interface will automatically be started whenever PI is started.

4. On an NT system running PI 3.1 it is recommended that the interface be run as a service. Edit the PI\adm\pisrvsitestart.bat file to add pisrvcfg batchfl -s & wait 5000. More information for running the interface as a service can be found in your PI Data Archive for NT and UNIX for version 3.1 document, PI Installation and Upgrade on Windows NT chapter in section Configuring NT Services.

5. On a UNIX system, edit the PI/adm/pisitestop.sh file to kill the process. On an NT system running as a service, edit the PI/adm/pisrvsitestop.bat file to add pisrvcfg batchfl -k This way the Batchfl interface will automatically be stopped whenever PI is stopped

Revision History

|Date |Author |Comments |

|05-Jun-96 |MMG |Initial draft |

|23-July-96 |MMG |Revised for NT platform |

|12-Sep-96 |MMG |Revised for Unix platforms |

|23-Sep-96 |JFZ |Added tar -xv command for UNIX platforms |

|21-Nov-96 |MMG |Revised for running as a NT service |

|25-Jun-97 |SRG |Minor formatting changes. |

| | | |

| | | |

| | | |

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

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

Google Online Preview   Download