---
title: Use the Base Conversion Function
slug: manufacturing-connect-edge-v2/use-the-base-conversion-function
docTags: 
createdAt: 2024-05-24T20:18:34.463Z
---

Base conversion is the process of converting a number from one numeral system to another.&#x20;

You have the following base conversion options:

- decimal -> binary&#x20;
- decimal -> hexaDecimal&#x20;
- decimal -> octaDecimal&#x20;
- binary -> decimal
- octaDecimal -> decimal&#x20;
- hexaDecimal -> decimal

:::hint{type="info"}
**Notes**:

- For conversion of various units to decimal, it is expected that the input is a string value.
- Your input needs to have a field named **value&#xA0;**&#x69;f you are converting from binary, octadecimal, or hexadecimal to decimal.
:::

# User Scenario

Review the following user scenario for using the Base Conversion processor. In manufacturing plants, engineers need to work with machines that use different protocols. If a machine produces diagnostic data in one type of format, and the monitoring software requires decimal format for analysis, the Base Conversion Function can convert the data quickly. This allows for seamless integration between the machine and the monitoring system.

For this guide, you will simulate data coming from a PLC and generate the decimal values 200, 300, and 400. You will then convert them accordingly using base conversion.&#x20;

## Step 1: Add a Device

Follow the steps to [Connect a Device](docId\:SqalV8ImyZmn8xA-56gno) and configure the following parameters.&#x20;

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

## Step 2: Add Tags&#x20;

After connecting the device, [Add Tags](docId:-5nFrBQ-uriWOY3GACnPt) to the device. Create the following tags.&#x20;

### Tag 1

- **Name**: Select **S - Random value generator**.
- **Value Type**: Select **int64**.&#x20;
- **Polling Interval**: Enter **5**.
- **Tag Name**: Enter **Tag 1**.&#x20;
- **Min\_value**: Enter **200**.
- **Max\_value**: Enter **200**.

### Tag 2

- **Name**: Select **S - Random value generator**.
- **Value Type**: Select **int64**.&#x20;
- **Polling Interval**: Enter **5**.
- **Tag Name**: Enter **Tag 2**.&#x20;
- **Min\_value**: Enter **300**.
- **Max\_value**: Enter **300**.

### Tag 3

- **Name**: Select **S - Random value generator**.
- **Value Type**: Select **int64**.&#x20;
- **Polling Interval**: Enter **5**.
- **Tag Name**: Enter **Tag 3**.&#x20;
- **Min\_value**: Enter **400**.
- **Max\_value**: Enter **400**.

## Step 3: Create Analytics Flows

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

**To create the analytics flow:**

1. Navigate to **Analytics**.&#x20;
2. On the analytics canvas, clic&#x6B;**&#x20;Add processor**.&#x20;
   The *Create a processor* dialog displays.&#x20;
3. On the analytics canvas, click **Add processor**.&#x20;
   The *Create a processor* dialog displays.&#x20;
   ![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/pXkpyh9sJmC8t1Jbi1Hva_image.png "The Add processor option")
4. Select **DataHub Subscribe**.&#x20;
5. 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 **Tag 1**.
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/WaDXeuXWgR9ChWORs8P3P_image.png" size="80" width="1141" height="571" position="center" caption="Topic search icon" showCaption="true"}
6. Click **Save**.&#x20;
7. Click **Add processor** again and select **Base Conversion**.&#x20;
8. In the **Conversion&#x20;**&#x66;ield, make sure the default value **decimal -> binary** is selected, and click **Save**.&#x20;
9. Connect the two processors, select **Events**, and enter a definition o&#x66;**&#x20;tag1** for the connection.
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/23vVvuzdJZj86b-RlBzAu_image.png" size="80" width="1151" height="586" position="center" caption="Processor flow for Tag 1" showCaption="true"}
10. Repeat steps 2-8 for Tag 2 and configure the following:
    - In the *DataHub Subscribe* processor, select the alias topic for Tag 2.&#x20;
    - In the *Base Conversion* processor, select a conversion of **decimal -> hexaDecimal**.&#x20;
    - When you connect the two processors, select **Events&#x20;**&#x61;nd enter a definition of **tag2** for the connection.&#x20;
11. Repeat steps 2-8 for Tag 3 and configure the following:
    - In the *DataHub Subscribe* processor, select the alias topic for Tag 3.&#x20;
    - In the *Base Conversion* processor, select a conversion of **decimal -> octaDecimal**.&#x20;
    - When you connect the two processors, select **Events&#x20;**&#x61;nd enter a definition of **tag3** for the connection.&#x20;
12. On the analytics canvas, click **Save**.&#x20;

The configured analytics flows should look like the following.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/3idGlICEX8Ooh9eVNiZRZ_image.png" size="80" width="1140" height="847" position="center" caption="Completed analytics canvas" showCaption="true"}

## Step 4: View Base Conversion Data

You can view data on the analytics canvas by clicking the **View&#x20;**&#x69;con in each Base Conversion processor.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/4H0cVjqiRZ4l2ZyNuMvw7_image.png" size="80" width="1140" height="847" position="center" caption="View icons for Base Conversion processors" showCaption="true"}

### Base Conversion Data for Tag 1

The original decimal value of 200 is converted to a binary value of 11001000.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/YGd2clzpOkvBTd89cl2I__image.png" size="80" width="1133" height="775" position="center" caption="Tag 1 value after base conversion" showCaption="true"}

### Base Conversion Data for Tag 2

The original decimal value of 300 is converted to a hexadecimal value of 12c.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/ZBraA55xC_w9ZJChCSqhP_image.png" size="80" width="1131" height="781" position="center" caption="Tag 2 value after base conversion" showCaption="true"}

### Base Conversion Data for Tag 3

The original decimal value of 400 is converted to a octadecimal value of 620.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/WEsBIsf5WDuy7RbsUFzZ4_image.png" size="80" width="1125" height="773" position="center" caption="Tag 3 value after base conversion" showCaption="true"}

