Enhanced Method Processing (EMP)

EMP Concept

Use

Using the concept of enhanced method processing (EMP), you can program yourself the actions that run when a method of a PCo OPC UA server or a PCo Web server is called, if you want to achieve maximum flexibility.

You can use EMP if the configuration options that result from the interaction of methods with a direct system call, method notification and multiple call destination system, are not sufficient to cover your requirements.

Implementation

To use EMP with your own programming, you need Microsoft Visual Studio 2012 or higher as a programming environment. You set up the .NET-based implementation of a class that inherits from the PCo class MethodProcessingFramework.ApplicationMethodsBase and that is compiled to an assembly. For details about the procedure during the implementation and for an example, see the Implementation Guide Enhanced Method Processing (EMP) in Plant Connectivity 15.1. (See: SAP Note 2354578 Information published on SAP site.)

With the implementation of the EMP, you provide methods that can be made callable using the PCo OPC UA server or Web server. From the programmed flow of a method call, you can, if required, execute a destination system call whose return values can flow into further programming of the method. For this purpose, you provide special input and output variables in the EMP implementation that you can use in the Management Console to parameterize the destination system call. The EMP implementation of the method is called up using the method notification that you assign to the method.

The following overview shows how the EMP implementation is embedded in the configuration of the Management Console if a destination system is to be called from the EMP implementation.

If the EMP implementation handles the program logic completely when the method is called and does not call a destination system, you implement an EMP method without destination system call. The following graphic shows variable assignment for this case:

You can use the same EMP implementations for a PCo UA server and a PCo Web server. However, the different message log of UA method calls and service operation calls requires several adjustments to the context of the server:

  • If you create an EMP implementation for a PCo UA server, specific status codes need to be returned to the method caller according to the OPC UA standard. You can return to the caller the status code that is dependent on the method execution result using an additional parameter that is designed as a TypedObject (see also SAP Note 2395778 Information published on SAP site). This parameter is not relevant in a Web server environment.

  • If you want to use an EMP implementation in the context of a PCo Web server, it might be necessary to adjust the format of the response to the requirements of the caller. For this purpose, PCo provides a separate interface XYZ with which you can, if required, influence the response specific to each method.

The result of the implementation is a compiled assembly (DLL) that you copy to the system directory of the PCo installation. As a rule, the system directory is in the C:\Program Files (x86)\SAP\Plant Connectivity\System directory if you have installed PCo using the standard specifications on a Windows 64-bit operating system.

Configuration

To be able to use the methods defined in the EMP implementation, you need to load the method definitions from the assembly into the configuration of the OPC UA server or Web server in the Management Console. To do so, follow the steps that are described under Server Method Definitions Tab (OPC UA-Server) or Web Server Method Definitions Tab (Web Server).

You need to assign at least one method notification to the methods that are to be visible to a client and that are to be callable, and, if necessary, carry out variable assignment according to the principle described above.