Name of the WebApp

pUploadNVRs

 

What does this WebApp do?

 It allows you to upload an Excel sheet (XLSX or CSV) containing NVRs values to a Traveller.

Supppose you have a measurement equipment that writes process or product measurements to an Excel sheet and you want to record these values in EZ-MES. With this WebApp, you can upload this Excel sheet to EZ-MES and store relevant measurements as NVR values in a Part. This is done in a a Traveller Step.

 

Requirements

  • EZ-MES release 4083 or newer
  • Python 3.62 or newer and CGI on EZ-MES server side

 

Configuration

The first configuration step to to make a JSON file that specifies where the NVR datapoints are located in the Excel file and in which NVs to store these datapoints. This file is uploaded to EZ-MES as a document and used by the pUploadNVRs WebApp to get the right datapoints from the Excel file and store them in EZ-MES as NVRs.

 

The second configuration step is to add a calc type NV to the Traveller Step that will generate the URL to the pUploadNVRs WebApp. This URL will be shown to the user in the Traveller step. When the user clicks on this URL, the WebApp is opened, allowing the user to upload the Excel file and select the datapoints to be stored in EZ-MES as Part NVRs.

 

First configuration: JSON Document file 

 Here is how to JSON definition file looks like:


{
  "Name": "Demo pUploadNVR",
  "Description": "EZMES Upload NVR Config file",
  "Person": "aladhani",
  "Version": 1566568125822,
  "Max_Rows": 10,
  "Selected_Rows": "Last",
  "Datasets": [
  {
    "Name": "Stamp",
    "Column": 2,
    "Row": 2,
    "Direction": "Vertical",
    "NV": "NV19-000000037"
  },
  {
    "Name": "Relative Humidity",
    "Column": 3,
    "Row": 2,
    "Direction": "Vertical",
    "NV": "NV19-000000038"
  },
  {
    "Name": "Temperature [F]",
    "Column": 4,
    "Row": 2,
    "Direction": "Vertical",
    "NV": "NV19-000000039"
  }
  ]
}


Most attributes in this JSON file are self explaining except the following:

Max_Rows: The User Interface of the pUploadNVRs WebApp allows the user to select a NVR datapoint from a table with multiple datapoints. This attribute defines how many datapoints from the Excel file are shown in the table.

Selected_Rows: This attribute can be set to "First" or "Last". First means that the first Max_Row values are shown starting at the specified column and row numbers. Last means that the last Max_Row values are shown.

Direction: This attribute can be set to "Horizontal" or "Vertical". When set to Horizontal, datapoints are assumed to be in a row. When set to Vertical, datapoints are assumed to be in a column,

In the JSON example above, three types of measurements are read from the uploaded Excel file: (1) Stamp, (2) Humidity and (3) Temperature. All measurements are stored in colums (so vertically). Stamp measurements start on column 2 and row 2, Humidity measurements start on column 3 and row 2 and Temperature measurements start on column 4 and row 2. In the pUploadNVRs User Interface, only the 10 last measurements will be shown in a table. The user can here select the measurement to be stored as NVRs in EZ-MES.

 

Second configuration: Call to pUploadNVRs WebApp

The next step is to define in the Traveller Step the URL for calling the pUploadNVRs WebApp. This is done by adding a Calc type NVR to this step. The Calc NVR will generate a URL to the WebApp including the values that need to be passed to the WebApp. 

Here is an example of the Calc NVR that generated the WebApp URL:

pUploadNVRs 01 SD

Make sure that the NAME of the NVR starts with the string "URL ". So that the URL be clickable in the Traveller Step. Als make sure that the DISPLAY TYPE is set to "Text". In the field for the STRING FORMULA, enter:

'https://[YOUR DOMAIN]/WebApps/pUploadNVRs/?user=' + [CU] + '&FR=' + [FR] + '&UID=' + [UID] + '&DCDef=[YOUR DC NUMMER]'

Where:

YOUR DOMAIN = the main URL of your EZ-MES application (in our example: acme.eazyworks.com).

YOUR DC NUMMER = the document number of the uploaded JSON from the first configuration (see above).

[CU] = -- Current User --

[FR] = -- Current Part Traveler Number --

[UID] = -- Current Part UID --

 

Running the pUploadNVRs WebApp

After the JSON config file has been uploaded to EZ-MES as a document file and a NV has been added to the Traveller Step for calculating the URL of the pUploadNVRs WebApp, the WebApp can be run to upload NVR datapoints from an Excel file to a Part in EZ-MES.

 

First, start the Traveller and assign an UID to it:

pUploadNVRs 02 FR S1

 

In the next step, click on the generated URL.

pUploadNVRs 02 FR S2A

 

Next, the pUploadNVRs WebApp will be opened automatically and the correct FR, UID and DC values are passed on to this WebApp.

pUploadNVRs 02 FR S2B

 

After the Excel file has been uploaded, the datapoint as defined in the JSON configuration file will be displayed in a Table. You can select the desired datapoint to be saved in EZ-MES. The selected datapoint is shown on the right side. Next, press on the "SAVE TO EZ-MES" button to save this datapoint in the Part of the Traveller in EZ-MES.

pUploadNVRs 02 FR S2C

 

Next, you will see the saved datapoint in the EZ-MES Traveller.

pUploadNVRs 02 FR S2D