doc e sap opc data access

32
6$3 $*Ø 1HXURWWVWUØ ’:DOOGRUI 6$32’$ 23&’DWD$FFHVV 5HOHDVH

Upload: shailendra-rane

Post on 19-Jan-2016

59 views

Category:

Documents


2 download

DESCRIPTION

SAP OPC Data Access

TRANSCRIPT

6$3��$*����é 1HXURWWVWU��������é '�������:DOOGRUI

6$3�2'$�23&�'DWD�$FFHVV�

5HOHDVH �� ��

6$3�2'$� 6$3�$*�

0DUFK�����

6$3�$* 6$3�2'$

0DUFK����� LLL

&RS\ULJKW

© Copyright 2000 SAP AG. All rights reserved.

No part of this brochure may be reproduced or transmitted in any form or for any purpose without theexpress permission of SAP AG. The information contained herein may be changed without priornotice.

Some software products marketed by SAP AG and its distributors contain proprietary softwarecomponents of other software vendors.

Microsoft®, WINDOWS®, NT®, EXCEL®, Word® and SQL Server® are registered trademarks ofMicrosoft Corporation.

IBM®, DB2®, OS/2®, DB2/6000®, Parallel Sysplex®, MVS/ESA®, RS/6000®, AIX®, S/390®, AS/400®,OS/390®, and OS/400® are registered trademarks of IBM Corporation.

ORACLE® is a registered trademark of ORACLE Corporation, California, USA.

INFORMIX®-OnLine for SAP and Informix® Dynamic ServerTM

are registered trademarks of InformixSoftware Incorporated.

UNIX®, X/Open®, OSF/1®, and Motif® are registered trademarks of The Open Group.

HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World Wide WebConsortium, Laboratory for Computer Science NE43-358, Massachusetts Institute of Technology, 545Technology Square, Cambridge, MA 02139.

JAVA® is a registered trademark of Sun Microsystems, Inc. , 901 San Antonio Road, Palo Alto, CA94303 USA.

JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc., used under license for technologyinvented and implemented by Netscape.

SAP, SAP Logo, mySAP.com, mySAP.com Marketplace, mySAP.com Workplace, mySAP.comBusiness Scenarios, mySAP.com Application Hosting, WebFlow, R/2, R/3, RIVA, ABAP, SAPBusiness Workflow, SAP EarlyWatch, SAP ArchiveLink, BAPI, SAPPHIRE, Management Cockpit,SEM, are trademarks or registered trademarks of SAP AG in Germany and in several other countriesall over the world. All other products mentioned are trademarks or registered trademarks of theirrespective companies.

6$3�2'$� 6$3�$*�

0DUFK�����

7\SRJUDSKLF�&RQYHQWLRQV

7KLV�FRQYHQWLRQ ,V�XVHG�IRU

6FUHHQ�WH[W Words or characters you see on the screen (thisincludes system messages, field names, screentitles, menu names, and menu items).

8VHU�HQWU\ Exact user input. These are words and charactersyou type on the keyboard exactly as they are in thedocumentation.

�9DULDEOH�XVHUHQWU\!

Variable user input. Pointed brackets indicate thatyou replace these variables with appropriatekeyboard entries.

ALL CAPITALS Report names, program names, transaction codes,table names, ABAP/4 language elements, filenames, and directories.

%RRN�WLWOH Cross-references to other books

.(<�&$3 Keys on your keyboard. Most often, function keys(for example, )� and the (17(5 key) arerepresented this way.

7KLV�LFRQ +HOSV�\RX�LGHQWLI\

([DPSOHAn example. Examples help clarify complicatedconcepts or activities.

1RWH A note. Notes can contain important informationlike special considerations or exceptions.

&DXWLRQA caution. Cautions should help you avoid errors.for example, those that could lead to data loss.

6$3�$* 6$3�2'$

0DUFK����� �

&RQWHQWV

Copyright .................................................................................................................... iiiProduct Overview ............................................................................................................ 3

What is OPC?............................................................................................................. 3What is SAP ODA?..................................................................................................... 3What are the Benefits of SAP ODA?.......................................................................... 3What is the Difference Between SAP ODA and PI-PCS?.......................................... 4

Functions......................................................................................................................... 5Basic Concepts........................................................................................................... 5Basic Functions of the SAP ODA Connector ............................................................. 7

Server Browsing..................................................................................................... 7Namespace Browsing ............................................................................................ 7Reading Values...................................................................................................... 8Writing Values...................................................................................................... 10

Application Scenarios in the R/3 System ...................................................................... 11During System Administration .................................................................................. 11During Recipe Creation ............................................................................................ 12In the PI Sheet.......................................................................................................... 13

Settings in the R/3 System............................................................................................ 14Customizing Settings................................................................................................ 14

Defining RFC Destinations for SAP ODA ............................................................ 14Defining OPC Servers.......................................................................................... 15Defining OPC Items ............................................................................................. 16

Settings in the Master Recipe or Process Order...................................................... 17Characteristic PPPI_OPC_ITEM ......................................................................... 17Dynamic Function Call ......................................................................................... 18

Installing and Uninstalling the SAP ODA Connector..................................................... 21Basic Terms.............................................................................................................. 21Prerequisites............................................................................................................. 21Installing the SAP ODA Connector........................................................................... 22Using MS DOS Commands to Operate the SAP ODA Connector........................... 26

Starting SAP ODA as a Service........................................................................... 26Stopping the SAP ODA Service........................................................................... 26Starting SAP ODA as a Program......................................................................... 26Troubleshooting ................................................................................................... 27

Uninstalling the SAP ODA Connector ...................................................................... 27

6$3�2'$� 6$3�$*�

� 0DUFK�����

6$3�$* 6$3�2'$

3URGXFW�2YHUYLHZ

� 0DUFK�����

3URGXFW�2YHUYLHZ

:KDW�LV�23&"

OPC stands for 2/(�IRU�3URFHVV�&RQWURO and represents an industry standardbased on COM/DCOM technologies. It defines a set of vendor-independentinterfaces for use in process automation and was specifically designed to meetthe requirements of the process control level. OPC servers provide process datathat OPC clients can request. This facilitates data exchange betweenapplications considerably.

At present, OPC clients and OPC servers are PC-based systems with MicrosoftWindows NT, Windows CE, Windows 98, or Windows 95 as their operatingsystems.

For more information about OPC, see the OPC Foundation Web pages underKWWS���ZZZ�RSFIRXQGDWLRQ�RUJ�und ZZZ�RSFHXURSH�RUJ.

:KDW�LV�6$3�2'$"

SAP offers the SAP ODA (OPC Data Access) component based on the OPCindustry standard. SAP ODA is a component for reading and writing values ofand into any OPC Data Access server of version 1.0 or 2.0. In addition, SAPODA comprises a number of different functions for system administration. One ofthe components of SAP ODA is the SAP ODA Connector, which is locatedoutside the SAP System.

:KDW�DUH�WKH�%HQHILWV�RI�6$3�2'$"• No custom-programming or additional middleware is required to use SAP

ODA. The installation and configuration effort is negligible.

• Up-to-date information from process control can be passed on to the role-specific mySAP.com Workplaces for process manufacturing in a timelyfashion.

• Actual data retrieval from automated process steps and the setting ofparameters can be included as interactive functions in the PI sheet.

• Automatic reading and writing of data from the SAP PI sheet reduces thenumber of errors that are easily made during manual data entry.

• SAP ODA provides a unique interface for all mySAP.com components forwhich an OPC solution is to be implemented.

6$3�$* 6$3�2'$

3URGXFW�2YHUYLHZ

0DUFK����� �

:KDW�LV�WKH�'LIIHUHQFH�%HWZHHQ�6$3�2'$�DQG�3,�3&6"

SAP ODA does not replace the existing PI-PCS interface. The two interfaceshave different communication capabilities and complement each other. Note thefollowing differences:

6$3�2'$ 3,�3&6�,QWHUIDFH

• SAP ODA supports manual orsemi-manual processes whereinteraction is a requirement. Bypressing a button in the SAP PIsheet, variable values from fullyautomated process steps inexternal systems can be read orset.

• In its current version, SAP ODAonly works unidirectional, whichmeans that the SAP Systemalways represents the client.

• Since OPC is a general industrystandard, individual systems neednot be certified by SAP. There isno need for additionalprogramming.

• The PI-PCS interface supportsfully automated processes. Youcan, for example, automaticallysend messages to the SAPSystem whenever certain eventsoccur.

• The SAP System passes oncomplete control recipes toprocess control. After they havebeen processed, externallyrecorded data is sent back to theSAP System, where it is posted.

• PI-PCS is a proprietary interfacedeveloped by SAP. To link externalsystems via the PI-PCS interface,these systems must implementinterfaces and have them certifiedby SAP.

6$3�$* 6$3�2'$

� 0DUFK�����

)XQFWLRQV

%DVLF�&RQFHSWV

To use SAP ODA successfully, you should understand the following terms andconcepts:

7HUP 'HVFULSWLRQ

23&�'DWD�$FFHVVVHUYHU

OPC Data Access servers are OLE servers thatprovide interfaces in compliance with the OPCspecification to read or write data from a lower-levelsystem (for example, a process control system).Each data point is stored as an item along with anitem ID that is unique for every server (see "Fullyqualified item ID" below). All items of an OPC serverare organized in a namespace (address space) thatcan either be flat or hierarchical.

23&�6HUYHU�%URZVLQJ The OPC specification describes an interfacethrough which an OPC client can obtain a list ofinstalled OPC servers. The Registry entries of therelevant server are read.

23&�FOLHQW Through COM mechanisms, an OPC client uses thepublic interfaces of an OPC server to read data fromthis server or write data to it. The OPC server canbe installed on the same machine as the OPC client(COM) or on a different machine (DCOM).

1DPHVSDFH�%URZVLQJ Optionally, OPC servers can provide interfaces thatOPC clients can use to browse a server’snamespace. The namespace can either be flat (onlyitems) or hierarchical (nodes and items).

,WHP Every readable and/or writeable data point of anOPC server is called an item. The OPC client firstneeds to identify the item (for example, bydetermining the fully qualified item ID throughnamespace browsing) before it can read or write theitem.

)XOO\�TXDOLILHG�LWHP�,' Since the namespace of an OPC server can beorganized hierarchically, the item IDs are onlyunique within the same level of a hierarchy. Toaddress the item uniquely, the OPC client can letthe OPC server generate a fully qualified item ID.This ID is unique for the entire OPC server.

Namespace example:

ProductionHall1|_ ProductionLine#2|_ ProductionLine#3

6$3�$* 6$3�2'$

)XQFWLRQV

0DUFK����� �

7HUP 'HVFULSWLRQ|_ Machine#58|_ Machine#12

|_ Sensor#943|_ Status

The fully qualified item ID for item "status" couldlook as follows:3URGXFWLRQ+DOO��3URGXFWLRQ/LQH���0DFKLQH����6HQVRU�����6WDWXV

5)&�5HPRWH�)XQFWLRQ�&DOO�

RFC is a method of communication developed bySAP that enables convenient and secure datatransfer between different systems. You can useRFC to call and execute predefined functions in anexternal system or within the same system.

Communication between the SAP System and the lower-level system takes placeas follows:

Via RFC, the SAP System sends a data request to the SAP ODA Connector,which, from the SAP System’s perspective, behaves like an RFC server. Theconnector converts the RFC request into an OPC-compliant call and sends it tothe relevant OPC server using COM. From an OPC perspective, the connectornow behaves like an OPC client.

Via COM, the requested data is sent back to the connector and from there on tothe SAP System via RFC.

1RWH

In its first version, SAP ODA does not support DCOM mechanisms. The SAPODA Connector and the OPC server must therefore be installed on the samemachine. You may, however, install any number of SAP ODAs on differentmachines.

6$3�$* 6$3�2'$

)XQFWLRQV

� 0DUFK�����

3URFHVV�FRQWURO�V\VWHP

&205)&

6$3�6\VWHP

23&&OLHQW

5)&6HUYHU

6$3�2'$�&RQQHFWRU

5)&23&6HUYHU

2'$

LQWHUIDFH

6$3

$SSOLFD�

WLRQ

%DVLF�)XQFWLRQV�RI�WKH�6$3�2'$�&RQQHFWRU

The SAP ODA Connector is the component of SAP ODA that is located outsidethe SAP System. The connector comprises the following basic functions that willbe described in more detail below:

• Server browsing

• Namespace browsing

• Reading values

• Writing values

6HUYHU�%URZVLQJ

This function requests a list of all available OPC servers that are installed on thesame machine as the SAP ODA Connector. This OPC server list is then madeavailable in the SAP System. The entries in the list include the OPC server IDand a non-technical description.

1DPHVSDFH�%URZVLQJ

The process data provided by the OPC server is represented as items. Thenamespace for these items can either be flat or hierarchical.

To read or write a particular value, the user must first identify the item. This issupported by the namespace browsing function.

The SAP ODA Connector performs the following steps for each RFC it receives:1. The connector establishes the connection to the relevant OPC server.

6$3�$* 6$3�2'$

)XQFWLRQV

0DUFK����� �

2. If the item structure is hierarchical, it browses the hierarchy and its items. Thenamespace hierarchy is displayed as a tree structure in the SAP System.

3. When the item is identified, the connector generates an item ID that is uniquefor this server and adopts the description.

4. The connector closes the connection to the OPC server.

5HDGLQJ�9DOXHV

The SAP System uses this function to read process data from OPC Data Accessservers.

The SAP ODA Connector performs the following steps for each RFC it receives:1. The connector establishes the connection to the relevant OPC server.2. It reads the values for each requested item.3. In addition to the values, it transfers the following data to the SAP System:

• The time stamp

• The quality

• Error codes if applicable4. The connector closes the connection to the OPC server.

7LPH�6WDPS

The time stamp is set depending on the type of data access when the values areread:

• For FDFKH�GDWD�DFFHVV, the latest buffered value and time when the valuewas read on the OPC server are transferred. The time stamp indicateshow old the value is.

• For GHYLFH�GDWD�DFFHVV, the current value and time when the value wasread by process control are transferred.

4XDOLW\

The OPC standard contains quality indicators for values read. A quality indicatorcomprises the following quality classes:

4XDOLW\ 6XEVWDWXV /LPLW

Specifies if a value isJRRG, XQFHUWDLQ� or EDG.

Provides a moredetailed description of aquality status. A valuecan, for example, beEDG because a devicefor value reading isbroken.

Provides information suchas if a value is outside thedefined value range of adevice or a sensormeasurement range.

A numerical value containing a specific definition is transferred for each qualityclass. The following quality messages are based on the OPC specification 'DWD$FFHVV�&XVWRP�,QWHUIDFH�6SHFLILFDWLRQ��9HUVLRQ�����(KWWS���ZZZ�RSFIRXQGDWLRQ�RUJ�und�ZZZ�RSFHXURSH�RUJ).

4XDOLW\�0HVVDJHV

6$3�$* 6$3�2'$

)XQFWLRQV

� 0DUFK�����

The SAP ODA Connector analyzes the quality values and issues a suitableinformation or error message depending on the quality value combination:

4 = Quality; 6 = Substatus / = Limit

4 6 / 6KRUW�7H[W /RQJ�7H[W

0 0 - Value is bad The value cannot be used

0 1 - Serverconfigurationerror

The value cannot be used due to a serverconfiguration error

0 2 - Missing datasource

The value cannot be determined since nological data source is defined at present

0 3 - Device failure The value cannot be used due to a devicefailure

0 4 0 Sensor failure The value cannot be used due to a sensorfailure

0 4 1 Sensor failure The value cannot be used due to a sensorfailure (lower measurement range limitreached)

0 4 2 Sensor failure The value cannot be used due to a sensorfailure (upper measurement range limitreached)

0 4 3 Sensor failure The value cannot be used due to a sensorfailure (constant value)

0 5 - Value isobsolete

Due to a connection problem, the value isobsolete and may therefore not be usable

0 6 - Value cannot bedetermined

Due to a connection problem, no value canbe determined

0 7 - Value cannot bedetermined

The value cannot be determined since thedata source is inactive or switched off

1 0 - Value isuncertain

The value is not accurate

1 1 - Value isobsolete

The value may be obsolete since the datasource has not provided data for sometime

1 4 0 Sensor notcalibrated

The value is not accurate since the sensor isnot calibrated correctly

1 4 1 Value is outsidevalue range

The value is not accurate since it is below thesensor measurement range

1 4 2 Value is outsidevalue range

The value is not accurate since it is above thesensor measurement range

1 4 3 Sensor not The value may be inaccurate since the

6$3�$* 6$3�2'$

)XQFWLRQV

0DUFK����� ��

4 6 / 6KRUW�7H[W /RQJ�7H[Wcalibrated sensor only provides constant values

1 5 0 Value is outsidevalue range

The value is outside the defined value range

1 5 1 Value is outsidevalue range

The value is below the defined value range

1 5 2 Value is outsidevalue range

The value is above the defined value range

1 5 3 Value is outsidevalue range

The value is outside the defined value range

1 6 - Value isuncertain

The value is not accurate since redundantdata sources provide diverging values

3 0 - Value is good The value is accurate

3 6 - Value is good The value is accurate but was set manually

:ULWLQJ�9DOXHV

Using this function, the SAP System can write process data into OPC DataAccess servers.

The SAP ODA Connector performs the following steps for each RFC it receives:1. The connector establishes the connection to the relevant OPC server.2. It writes the value of a certain item to this server.3. If the value contains an error, the server returns an error message.4. The connector closes the connection to the OPC server.

6$3�$* 6$3�2'$

$SSOLFDWLRQ�6FHQDULRV�LQ�WKH�5���6\VWHP

�� 0DUFK�����

$SSOLFDWLRQ�6FHQDULRV�LQ�WKH�5���6\VWHPIn general, you can integrate any mySAP.com components with all of the SAPODA Connector functions described above.

In the first version, the integration of SAP ODA with the R/3 System has beenrealized for the SAP PI sheet. In the following section, possible applicationscenarios in process manufacturing are described:

'XULQJ�6\VWHP�$GPLQLVWUDWLRQ

([DPSOH

While projecting a production line, different scales are installed at differentservers. To use the scales in the master recipe or process order as describedon page 12, the system administrator must do the following:

1. He installs the SAP ODA Connector.6HH��,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU��SDJH�����

2. He creates an RFC destination for the SAP ODA Connector in the R/3System.6HH��&UHDWLQJ�5)&�'HVWLQDWLRQV�IRU�6$3�2'$��SDJH����

3. He creates a server name for each OPC server.He can use value help to obtain a list of all registered OPC servers.6HH��'HILQLQJ�23&�6HUYHUV (page 15)

6\VWHPDGPLQLVWUDWRU

6$3�6\VWHP

2'$LQWHU�IDFH

23&�VHUYHUOLVW 6HUYHU

%URZVLQJ

6$3�2'$

&RQQHFWRU

6FDOH�VHUYHU

����NJ

23&VHUYHU

6$3�2'$

&RQQHFWRU

6FDOH�VHUYHU

����NJ

23&VHUYHU

6$3�2'$

&RQQHFWRU

6FDOH�VHUYHU

����NJ

23&VHUYHU

6$3�$* 6$3�2'$

$SSOLFDWLRQ�6FHQDULRV�LQ�WKH�5���6\VWHP

0DUFK����� ��

'XULQJ�5HFLSH�&UHDWLRQ

([DPSOH

While creating a master recipe, the process engineer wants to include afunction call in the PI sheet to read the current value from a specific scale. Hetherefore defines a dynamic function call in the recipe. An OPC item name ispassed on as a parameter of the COPF_OPC_ITEM_READ function module.Characteristic PPPI_OPC_ITEM can be used for which a value help isavailable.

• He can define QHZ OPC item names in the value help window.Another value help is available for selecting the OPC item ID. The processengineer can use namespace browsing to select the relevant data point.

• He can select the data point of a specific scale from a list of H[LVWLQJ OPCitem names.

6HH� &KDUDFWHULVWLF�333,B23&B,7(0�(page 17)

3URFHVVHQJLQHHU

6$3�6\VWHP

2'$LQWHU�IDFH

7HVW�FDOO

0DVWHU�UHFLSH

23&�LWHP�OLVW� 1DPHVSDFH%URZVLQJ

6$3�2'$

&RQQHFWRU

6FDOH�VHUYHU

����NJ

23&VHUYHU

6$3�$* 6$3�2'$

$SSOLFDWLRQ�6FHQDULRV�LQ�WKH�5���6\VWHP

�� 0DUFK�����

,Q�WKH�3,�6KHHW

([DPSOH

While maintaining a PI sheet, the process operator is to record a materialquantity for a particular phase in the PI sheet. This material quantity is to beposted as a goods movement in the R/3 System.

The process operator can use a pushbutton displayed at the correspondingposition in the PI sheet to transfer the current measured value of a scale to thePI sheet.

In this example, a function call has been defined in the master recipe orprocess order to which a concrete OPC item name (such as the current weightat a particular scale) has been passed on. This means that the value read inthe PI sheet is always the value measured at this specific scale.

6$3�6\VWHP

2'$LQWHU�IDFH

3,�VKHHW

:HLJK

��� .J

3URFHVVRSHUDWRU

6$3�2'$

&RQQHFWRU

6FDOH�VHUYHU

����NJ

23&VHUYHU

6$3�$* 6$3�2'$

6HWWLQJV�LQ�WKH�5���6\VWHP

0DUFK����� ��

6HWWLQJV�LQ�WKH�5���6\VWHP

&XVWRPL]LQJ�6HWWLQJV

3UHUHTXLVLWHV�

To successfully set up the R/3 System, we recommend installing the SAP ODAConnector first.

6HH� ,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU�(page 21)

Make the settings in Customizing for the R/3 System in the following sequence:1. Defining RFC Destinations for SAP ODA2. Defining OPC Servers3. Defining OPC Items

'HILQLQJ�5)&�'HVWLQDWLRQV�IRU�6$3�2'$

RFC enables the communication between the R/3 System and the SAP ODAConnector. Therefore, you must first define the RFC destination. Since the SAPODA Connector is an external program, you must register the RFC destination asa TCP/IP connection.

You can define an RFC destination in either of the following ways:

• From the 6$3�0HQX in the R/3 System, choose 7RROV��!�$GPLQLVWUDWLRQ�$GPLQLVWUDWLRQ��!�1HWZRUN��!�5)&�'HVWLQDWLRQV.

• In &XVWRPL]LQJ for 3URGXFWLRQ�3ODQQLQJ�IRU�3URFHVV�,QGXVWULHV, choose3URFHVV�0DQDJHPHQW��!�6$3�2'$��!�'HILQH�5)&�'HVWLQDWLRQV�IRU�6$3�2'$�transaction SM59).

Enter the following when defining the RFC destination:

- Connection type: 7 (TCP/IP connections)

- Activation type: Registration

1RWH

In the RFC destination, you can enter any program ID and SAP gateway.They must, however, be identical to the entries that you have made when youinstalled the SAP ODA Connector (see page 21).

6HH�DOVR�

For more information on the procedure, see the SAP Library under %DVLV&RPSRQHQWV�->�%DVLV�6HUYLFHV���&RPPXQLFDWLRQ�,QWHUIDFHV ->�5HPRWH&RPPXQLFDWLRQV�-> 5)&�3URJUDPPLQJ�LQ�$%$3.

6$3�$* 6$3�2'$

6HWWLQJV�LQ�WKH�5���6\VWHP

�� 0DUFK�����

'HILQLQJ�23&�6HUYHUV

In this step, you define the names for the OPC servers to be addressed by SAPODA in the R/3 System. The OPC server name is made up of the SAP ODA RFCdestination, the OPC server ID, and a language-dependent short text.

By defining the OPC server name, you introduce an OPC server and thecorresponding SAP ODA Connectors to the R/3 System.

To define an OPC server name, proceed as follows:1. Go to Customizing for 3URGXFWLRQ�3ODQQLQJ�IRU�3URFHVV�,QGXVWULHV and choose

3URFHVV�0DQDJHPHQW��!�6$3�2'$��!�'HILQH�23&�6HUYHUV��transactionCOOPCS).The initial screen for OPC server maintenance appears.

2. Choose 1HZ�HQWULHV.The detail screen for OPC server maintenance appears.

3. Enter the following data:

• Any name for the OPC server

• If required, a separate description

• The RFC destination for SAP ODA

• The server ID for the OPC serverServer browsing is available as value help.

([DPSOH

23&�VHUYHU�QDPH� WEIGHING_B5

'HVFULSWLRQ� OPC server for weighing system, scales in room B5

5)&�GHVWLQDWLRQ� SAP ODARFC8

23&�VHUYHU�,'� weighing.system.v3.0a

1RWH

You can also define OPC servers in the master recipe or process order.

6HH� &KDUDFWHULVWLF�333,B23&B,7(0�(page 17)

6$3�$* 6$3�2'$

6HWWLQJV�LQ�WKH�5���6\VWHP

0DUFK����� ��

'HILQLQJ�23&�,WHPV

You define OPC item names to obtain short and precise names in the SAPenvironment. Users creating recipes, for example, then do not need to browsethe sometimes very large namespace of the relevant OPC server for each OPCitem. You also need the short item names for characteristic value assignment inprocess instructions.

To define OPC item names, proceed as follows:1. Go to Customizing for 3URGXFWLRQ�3ODQQLQJ�IRU�3URFHVV�,QGXVWULHV and choose

3URFHVV�0DQDJHPHQW��!�6$3�2'$��!�'HILQH�23&�,WHPV��transactionCOOPCI).The initial screen for OPC item maintenance appears.

2. Choose 1HZ�HQWULHV.3. Enter the following data:

• Any item name

• If required, a separate description

• The server name of the relevant OPC server

• The item IDNamespace browsing is available as value help. If the OPC server doesnot support namespace browsing, you must enter the item ID manually.

([DPSOH

23&�LWHP�QDPH� B5_ACTUAL_WEIGHT

'HVFULSWLRQ� Current measurement at weighing station B5

23&�VHUYHU�QDPH� WEIGHING_B5

23&�LWHP�,'� $.control8.weihtst3.current.cweight

1RWH

You can also define OPC items in the master recipe or process order.

6HH� &KDUDFWHULVWLF�333,B23&B,7(0�(page 17)

6$3�$* 6$3�2'$

6HWWLQJV�LQ�WKH�5���6\VWHP

�� 0DUFK�����

6HWWLQJV�LQ�WKH�0DVWHU�5HFLSH�RU�3URFHVV�2UGHU

To be able to use the SAP ODA functions in the PI sheet, the following newfeatures are available in the PP-PI environment:

• Characteristic PPPI_OPC_ITEM

• Function modules:

• COPF_OPC_ITEM_READ

• COPF_OPC_ITEM_WRITE_CHAR

• COPF_OPC_ITEM_WRITE_FLOAT

• COPF_OPC_ITEM_WRITE_TIME

&KDUDFWHULVWLF�333,B23&B,7(0

You can assign your item name as the characteristic value of PPPI_OPC_ITEM.The value help available for this characteristic provides all OPC item namesdefined in Customizing.

In addition, you can create or change new OPC item names directly throughvalue help.

'HILQLQJ�23&�,WHPV�

1. On the characteristic overview, call up value help for the &KDU�YDOXH field ofcharacteristic PPPI_OPC_ITEM.A list of all OPC item names known to the SAP System is displayed.

2. To create a new OPC item name, choose �1HZ�HQWULHV.The 1HZ�23&�,WHP�dialog box appears.

3. Enter a new name and a description.

4. Use value help to select an OPC server.

5. Specify the OPC item ID you want to use.Namespace browsing is available as value help. If the OPC server does notsupport namespace browsing, you must enter the item ID manually.

6. Select an OPC item ID.

7. If required, enter a buffer time in seconds.

6$3�$* 6$3�2'$

6HWWLQJV�LQ�WKH�5���6\VWHP

0DUFK����� ��

'\QDPLF�)XQFWLRQ�&DOO

The following function modules for dynamic function calls are available forreading or writing values in the PI sheet:

5HDGLQJ�YDOXHV�

Function module COPF_OPC_ITEM_READ

,PSRUW�SDUDPHWHUV

3DUDPHWHUQDPH

)RUPDW /HQJWK 'HVFULSWLRQ

PLANT CHAR 04 Plant

ITEM CHAR 20 OPC item name

DEVICE_READ CHAR 01 Indicator for source:

; Direct device access

EODQN Cache access

([SRUW�SDUDPHWHUV

3DUDPHWHUQDPH

)RUPDW /HQJWK 'HVFULSWLRQ

VALUE_CHAR CHAR 30 Value read for OPC item (as a characterstring)

VALUE_FLOAT FLOAT Value read for OPC item (as a floatingpoint number)

VALUE_DATE DATE 08 Value read for OPC item (as a date)

VALUE_TIME TIME 06 Value read for OPC item (as a time)

TIMESTAMP_LOCALDATE

DATS 08 Time stamp: local date

TIMESTAMP_LOCALTIME

TIMS 06 Time stamp: local time

RESULTTEXT CHAR 30 Result text

The following exceptions may be raised:

([FHSWLRQV

([FHSWLRQ 'HVFULSWLRQ

ITEM_UNKNOWN The OPC item name is unknown.

COMMUNICATION_ERROR A connection error has occurred.

6$3�$* 6$3�2'$

6HWWLQJV�LQ�WKH�5���6\VWHP

�� 0DUFK�����

:ULWLQJ�YDOXHV�DV�D�FKDUDFWHU�VWULQJ�

Function module COPF_OPC_ITEM_WRITE_CHAR

,PSRUW�SDUDPHWHUV

3DUDPHWHUQDPH

)RUPDW /HQJWK 'HVFULSWLRQ

PLANT CHAR 04 Plant

ITEM CHAR 20 OPC item name

VALUE_CHAR CHAR 30 OPC item value to be written as acharacter string

The following exceptions may be raised:

([FHSWLRQV

([FHSWLRQ 'HVFULSWLRQ

ITEM_UNKNOWN The OPC item name is unknown.

COMMUNICATION_ERROR A connection error has occurred.

Function module COPF_OPC_ITEM_WRITE_FLOAT

,PSRUW�SDUDPHWHUV

3DUDPHWHUQDPH

)RUPDW /HQJWK 'HVFULSWLRQ

PLANT CHAR 04 Plant

ITEM CHAR 20 OPC item name

VALUE_FLOAT FLOAT OPC item value to be written as a floatingpoint number

The following exceptions may be raised:

([FHSWLRQV

([FHSWLRQV 'HVFULSWLRQ

ITEM_UNKNOWN The OPC item name is unknown.

COMMUNICATION_ERROR A connection error has occurred.

6$3�$* 6$3�2'$

6HWWLQJV�LQ�WKH�5���6\VWHP

0DUFK����� ��

Function module COPF_OPC_ITEM_WRITE_TIME

,PSRUW�SDUDPHWHUV

3DUDPHWHUQDPH

)RUPDW /HQJWK 'HVFULSWLRQ

PLANT CHAR 04 Plant

ITEM CHAR 20 OPC item name

VALUE_DATE DATE 08 OPC item value to be written as a date

VALUE_TIME TIME 06 OPC item value to be written as a time

The following exceptions may be raised:

([FHSWLRQV

([FHSWLRQV 'HVFULSWLRQ

ITEM_UNKNOWN The OPC item name is unknown.

COMMUNICATION_ERROR A connection error has occurred.

6$3�$* 6$3�2'$

,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

�� 0DUFK�����

,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

%DVLF�7HUPV

To install the SAP ODA Connector successfully, you should understand thefollowing terms and concepts:

7HUP 'HVFULSWLRQ

6$35)&�,1, Configuration file containing the parameters that an RFCserver program can use to register at an SAP gateway.

The following parameters can, for example, be used in theSAPRFC.INI file:

− Destination (any name for the configuration)

− Host name of the SAP gateway

− Service name of the SAP gateway

− Program ID

1RWH

The SAP gateway and program ID must be specifiedin the RFC destination for the SAP ODA that you havedefined in transaction SM59.

6HH��'HILQLQJ�5)&�'HVWLQDWLRQV�IRU�6$3�2'$��SDJH���)

:LQGRZV�176HUYLFH

Microsoft terminology for a process that enables automaticexecution of specific system functions when starting thecomputer.

Windows-NT Services can also be started and stoppedmanually.

3UHUHTXLVLWHV

• The R/3 System on which SAP ODA is installed must be Release 3.1I orhigher.

• The SAP gateway must be installed.An SAP gateway can be installed at an SAP application server (defaultsetting). However, we recommend installing the SAP RFC gateway on thesame machine as the SAP ODA Connector.

• The PC on which the SAP ODA Connector is installed must have one of thefollowing operating systems:

− Windows NT (with Service Pack 3)

6$3�$* 6$3�2'$

,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

0DUFK����� ��

− Windows 95

− Windows 98

1RWH

Since SAP ODA does not support DCOM mechanisms, the SAP ODAConnector and the OPC server must be installed on the same machine.

,QVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

1. Double-click the 6HWXS�H[H�file.The welcome screen of the InstallShield Wizard appears.

2. Choose 1H[W��The &KRRVH�'HVWLQDWLRQ�/RFDWLRQ dialog box appears.

3. The InstallShield Wizard proposes a folder for installing SAP ODA.

• If you want to accept the proposed folder, choose 1H[W.

6$3�$* 6$3�2'$

,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

�� 0DUFK�����

• If you want to select a different folder, choose %URZVH���Choose 1H[W�

4. SAP ODA uses the SAPRFC.INI file to register at the SAP gateway with therequired parameters.

• If the SAPRFC.INI file exists, the InstallShield Wizard asks you whetheryou want to use an entry in the existing SAPRFC.INI file.

− 8VLQJ�DQ�HQWU\�LQ�WKH�H[LVWLQJ�6$35)&�,1,�ILOH

To use an existing entry, choose <HV.The dialog box with existing entries in the SAPRFC.INI file appears.

Select a destination in the dialog box and choose 1H[W.

− &UHDWLQJ�D�QHZ�HQWU\�LQ�WKH�6$35)&�,1,�ILOH

To create a new entry, choose 1R in the &KRRVH�'HVWLQDWLRQ�/RFDWLRQdialog box.

Enter the following parameters:

6$3�$* 6$3�2'$

,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

0DUFK����� ��

'HVWLQDWLRQ Any name for the configuration you areabout to create

&RQILJXUDWLRQ�SDUDPHWHUV

6$3�*DWHZD\�+RVW1DPH

Host name or IP address of the SAPgateway

6$3�*DWHZD\�6HUYLFH1DPH

Program name of the SAP gateway

3URJUDP�,' Any program ID under which SAP ODA isregistered at the SAP gateway

1RWH

The program ID must be specified inthe RFC destination for SAP ODAthat you defined in transaction SM59in the R/3 System.

Choose 1H[W.

• If the SAPRFC.INI file does not exist, the InstallShield Wizard creates it.

Enter the required parameters in the dialog box. Proceed as described in&UHDWH�D�QHZ�HQWU\�LQ�WKH�6$35)&�,1,�ILOH to do so.

5. The ,QVWDOO6KLHOG�:L]DUG�&RPSOHWH dialog box appears.

Choose )LQLVK.

If all your settings are correct, the SAPRFC.INI file is installed on your PCalong with the parameters you have specified.

6$3�$* 6$3�2'$

,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

�� 0DUFK�����

6. Restart your PC if the InstallShield Wizard tells you to do so.

1RWH

In the Windows system, SAP ODA is registered as a service that isautomatically started when you boot your computer.

If the system is unable to start the service, check the (YHQW�9LHZHU�/RJ forinformation about the error.

7. To start the service manually, proceed as follows:

a. In the Windows menu bar, choose 6WDUW��!�6HWWLQJV��!�&RQWURO�3DQHO.

b. In the &RQWURO�3DQHO dialog box, double-click 6HUYLFHV.

c. Select 6$3�23&�'DWD�$FFHVV�6HUYLFH.

d. Choose 6WDUW.

6$3�$* 6$3�2'$

,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

0DUFK����� ��

8VLQJ�06�'26�&RPPDQGV�WR�2SHUDWH�WKH�6$3�2'$�&RQQHFWRU

You can also use MS DOS commands to operate SAP ODA. You may want to dothis, for example, for troubleshooting.

1. Open MS DOS Prompt.

2. Navigate to the directory in which SAP ODA is stored.

3. Enter the relevant command.

6WDUWLQJ�6$3�2'$�DV�D�6HUYLFH

1. Register SAP ODA as a service.Enter command VDSRGD��L��'�'HVWLQDWLRQ!�to do so.

2. Proceed as follows to start the service:

a. In the Windows menu bar, choose 6WDUW��!�6HWWLQJV��!�&RQWURO�3DQHO.

b. In the &RQWURO�3DQHO dialog box, double-click 6HUYLFHV.

c. Select 6$3�23&�'DWD�$FFHVV�6HUYLFH.

d. Choose 6WDUW.

6WRSSLQJ�WKH�6$3�2'$�6HUYLFH

1. Proceed as follows to stop the service:

a. In the Windows menu bar, choose 6WDUW��!�6HWWLQJV��!�&RQWURO�3DQHO.

b. In the &RQWURO�3DQHO dialog box, double-click 6HUYLFHV.

c. Select 6$3�23&�'DWD�$FFHVV�6HUYLFH.

d. Choose 6WRS.

2. Deregister SAP ODA as a service.In MS DOS Prompt, enter the command VDSRGD��X�to do so.

6WDUWLQJ�6$3�2'$�DV�D�3URJUDP

You can also use MS DOS commands to start SAP ODA. You have the followingoptions:

• The SAPRFC.INI file is to be used when starting SAP ODA. This means thatthe parameters it contains are read when SAP ODA is started. In the MS DOScommand, you specify the destination that defines the configurationparameters in the SAPRFC.INI file.

&RPPDQG 0HDQLQJ

VDSRGD��'�'HVWLQDWLRQ! Start SAP ODA with destination

6$3�$* 6$3�2'$

,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

�� 0DUFK�����

• The SAPRFC.INI is QRW to be used. You must enter the following MS DOScommand directly one after another.

&RPPDQG 0HDQLQJ

VDSRGD��D�3URJUDPP�,'! Program ID

VDSRGD��J�6$3�*DWHZD\�+RVW�1DPH! Host name or IP address of theSAP gateway

VDSRGD��[�6$3�*DWHZD\�6HUYLFH1DPH!

Program name of the SAPgateway

1RWH

If SAP ODA is still registered as a service, you must first deregister it beforeyou can start the program.

7URXEOHVKRRWLQJ

You can use the following commands for troubleshooting:

&RPPDQG 0HDQLQJ

VDSRGD��" Lists all available commands

VDSRGD��W Generates a trace file that logs the RFC

VDSRGD��R��ILOH�QDPH! Generates a text file that logs the screenoutput

VDSRGD��ORJ��ILOH�QDPH! Generates a text file that logs the log events

8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

1. Stop the SAP ODA service before uninstalling the connector. Proceed asfollows to do so:

a. In the Windows menu bar, choose 6WDUW��!�6HWWLQJV��!�&RQWURO�3DQHO.

b. In the &RQWURO�3DQHO dialog box, double-click 6HUYLFHV.

c. Select 6$3�23&�'DWD�$FFHVV�6HUYLFH.

d. Choose 6WRS.

e. Choose &ORVH.

2. Double-click $GG�5HPRYH�3URJUDPV.The $GG�5HPRYH�3URJUDPV�3URSHUWLHV dialog box appears

3. In the ,QVWDOO�8QLQVWDOO tab, select 6$3�23&�'DWD�$FFHVV and choose$GG�5HPRYH.The system asks you whether you want to restart your computer.

6$3�$* 6$3�2'$

,QVWDOOLQJ�DQG�8QLQVWDOOLQJ�WKH�6$3�2'$�&RQQHFWRU

0DUFK����� ��

4. Choose 2..