---
title: Use the XMR Chart Function
slug: manufacturing-connect-edge/use-the-xmr-chart-function
docTags: 
createdAt: 2024-05-24T20:15:14.494Z
---

You can use the XMR Chart function to calculate a central line that remains constant. &#x20;

The central line is utilized to monitor the consistency and fluctuation of a process over a period of time. It comprises two distinct charts:&#x20;

- **Individual (X) Chart:** Used to trace individual values.
- **Moving Range (MR) chart:** Used to observe the variation between consecutive measurements.

# User Scenario

Review the following scenario for the XMR Chart function. Then, you will simulate PLC data and calculate the central line.

In a pharmaceutical production plant, consistent dosage in pill manufacturing is paramount for patient safety and regulatory compliance. High-precision scales measure the weight of individual pills, with data points collected at regular intervals.&#x20;

The XMR Chart function is integral to this process, providing real-time monitoring of dosage weights. By establishing a central line from initial measurements and calculating moving ranges, the plant ensures each pill is within the stringent weight specifications.&#x20;

# Step 1: Add a Device

Follow the steps to [Connect a Device](docId\:nm1lQfefyA-DSIfFitIty) and configure the following parameters:

- **Device Type**: Simulator
- **Driver Name**: Generator
- **Enable Alias Topics**: Select the checkbox.&#x20;

# Step 2: Add Tags

After connecting the device, add the following tags. See [Add a Tag](docId\:h5heqIcXrCY3NCH9KBg9I) to learn more.&#x20;

## Tag 1: input1

- **Name**: Select **S - Random value generator**
- **Value Type:** Select **float64**
- **Polling Interval**: Enter **1**
- **Tag Name**: Enter **input1**
- **Min\_value**: Enter **101**
- **Max\_value**: Enter **199**

# Step 3: Create Analytics Flows

You can now create the analytics flows using data from the device and tag you previously created.&#x20;

**To create an analytics flow with the XMR Chart Processor function:**

1. In Manufacturing Connect Edge, navigate to **Analytics**.&#x20;
2. On the analytics canvas, click **Add processor**.
   The *Create a processor* dialog box displays.
   ![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/ojOarjiFIu_o93VLKxZKT_image.png "The Add processor option")
3. Select **DataHub Subscribe**.
4. In the *Topic&#x20;*&#x66;ield, click the **Search&#x20;**&#x69;con, select the device you previously created, and then select the alias topic for the **input1&#x20;**&#x74;ag.
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/mPoKYDm83Y-4JkcALwt1B_image.png" size="80" width="1141" height="571" position="center" caption="Create a Processor dialog box" showCaption="true"}
5. Click **Save**.
6. Click **Add processor** again and select the **XMR Chart&#x20;**&#x70;rocessor.
   The *Edit a Processor&#x20;*&#x64;ialog box appears.
   - **Window Size:** Enter a value that represents the range to apply the XMR chart function. For this example, we input a value of **100**.
   - **Process Limit Multiplier:** It is used to calculate the upper and lower process limits. For this example, we input a value of **2.66**.
   - **TimeInterval:&#x20;**&#x49;f you know your input is going to publish at the expected interval, it is better to disable this timer by entering **0** in the field.
   - Click **Save**.
     ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/vaSBWq2F6ZMAqKRT__YkT_image.png" size="80" width="1135" height="667" position="center" caption="Edit a Processor dialog box" showCaption="true"}
7. Connect the *DataHub Subscribe* processor (tag: *input1*) to the *XMR Chart* processor with a wire and use the **events&#x20;**&#x63;onnection.
8. On the analytics canvas, click **Save**.
   The configured analytics flows should look like the following:
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/FDHbOpiciVDVJ7VkQlkLS_image.png" size="80" width="697" height="300" position="center" caption="Completed Flows Canvas" showCaption="true"}

# Step 4: View Output of Processor

Click the **View&#x20;**&#x69;con in the *XMR Chart&#x20;*&#x70;rocessor to view the output values.

The output of the XMR Chart function shows a central line at **101**, with an upper process limit of **101** and a lower process limit of **101**. ​

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/q5ZYtkfnWu8N-iTAODkWC_image.png" size="80" width="1475" height="523" position="center" caption="Output of XMR Chart" showCaption="true"}

Once the window is filled, other fields that are calculated as follows:&#x20;

- **Moving Ranges:** Difference of successive values.
- **Average Moving Range:&#x20;**&#x41;verage of the moving ranges.
- **Process Limit Multiplier:** Calculates the upper and lower process limits.
- **Upper and Lower Natural Process limit:&#x20;**&#x43;alculated by taking the product of process limit multiplier and average moving range, and adding/subtracting it from the central line.

In some cases, the central line is adjusted. Here are the cases:

- If current value is outside the process limits multiple times in a row.
- If the multiple values in a row are closer to either limit than they are to the central line.

