Interface to the pi system Version 37 and Greater



Download 344.12 Kb.
Page10/10
Date13.05.2017
Size344.12 Kb.
#17841
1   2   3   4   5   6   7   8   9   10

Permanent Installation


Four additional steps are required to ensure this interface is started and stopped with the PI system automatically.

  1. Insert a new Setterm command after each stop command that refers to an interface using TTY serial communication.

@PiSysExe:Ygi_Setterm xxxx

where xxxx is the terminal name for that interface.



  1. Add a new line for each process required, supplying the point source as a parameter.

@PiSysExe:Ygw_Detach #

where # is the point source of the interface to start.



  1. Edit PiSysMgr:SiteStop.com by inserting a new stop command line for each process

@PiSysExe:Stop YGW_INT_#

where # is the point source of the interface to start.



  1. Insert a new Unsetterm command for after each stop command that refers to an interface using TTY serial communication.

@PiSysExe:Ygi_UnSetterm xxxx

where xxxx is the terminal name for that interface.


Windows NT Installation


The interface may be run from either interactively from the DOS prompt or as an NT service. Either of these methods can be started automatically when PI is started if they are on the PIHome node.

Basic Installation


  1. Create a subdirectory within the PI Interfaces directory called ygw_# where # is the point source for the interface. If running on the PI home node, this Interfaces directory should be in \Pi or wherever PI was installed. If running on a PI API node create an Interfaces and an Adm subdirectory within the \Pipc directory or wherever the PI API was installed.

  2. Copy the interface files into this directory. They are the following:

Ygw_#.bat

YGW_OItem_#.txt

Ygi_Test.exe

Ygw_#.exe

YGW_Msg_#.txt

Ygi_Testb.exe

where # is the point source for the interface.

  1. Modify a copy of startup file for each interface (Ygw_#.bat). Ensure that this file runs the interface with the correct point source.

  2. Run the interface by executing the startup file Ygw_#.bat where # is the point source.


Permanent Installation


  1. If the interface is running on the PI Home node, edit the following files in the \PI\Adm directory or wherever PI was installed.

PiSiteStart.bat
Place the following lines at the bottom of this file:

Echo Starting Yokogawa Gateway Interface

Start “Yokogawa Gateway Interface” /min ..\interfaces\ygw_#\ygw_#.bat

PiSrvSiteStart.bat
Add the following to the last line:

..\interfaces\ygw\ygw_#.exe -start

PiSrvSiteStop.bat
Insert the following before the line at the bottom of the file which contains “:theend”:

..\interfaces\ygw\ygw_#.exe -stop

  1. Run the PiServiceInstall.bat file from a MS-DOS prompt to install the interface as a service:

PiServiceInstall -auto

The “-auto” option will instruct NT to start the interface service automatically on power-on.



  1. Place a copy of YGW_OItem_#.txt and YGW_Msg_#.txt and YGW_Sts_#.txt in the System32 directory of the Windows directory (the name of the windows directory may vary) e.g. C:\Winnt\System32. This is where the current directory of the interface will default to when running as a service and it will look here for these files.

  2. To start the interface interactively, go to the C:\Pipc\Interfaces\Ygw_# directory (or wherever you placed the interface) and run the file Ygw_#.bat where # is the point source for the interface.

  3. To start the interface as a service, run the PiSrvSiteStart.bat file or start it manually from the “NT Services” dialog box in the NT control panel.

  4. To stop the interface while it is running as a service, run the PiSrvSiteSopt.bat file or by typing the following at the command prompt:

\pi\interfaces\ygw_#\ygw_#.exe –stop

where # is the point source of the interface to be stopped. Do not stop the service using the Windows NT Services dialog box unless it will not stop any other way. Stopping the interface using the Windows NT Services dialog box will stop it immediately and prevent the interface from cleaning up after itself.



  1. Check the log file to verify that the interface that is running is the correct version.

Appendix — Error Messages


The following error messages may appear in the PI application log file Pipc\Dat\Pipc.log:

Binary mode is invalid when TTY protocol
An attempt was made to use the “/b” command line argument for binary communication with RS-232 (TTY) serial communication. Binary mode can only be used with TCP/IP when communicating with an ECGW3 gateway (only if the gateway has this functionality).

Buffer allocation failed
The interface has run out of memory.

Can not output because of invalid data type [PI tag]
The PI tag has been defined to output to a Yokogawa tag data type that has not been defined in the YGW_Oitem_#.txt file. See the YGW_Oitem_#.txt section above. This error is accompanied by a NOT_OUTPUT digital state for the PI tag.

Can not output because of invalid dig code [PI tag]
The value of the digital output tag has not been written to the DCS because the code to be written is invalid for the tag. Consult OSI Technical Support for assistance. This error is accompanied by a NOT_OUTPUT digital state for the PI tag.

Can not output because of invalid point def [PI tag]
The PI tag has been defined as a digital tag with a Location1 value of 3 (clip the value being written to the DCS if it is out of range). The value being written to the DCS is out of range and clipping digital tags is inappropriate. This error is accompanied by a NOT_OUTPUT digital state for the PI tag.

Can not output because of invalid point status [PI tag]
The value of the output tag has not been written to the DCS because its istat value is invalid. If the PI tag is a digital tag, the digital state that is to be written to the DCS is not valid for the PI tag (PI2 only—the state that was found must be in the digital state table between the zero and the span of the digital PI tag). If the PI tag is a numeric tag (PI2 or PI3), the value to be written is not valid (has an Istat value < 0). This error is accompanied by a NOT_OUTPUT digital state for the PI tag.

Can not output because out of range [PI tag]
The value of the output tag has not been written to the DCS because the value is outside the range of the tag. This error only occurs for output tags that have a Location1 value of 2 (output tag with range checking). This error is accompanied by a NOT_OUTPUT digital state for the PI tag.

Connected to gateway successfully
The interface has reconnected successfully to the gateway after a disconnect had previously been detected.

Digital state not found [Digital state string]
The interface could not find the digital state string in PI. Check that the definitions of the LOOP and ALARM status digital states are defined correctly in PI.

Digital state not found [Digital state string(Converted digital state string)]
The interface could not find the converted digital state string in PI. The converted digital state string applies to the strings defined in the YGW_STS_#.txt file (see the description of the “/dt” command line argument). Check that the definitions of the LOOP and ALARM status digital states are defined correctly in PI.

File not found [Filename]
The interface cannot find the file specified. Ensure that the file exists and is in the proper location. For VMS, this is the same location as the interface program. For NT it is either in the same location as the interface program (when run interactively) or in the Windows system directory (when run as a service).

Initalize connection successfully
A connection has been made to the gateway successfully.

Invalid communication mode
An attempt to use a communication protocol other than RS-232 (TTY) or TCP/IP was made.

Invalid machine type
The machine type specified by the “/mt” command line argument is invalid. Valid values are those specified in the description of “/mt” above.

Invalid retry count
The retry count specified by the “/rc” command line argument is invalid. A valid value is greater than or equal to 0.

Invalid starting digital state code
The digital start code specified by the “/ds” command line argument is invalid. A valid value is greater than 0.

Invalid text sending count
The send text continuous count specified by the “/sc” command line argument is invalid. A valid value is greater than 0.

Invalid timeout period
The timeout period specified by the “/to” command line argument is invalid. A valid value is greater than or equal to 0.

Invalid waiting time
The wait time specified by the “/wt” command line argument is invalid. A valid value is greater than 0.

Not defined TAG GET or BLOCK GET
The interface cannot determine whether to read the scan class in BLOCK_GET mode or TAG_GET mode. Consult OSI Technical Support for assistance.

Output data type not defined
The interface has no valid output data types defined. The most likely reason for this is that the YGW_OItem_#.txt file contains no output type entries. See the YGW_Oitem_#.txt section above.

Output failed [PI tag]
The value of the output tag could not be written to the DCS because the attempt to write it failed. This is either because the transmission from the DCS was corrupted or there was a Yokogawa data error. Data errors can be caused by three things: a) the specified tag does not exist, b) the transmission to the DCS was corrupted or c) the DCS is not in ready status. Data corruption is usually caused by hardware error.

Pi-api : PI API function error (API return code)
A call to the PI API has failed. This error only occurs in conjunction with a PI Float64 tag.

Point definition error [PI tag] extended point type PI type code not supported
This error only occurs if with PI3. A PI tag is being used that is of a type not supported by the interface. Supported types are: float16, float32, float64, int16, int32 and digital. PI type codes are as follows:

PI_Type_null

0

PI_Type_uint32

7

PI_Type_PI2

14

PI_Type_bool

1

PI_Type_int32

8

PI_Type_digital

101

PI_Type_uint8

2

PI_Type_uint64

9

PI_Type_blob

102

PI_Type_int8

3

PI_Type_int64

10

PI_Type_Pistring

105

PI_Type_char

4

PI_Type_float16

11

PI_Type_bad

255

PI_Type_uint16

5

PI_Type_float32

12







PI_Type_int16

6

PI_Type_float64

13







Point definition error [PI Tag] invalid Instrument tag [Current value]
The Instrumenttag field of the PI tag contains invalid characters. Valid characters are those found on a computer keyboard except <space> and lowercase alphabet characters.

Point definition error [PI Tag] invalid Location 1 (Current value)
The Location1 field of the PI tag is invalid. Valid values range from 0 to 3.

Point definition error [PI Tag] invalid Location 4 (Current value)
The Location4 field of the PI tag is invalid. Valid values range from 1 to the number of scan classes defined by the “/f” command line argument.

Point definition error [PI Tag] no Instrument tag
The Instrumenttag field of the PI tag is empty. It must contain the name of a Yokogawa tag (including data field).

Point definition error [PI Tag] Only input is supported for float64
The PI tag is a float64 tag that has been designated to be an output tag (Location1 = 1,2 or 3). Float64 tags can only be used for input tags (from the DSc to PI).

Putsnapx error PI API return status, tag: PI Tag, pt: PI tag’s point ID, cstat: PI Tag’s Istat
The interface failed to write the value to the snapshot of the PI tag (pisn_putsnapshotx() function of the PI API failed).

Putsnapx system error PI API return status, Previous PI API return status
The interface failed to write the value to the snapshot of the PI tag because of a system error (pisn_putsnapshotx() function of the PI API failed).

YGIConnect failed (Failed status)
Attempts to make a connection to the gateway failed. The failed status is indicated by the following table:

-1

Sending

-2

Receiving

-3

No data to receive

-4

Protocol error (received "ER")

-5

Timeout

-6

Incorrect terminate characters

-7

Failed to receive

-8

Failed to send

-9

Mismatch data size

-10

Port closed

-11

Overflow error

-12

Invalid port

-13

Connection failed

-14

Set communication state failed

-15

Set communication mask failed

-16

Communications setup failed


Revision History


Revision Number

Change Date

Change Author

Comments



3 Jan 97

MMG

Modified for PI 3 on NT and Unix



11 Jun 97

RGM

Updated



6 Aug 97

RGM

Updated to include NT, HPUX and AIX

Rev 4

4 Apr 99

RGM

Complete overhaul an reformat

Rev 5

26 Jul 99

RGM

Removed Unix installation, Added error messages



















































OSI Software Ltd.


Download 344.12 Kb.

Share with your friends:
1   2   3   4   5   6   7   8   9   10




The database is protected by copyright ©ininet.org 2024
send message

    Main page