Using ERP-Scale to add weighing bar to a PI-Sheet

You are here:

Using ERP-Scale’s built in web-server, a weighing-meter (or progress bar) can be displayed in the PI-Sheet. This is idea for use when dispensing materials.

  • Does not require an OPC server
  • Does not require SAP Plant Connectivity (PCo)
  • This works with any scale (with a PC interface)
The following steps are required to create a prototype PI-Sheet in your SAP system:
These instructions are supplied to demonstrate the functionality of ERP-Scale. They do not offer a full solution for dispensing or weighing of materials. They are supplied by Pocket Programs without any warranty.
The progress bar is used to indicate to the operator if the weight is within the target range, however there is no validation that the actual weight falls within allowed tolerances. This validation functionality must be added to the PI-Sheet before it is used in a productive environment.

Prerequisites

  • Install the latest version of ERP-Scale (Version 4.0.1 build B13.A14 or later).
  • Connect the scale to the PC and define the communication settings (see ERP-Scale user manual)
  • Get a trial licence for ERP-Scale

Add data-fields to the parsing settings in ERP-Scale

Data-fields are used to write the target values from SAP ODA.
In ERP-Scale, create the following data-fields on the Data parsing page :

  • WEIGHT
  • UNIT
  • REQUEST_TEXT
  • TARGET_WEIGHT
  • TARGET_UNIT
  • TARGET_TOLERANCE_LOW
  • TARGET_TOLERANCE_HIGH


Also, create the following mapping of the data-fields WEIGHT and UNIT on the HUPAST tab:

Activate ERP-Scale’s web-server and define the HTML and JSON templates

The web-server built in to ERP-Scale is used to display the weighing progress bar in the PI-Sheet. First activate the web-server using the ERP-Scale configuration utility:

To display the progress bar in the PI-Sheet, ERP-Scale requires 2 web-templates:

  1. BAR – Type text/html used to display the weighing progress bar
  2. JSON – Type text/json

The content of each template is defined below:

BAR

This code has been updated to support SAP GUI release 7.30. It requires ERP-Scale PQS V4.0.1 build B14.H15 or later.
The target bar graphic is produced using the vector graphics library from Walter Zorn.
<!DOCTYPE html>
<html>
<head>
<title>ERP-Scale target weight bar</title>
<script src="wz_jsgraphics.js" type="text/javascript"></script>
</head>
<body>
<table  CELLPADDING="0" CELLSPACING="0" width="100%" id="toptable">
<tr>
<td width="100px" ><font color="blue" face="verdana">Material:</font></td>
<td width="300px" style="float: left;"><font color="blue" face="verdana"><div id="material"></div></font></td>
<td width="400px" rowspan="3" align='top';"

JSON

{
“weight”  : “[%Weight%] “,
“unit”       : “[%Unit%]”,
“text”       : “[%request_text%]”,
“tweight”  : “[%target_weight%]”,
“tunit”      : “[%target_unit%]”,
“tmin”        : “[%target_min%]”,
“tmax”       : “[%target_max%]”,
“thigh”      : “[%target_tol_high%]”,
“tlow”       : “[%target_tol_low%]”
}

Testing:

At this stage you can test the ERP-Scale web-server templates.

Using Internet Explorer (use IE as this is what the SAP GUI uses, do not use Chrome) to browse to:

http://<hostname>:8080/getweight?device=<device_name>&template=<template_name>
e.g.
http://<hostname>:8080/getweight?device=scale&template=bar
You should see this web-page displayed and the actual- weight should show the weight from the scale:

Create an OPC server for ERP-Scale in SAP ODA

ERP-Scale uses an RFC destination to communicate with SAP ODA. To create the RFC destination in SAP follow these steps:

  1. in the SAP IMG, select the task “Define RFC Destination for SAP ODA”

  2. Create a new TCP/IP connection:

Add Data Access Items for the target weight in SAP ODA

The PI-Sheet use ODA to communicate with ERP-Scale. Data access items are required to write the target values (weight, unit and tolerances) and read the actual weight and unit.

Use transaction COOPC1 to add new ODA data access items.

The data access item SCALE_ACTUAL_WEIGHT is used to read the actual weight from ERP-Scale. It is mapped to the data-field WEIGHT as follows:

The data access item SCALE_ACTUAL_UNIT is used to read the current unit from ERP-Scale. It is mapped to the data-field UNIT as follows:

Use cached data access for the SCALE_ACTUAL_UNIT
.

The following data access items are required to write the target values to ERP-Scale:
  • SCALE_REQUEST_TEXT mapped to SCALE.REQUEST_TEXT
  • SCALE_TARGET mapped to SCALE.TARGET_WEIGHT
  • TARGET_UNIT mapped to SCALE.TARGET_UNIT
  • SCALE_TOLERANCE_LOW mapped to SCALE.TARGET_TOLERANCE_LOW
  • SCALE_TOLERANCE_HIGH mapped to SCALE.TARGET_TOLERANCE_HIGH

Create two new PI characteristics in SAP

In the prototype the PI-Characteristics Z_ES_TOLERANCE_LOW and Z_ES_TOLERANCE_HIGH are used to define the under and over tolerance (as a factor, e.g. 0.1 = 10%). The prototype PI-Sheet uses fixed values, however material specific tolerances could be determined using a function module.

Create the following PI-Characteristics using transaction O25C:

  • Z_ES_TOLERANCE_LOW
  • Z_ES_TOLERANCE_HIGH

Create a General Process Instruction Category

The table that displays the material list in the PI-Sheet is defined as a Process Instruction Category (General) in SAP.

Use transaction O12C to create a new category:

See the attached Excel workbook for the required PI-Instructions. The low and high tolerances are defined in lines 130 and 140.

Change the characteristic values in the PPPI_EXPORT_DATA characteristics to match your ODA data access items.

Assign the Process instruction category to the control recipe destination

The newly created process instruction category must be assigned to the control recipe destination using transaction O10C.

Also consider if the Process Manufacturing Cockpit will require re-activation.

Add process instructions for the weighing bar to the master recipe

In the master receipe, add process instructions to display the progress bar. Use transaction C202:

Change the characteristic values in the PPPI_EXPORT_DATA characteristics to match your ODA data access items
.See the attached Excel work-book for details of the PI characteristics.

The long-text of the PPPI_LAYOUT (0002) is as follows:

Check that the layout (especially line breaks) is as shown above
.

The text is below:

.

Was this article helpful?
Dislike 0
Views: 18
© Copyright - Pocket Programs