Skip to Content

SCADA Integration with SAP using SAP PI – Part 2 – Systems Integration

In my previous blog, I briefly explained about the systems involved and the business case. Let me share how systems Integration happens in this part. On the high level SAP ERP system will request Tag values for particular SCADA OPC Server Instance, in response OPC Server will reply with Tag values, Quality of the Tag value, Quality of the Tag, OPC Server Status, and Time Stamp.

A deep drive in to the Systems Integration:

As SAP ERP system makes a request and gets the response, so we made this as Client Proxy communication to SAP PI. On the other hand SAP PI system is connected to OPC Gateway (Technically: OPC Client System) across the Firewall. In OPC Gateway system a standard Web Service is exposed, this will be provided by vendors who supply .NET Wrapper software like MatrikonOPC/Advosol. So SAP PI will consume this Web Service at receiver end. A SOAP request sent by SAP PI will be received by service available in OPC Gateway, now this request has to be passed to OPC Server. In OPC Gateway Web Service request is mapped to a .Net program which will convert HTTP request to COM/DCOM Request and sends the same through ISS to OPC Server. OPC Server will process the request and reply with the necessary Tag Values to OPC Gateway, OPC Gateway will map the response to SOAP response, which will be reached to SAP ERP through Client proxy response. This is how synchronous communication happens between Integrated Systems.

Systems Integration

SAP ERP:

ERP makes a business request consists of Tag Names:

“A tag name in terms of SCADA represents a variable to hold various quantitative measures like GCV (Gross Calorific Value), NCV (Net Calorific Value), Pressure, Volume, and Temperature. Each quantitative measure will have its own tag name

Because all the data stored in SCADA will be in the form of Tags, ERP system should send relevant Tag Names to get the values. Sample tag names and specific codes for quantitative measures are given in my previous blog.

As ERP sends a Proxy request this could be manipulated as a SOAP request by using SOAP Message Protocol as XI, which will point to AAE (Advance Adapter Engine).

Sample Request XML Message  

OPC Gateway:

Client’s landscape has 2 OPC Gateway systems. Communication happens with either of the Gateway’s based on the availability. Each Gateway will be linked to available Instances of SCADA.

OPC Gateways are manipulated to handle SOAP request coming from SAP PI and a .Net Client Application (Wrapper Software) in OPC Gateway converts the call in to D[COM] request and sends to OPCSERVER.

.NET applications can access OPC servers only through a software layer that is usually called a .NET Wrapper. There are no OPC standard specifications for a .NET interface, so different vendors offer .NET wrapper software with much different interfaces and features.

One of the .NET wrapper software we used was ADVOSOL XMLDA.NET wrapper. This supports access to OPC DA and XML DA servers. The Helper classes of wrapper software provide user friendly server access methods for features such as browsing and reading item values.

OPC GATEWAY COMMUNICATION

OPC DA Sample Server & Matrikon OPC Explorer Client Application

OPC Gateway (OPC Client Machine) system with ISS installed and .NET wrapper running can be monitored using application called Matrikon OPC Explorer.

I have simulated OPC Server and OPC Gateway in my desktop using OPC .NET Sample DA Server –Tags and Tag values are maintained here (generally updated by RTU’s) and Matrikon OPC Explorer (for OPC Gateway) to view the tags values by installing .NET framework and ISS on Windows OS.

OPC DA 20 Server

OPC DA Server Client

In this OPC DA Sample Server, we can add New Tags, and edit existing Tag properties like Data type, Quality. If this OPC DA Sample Server is connected to RTU’s will have real Tags names as I mentioned in my first Blog.

Since it is manipulated on my machine to show case the Systems, I could load some dummy Tag names and provide dynamic values in to the Server Instance. [Please note Tag Name in terms of OPC Server is Item ID]

Now let’s see how to access the Tags available in OPC DA Sample Server in to Matrikon OPC Explorer application:

Since I have installed both (OPC DA Sample Server and Matrikon OPC Explorer) on the same host machine, when I open Matrikon OPC Explorer it will automatically detects available OPC Servers on the same host machine.

Now we will see how to add the Tags to view the values available in the OPC DA Sample Server Instance in Matrikon OPC Explorer application.

Press Add Tags which will open another window, this will allow adding of new Item ID: Tag Name to monitor:

OPC Sample Da 20 Server

This application (Matrikon OPC Explorer) need to be connected to the OPCSample.OpcDa.20Server.1, to achieve this press Connect button. Once we press this button you can see the Server is connected and Status as Running on the bottom left window with refresh rate.

OPC Sample SA 20 Server.1

Now we will see how to add the Tags to view the values available in the OPC DA Sample Server Instance in Matrikon OPC Explorer application.

Press Add Tags which will open another window, this will allow adding of new Item ID: Tag Name to monitor:

Matrikon OPC Explorer 

Press Browse Menu Item and select Flat Browse as follows:

Matrikon OPC Explorer

You can see all the available Tags/Item ID’s:

Matrikon OPC Explorer

Double click relevant Tags/Item ID you wish to explore, which will be added in to the Tag to be added window.

Now press File -> Update and Return

Matrikon OPC Explorer

With this action it will add the Tag to the Matrikon OPC Explorer main window and fetches the value available in: OPCSample.OpcDa.20Server.1 as shown below:

Matrikon OPC Explorer

This is how we monitor the Tag values in Matrikon OPC Explorer in OPC Gateway (OPC Client). Other than Matrikon OPC Explorer, you can use any other tools available.

Now we see how to get this value with the Web Service request from a web client like SOAPUI testing tool.

Web Service and Functions:

XML DA Sample Server

With the available Web Service we can Read / Write Tag Values available in OPC Gateway’s. We can utilize GetProperties function to get the Tag’s Properties like Quality and Time Stamp etc. We can utilize GetStatus function to check the status of the Tag value like Active/In-Active.

SOAPUI Request

SOAPUI Response

Once the Web Service is available, this can be used in SAP PI on receiving end. Let us see the Interface details with Read Operation, which will be triggered from SAP ERP TSW in my next blog. I hope this blog provides you little bit knowledge on OPC Gateway and OPC Server Instance.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply