SAP Plant Connectivity Shop Floor Automation


SAP Plant Connectivity Shop Floor AutomationHow to configure and use SAP Plant Connectivity forShop Floor Automation with SAP ManufacturingApplies to:SAP Plant Connectivity 2.3SP4 and laterSAP Plant Connectivity 15.0 and laterSummaryConfigure SAP Plant Connectivity to interact with an OPC Server and SAP MII to execute SAP METransactions from event data generated by the OPC Server connection to a Programmable Logic Controller(PLC).Author: Steve StubbsCompany: SAP Americas, Inc.Created on: 01 June 2015Author BioStephen (Steve) Stubbs of SAP Labs has a Bachelor’s Degree in Electrical Engineering Technology fromGeorgia Southern University. He is a member of the SAP LoB Manufacturing Organization in theConnected Manufacturing Solution Management group headed by Mike Lackey.1

Table of ContentsOverview . 3References. 3Use Case . 3OPC Server Configuration . 4OPC Server Tag names . 4PCo Configuration . 5MII Transaction . 5Creating the Source Agent . 5Creating an MII Destination . 8Creating an Agent Instance . 9Creating an Agent Instance Notification. 11Configuring an Agent Instance Notification Trigger . 12Adding an Agent Instance Notification Outputs . 13Adding an Expression Manually . 14Adding an Agent Instance Notification Destination . 15Generating the MII Transaction InputXML contents . 16Testing. . 18Starting the OPCQuickClient . 18Starting the PCo Agent Instance. 18Conclusion . 22Appendix A. 23Creating an MII PCoConnector Data Server. 23MII Transaction ProcessRequest Details . 27Related Content . 29Copyright. 302

OverviewA very common use for PCo is the integration of shop floor data into SAP Manufacturing. In this article wewill describe a specific use case for Shop Floor Automation and how PCo and an OPC Server are used tocollect data and events from the shop floor and send these data to SAP MII. We will use the followingcomponents to provide the details: SAP PCo 15.0 Kepware, Inc. KepServerEX V5.17.495.0 OPC Server SAP Manufacturing Intelligence and Integration (MII) 15.0All examples and screen shots are from the current shipping version of SAP PCo, MII, and KepServerEX.ReferencesPlease refer to the following documents for additional detail: PCo Help: Help: Server Vendor HelpUse CaseA PLC is operating a machine on the shop floor. It can generate the following data signals from the machine: MachineRunning (1 running, 0 idle)MachineSpeed (0-1000 Cycles per hour)MachineStatus (0 down, 1 available, 0 fault code(s))The Machine can also receive a Confirmation signal from SAP to validate that the Running event has beendetected RunningValidated (1 validated, 0 fault code(s))We want to detect when the MachineRunning event 1 and send the MachineSpeed and MachineStatus toMII, and have MII write a value to RunningValidated once it receives the machine data. Note: Additionalfunctionality that can be implemented in MII, such as integration with SAP ME, OEE, Or MII KPI, are notincluded in this document.3

OPC Server ConfigurationThe OPC Server has been configured to communicate with the Specific PLC. In a real scenario, a specificPLC model and communication protocol would be configured, such as a Siemens PLC over SiemensEthernet TCP/IP, or Allen-Bradley PLC over ControlLogix Ethernet. For purposes of this tutorial, the OPCServer Simulator is used. The tag names and values are real, but they are not derived from a real device.The OPC Server vendor provides very thorough documentation on how to configure a connection to a realPLC. However, you will need to have a technical understanding of the PLC software, the PLC Addresses andwhat their values mean, and the requirements for communicating with the PLC; please refer to the OPCVendor documentation for details.The OPC Server Configuration is shown below:OPC Server Tag namesThe following table describes the Device Tag Names identified in the OPC Server, and the MII Tag Namesthat PCo will exchange with MII:OPC Server Tag NamePCo/MII Tag ine1/PLC1/RunningValidated4

PCo ConfigurationPCo requires the following minimal configuration to function as a shop floor integration connector: A Source Agent that defines a connection to the shop floor (i.e., OPC Server)A Destination that can be accessed by PCo to send shop floor data to (i.e., MII)An Agent Instance, that can Subscribe to the OPC Server to receive events from the OPC Serverwhen one or more Tags’ value changesA Notification, which can detect a “trigger event” and send data to a Destination object (i.e., MIITransaction)MII TransactionWe have created a simple MII transaction named ExecuteRequest that does the following: Receives the NotifcationXML message from PCo Notificationo Transaction input property named InputXMLWrites a 1 to the RunningValidated tag in the PLC through PCo.o An MII PCoQuery using TagStore Mode, through an MII PCoConnector Data Server,provides this connection.For details on setting up an MII Data Server to support the capability of writing to PCo, please see AppendixA.Creating the Source AgentOpen PCo Management Console. In the Source Systems icon menu, select Add Source System. In thedialog box that appears, select OPC DA Agent, define a Unique Agent Name, and an optional Description,then Click OK:5

The Server tab of the Source Agent will list all the available OPC Server detected on the PC where PCo isinstalled. For our Use Case, we select Kepware Communications Server 5.17, DA 3.00On the Settings tab, make the following selections:In most cases, the default settings for all items are the correct ones. The specific change we want to make isin the Update Rate, which will tell the OPC server two configuration settings: How frequently to “poll” the PLC for dataHow frequently to update PCo when a data value or values change.We will change the Update rate to 00:00:00.500, which is an Update Rate of 500mSec:Note: Different OPC Server connections may require different Update rates, depending on a variety ofconditions. Coordinate this selection with the PLC or Control Systems engineers to confirm that the rate willretrieve the data at a mutually acceptable rate and the underlying network communications will support therate and the volume of traffic it will generate.On the Reliable Connections tab, we can set up the number of times PCo will attempt to re-connect to theOPC Server if communications are broken, and the number of retries to attempt. We will set 1000 retries and30 seconds between retries:6

Caution: No Data access will occur if the OPC Server Connection has disconnected until it issuccessfully re-connected. Also, if the number of Retries is exceeded, the Agent Instance goes intoFaulted State and must be re-Started to recover.PCo Source Agent Configuration is now complete. Always save changes before proceeding.7

Creating an MII DestinationFrom the PCo Management Console Destination Systems icon menu, select Add Destination System,select MII Destination, and provide a unique Destination name and optional comments. Click OK to create:In the MII Destination Server Tab that appears, add the following details: MII Server name, preferably the fully-qualified Domain name of the server;The MII PortThe MII Version (15.0 for the Use Case)The User name and Password for the user that will be authenticated for MII access and TransactionExecutionClick Test Connection. If successful, a success dialog box will appear:MII Transaction Destination is now configured. Click the Save icon before continuing.8

Creating an Agent InstanceFrom the Management Console Agent Instances icon menu, select Add Agent Instance. Select the SourceSystem to use for the instance, add a unique Agent Instance Name and optional Description. Click OK tocreate.For this Use Case, we will use most of the default values for the Agent Instance Host tab properties. Thechanges we will make are: Log Level set to Warning. For testing it is acceptable to use Information or Verbose, but forproduction systems Warning is preferred.9

Now, select the Subscription Items tab; we will add the Tags that we want to monitor from the OPC Server:Click the Browse Button, and then the Browse button that appears on the Browser dialog, then expand theBrowser tree as shown:Select all of the tags (Control key – click to select) under the PLC1 node and then click Add Selected Items.The tags are added to the Selected items List:You can edit the Name of each of the created subscribed tags if necessary; each Name must be unique tothe Agent Instance.Click OK to finish. The subscribed tags are now listed in the Subscription Items tab of the Agent Instance.When any of these tags changes value, the OPC Server will notify PCo, and PCo will store the new value ofthe tag in its internal store. This way, if the tags change value over a period of time, PCo will always keepthe most recent (current) value of each subscribed tag, so it will be current when used in a NotificationOutput as described in the next section.10

Because we only want to detect the MachineRunning event when it changes, check the Only Changes boxfor the tag, then click the Save icon.Creating an Agent Instance NotificationThe Notification is what actually does the work of executing the Destination functions.From the Agent Instances Icon menu (or by right-clicking the Agent Instance), select Add Notification.Confirm the correct Agent Instance is selected in the Agent Instance Name drop-down list, add a Notificationname (must be unique for the Agent Instance) and an optional Description, then click OK to create.Make sure the Enabled check box for the Notification is checked.11

Configuring an Agent Instance Notification TriggerA Notification Trigger is a logical expression that evaluates to a Boolean True or False value. The NotificationTrigger Type determines when the expression evaluation actually causes the Notification to execute, asdefined below:ExpressionValueTriggerTypeNotification ActionTrueOn TrueNotification executes, will wait for Expression to evaluate toFalse and then True before executing again.TrueWhile TrueNotification executes each time the Expression valueevaluates to TrueTrueOn FalseNotification does not executeTrueWhile FalseNotification does not executeFalseOn TrueNotification does not executeFalseWhile TrueNotification does not executeFalseOn FalseNotification executes, will wait for Expression to evaluate toTrue and then False before executing again.FalseWhile FalseNotification executes each time the Expression valueevaluates to FalseFor Our Use Case, we select Trigger Type to On True. For the Expression, since the Tag we want to use is

Shop Floor Automation with SAP Manufacturing Applies to: SAP Plant Connectivity 2.3SP4 and later SAP Plant Connectivity 15.0 and later Summary Configure SAP Plant Connectivity to interact with an OPC Server and SAP MII to execute SAP ME Transactions from event data generated by the OPC Server connection to a Programmable Logic Controller (PLC). Author: Steve Stubbs Company: SAP